text stringlengths 93 16.4k | id stringlengths 20 40 | metadata dict | input_ids listlengths 45 2.05k | attention_mask listlengths 45 2.05k | complexity int64 1 9 |
|---|---|---|---|---|---|
#[test]
fn test_fq_add() {
let f1 = Fq::from_str(
"18386742314266644595564329008376577163854043021652781768352795308532764650733",
)
.unwrap();
let f2 = Fq::from_str(
"39786307610986038981023499868190793548353538256264351797285876981647142458383",
)
.unwrap();
let f3 = Fq::from_str(
"5737174750126493097140088368381404874517028777389495743035013590241325924603",
)
.unwrap();
assert!(!f1.is_zero());
assert!(!f2.is_zero());
assert!(!f3.is_zero());
assert_eq!(f1 + &f2, f3);
} | rust_cleaned_test_functions.jsonl/81818 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 301
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
761,
80,
2891,
368,
341,
262,
1077,
282,
16,
284,
434,
80,
486,
1499,
2895,
1006,
286,
330,
16,
23,
18,
23,
21,
22,
19,
17,
18,
16,
19,
17,
21,
21,
21,
19,
19,
20,
24,
20,
20,
21,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_meta_item_list_word() {
run_test(
"#[foo(bar)]",
MetaList {
ident: ident("foo").into(),
paren_token: Default::default(),
nested: punctuated![NestedMeta::Meta(Meta::Word(ident("bar").into()))],
},
)
} | rust_cleaned_test_functions.jsonl/63943 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 150
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13381,
5634,
2019,
13533,
368,
341,
262,
1598,
4452,
1006,
286,
5869,
58,
7975,
54630,
7252,
756,
286,
15819,
852,
341,
310,
3524,
25,
3524,
445,
7975,
1827,
18122,
3148,
310,
37940,
6458,
25,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_repo_uri() {
let parsed_pkg_uri = PkgUri::new_repository("fuchsia.com".to_string()).unwrap();
let parsed_repo_uri = RepoUri::new("fuchsia.com".to_string()).unwrap();
let uris = &["fuchsia-pkg://fuchsia.com", "fuchsia-pkg://fuchsia.com/"];
for uri in uris {
let uri = RepoUri::parse(uri);
assert_eq!(uri.as_ref(), Ok(&parsed_repo_uri));
let uri = uri.unwrap();
assert_eq!(uri.host(), "fuchsia.com");
assert_eq!(uri.try_into().as_ref(), Ok(&parsed_pkg_uri));
}
let uris = &[
"fuchsia-pkg://fuchsia.com/foo",
"fuchsia-pkg://fuchsia.com/foo/0",
"fuchsia-pkg://fuchsia.com#bar",
"fuchsia-pkg://fuchsia.com?hash=80e8721f4eba5437c8b6e1604f6ee384f42aed2b6dfbfd0b616a864839cd7b4a",
];
for uri in uris {
assert_eq!(RepoUri::parse(uri), Err(ParseError::InvalidRepository));
}
} | rust_cleaned_test_functions.jsonl/122323 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 549
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
37784,
15572,
368,
341,
286,
1077,
15676,
64739,
15572,
284,
393,
7351,
13899,
486,
931,
47301,
445,
69,
73391,
905,
3263,
983,
3904,
6011,
15454,
543,
286,
1077,
15676,
37784,
15572,
284,
71509,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_cmac_smaller_tag_size() {
for i in 10..=16usize {
let a = tink_mac::subtle::AesCmac::new(KEY_RFC4493, i).unwrap();
for (l, e) in EXPECTED.iter() {
let exp = hex::decode(e).expect("Could not decode expected string");
assert!(
a.verify_mac(&exp[..i], &DATA_RFC4493[..*l]).is_ok(),
"Verification of smaller tag test vector did fail. Test Vector {} i={} l={}",
hex::encode(exp),
i,
l
);
}
}
} | rust_cleaned_test_functions.jsonl/77136 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 310
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
666,
11948,
15874,
13956,
9372,
2368,
368,
341,
262,
369,
600,
304,
220,
16,
15,
496,
28,
16,
21,
51878,
341,
286,
1077,
264,
284,
90584,
22802,
486,
1966,
11239,
486,
32,
288,
34,
11948,
486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_uint() {
test_serialize(192830918usize);
test_serialize(192830918u64);
test_serialize(192830918u32);
test_serialize(22313u16);
test_serialize(123u8);
} | rust_cleaned_test_functions.jsonl/73640 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 117
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15807,
368,
341,
286,
1273,
88686,
7,
16,
24,
17,
23,
18,
15,
24,
16,
23,
51878,
317,
286,
1273,
88686,
7,
16,
24,
17,
23,
18,
15,
24,
16,
23,
84,
21,
19,
317,
286,
1273,
88686,
7,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_memorysizeoptions_values() {
let mut iter = MemorySizeOptions::values();
assert_eq!(iter.size_hint(), (IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT, Some(IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT)));
assert_eq!(iter.len(), IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT);
assert!(iter.next().is_some());
assert_eq!(iter.size_hint(), (IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT - 1, Some(IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT - 1)));
assert_eq!(iter.len(), IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT - 1);
let values: Vec<MemorySizeOptions> = MemorySizeOptions::values().collect();
assert_eq!(values.len(), IcedConstants::MEMORY_SIZE_OPTIONS_ENUM_COUNT);
for (i, value) in values.into_iter().enumerate() {
assert_eq!(i, value as usize);
}
let values1: Vec<MemorySizeOptions> = MemorySizeOptions::values().collect();
let mut values2: Vec<MemorySizeOptions> = MemorySizeOptions::values().rev().collect();
values2.reverse();
assert_eq!(values1, values2);
} | rust_cleaned_test_functions.jsonl/11777 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 393
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
19195,
2141,
2875,
9146,
368,
341,
10217,
5206,
5367,
284,
13850,
1695,
3798,
486,
3661,
543,
6948,
10714,
10297,
2015,
2486,
45825,
1507,
320,
40,
1998,
9386,
486,
98706,
4098,
36321,
31894,
14672,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_functions() -> TestResult {
let mut p = Polar::new();
p.load_str(
r#"f(1);
f(2);
g(1);
g(2);
h(2);
k(x) if f(x) and h(x) and g(x);"#,
)?;
qnull(&mut p, "k(1)");
qeval(&mut p, "k(2)");
qnull(&mut p, "k(3)");
qvar(&mut p, "k(a)", "a", values![2]);
Ok(())
} | rust_cleaned_test_functions.jsonl/97606 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 238
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31708,
368,
1464,
3393,
2077,
341,
262,
1077,
5206,
281,
284,
55896,
486,
931,
543,
262,
281,
5104,
2895,
1006,
286,
435,
55543,
69,
7,
16,
317,
1843,
282,
7,
17,
317,
1843,
342,
7,
16,
317,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_generate_encrypted_pairs() {
let (ek, _dk) = test_keypair().keys();
let range = BigInt::from(0xFFFFFFFFFFFFFi64);
Paillier::generate_encrypted_pairs(&ek, &range);
} | rust_cleaned_test_functions.jsonl/60720 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 109
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
48851,
13781,
14026,
36430,
368,
341,
286,
1077,
320,
1225,
11,
716,
7584,
8,
284,
1273,
3097,
12670,
1005,
10563,
543,
286,
1077,
2088,
284,
62608,
486,
1499,
7,
15,
22620,
6389,
22715,
21,
19,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_tombstone() {
let manager = TableManager::new();
for i in 1..=10 {
manager.add(i, i as TableId).unwrap();
}
assert!(manager.add_tombstone(8).is_err());
manager.add_tombstone(11).unwrap();
for i in 1..=10 {
assert_eq!(manager.get(i).unwrap(), Table::new(i, i as TableId));
}
for i in 11..20 {
assert!(manager.get(i).is_none());
}
assert!(manager.add(10, 1).is_err());
for i in 12..=20 {
manager.add(i, i as TableId).unwrap();
}
for i in 12..=20 {
assert_eq!(manager.get(i).unwrap(), Table::new(i, i as TableId));
}
manager.gc(11).unwrap();
for i in 1..12 {
assert!(manager.get(i).is_none());
}
for i in 12..=20 {
assert_eq!(manager.get(i).unwrap(), Table::new(i, i as TableId));
}
} | rust_cleaned_test_functions.jsonl/28807 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 512
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
528,
2855,
10812,
368,
341,
286,
1077,
6645,
284,
6633,
2043,
486,
931,
543,
286,
369,
600,
304,
220,
16,
496,
28,
16,
15,
341,
310,
6645,
1364,
1956,
11,
600,
438,
6633,
764,
568,
15454,
54... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 8 |
#[test]
fn test_vector_min() {
let vector_a = Vector::new(1.0, 2.0, 3.0);
let vector_b = Vector::new(1.0, 1.0, 4.0);
let expected_result = Vector::new(1.0, 1.0, 3.0);
assert_eq!(vector_a.min(&vector_b), expected_result);
} | rust_cleaned_test_functions.jsonl/134060 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 138
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
12247,
7260,
368,
341,
286,
1077,
4621,
4306,
284,
4196,
486,
931,
7,
16,
13,
15,
11,
220,
17,
13,
15,
11,
220,
18,
13,
15,
317,
286,
1077,
4621,
880,
284,
4196,
486,
931,
7,
16,
13,
15,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_link_property() {
assert_eq!(
GiDocgen::from_str("[property@Gtk.Orientable:orientation]"),
Ok(GiDocgen::Property {
namespace: Some("Gtk".to_string()),
type_: "Orientable".to_string(),
name: "orientation".to_string(),
})
);
assert_eq!(
GiDocgen::from_str("[property@Gtk.Orientable]"),
Err(GiDocgenError::BrokenLinkType("property".to_string()))
);
assert_eq!(
GiDocgen::from_str("[property@Gtk.Orientable:]"),
Err(GiDocgenError::BrokenLinkType("property".to_string()))
);
} | rust_cleaned_test_functions.jsonl/78474 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 363
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7233,
16638,
368,
341,
286,
2060,
10714,
33673,
310,
15392,
9550,
4370,
486,
1499,
2895,
10937,
3699,
31,
45103,
8382,
12986,
480,
25,
24294,
60,
4461,
310,
7622,
6699,
72,
9550,
4370,
486,
3052,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_with_rfc3676_sig() {
let input = "Dear Alice,\nI hope you are well\n-- \nEddie\nyour shipboard computer";
assert_eq!(
"Dear Alice,\nI hope you are well\n".to_string(),
remove(input.to_string())
);
} | rust_cleaned_test_functions.jsonl/19450 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 139
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6615,
1710,
8316,
18,
21,
22,
21,
29252,
368,
341,
286,
1077,
1946,
284,
330,
30665,
29405,
26266,
77,
40,
3900,
498,
525,
1632,
1699,
313,
1124,
77,
36,
28454,
1699,
21732,
8284,
2482,
6366,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_serialization() -> Result<(), Error> {
let encrypted_message = EncryptedMessage::new(b"*ENCRYPTED*".to_vec(), [42u8; 24]);
let bin = encrypted_message.clone().serialize();
assert_eq!(EncryptedMessage::deserialize(bin)?, encrypted_message);
Ok(())
} | rust_cleaned_test_functions.jsonl/57993 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 128
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
25602,
2022,
368,
1464,
5714,
68843,
4600,
29,
341,
286,
1077,
24455,
6462,
284,
10751,
14026,
2052,
486,
931,
1883,
61593,
953,
42917,
1479,
9,
3263,
983,
13251,
1507,
508,
19,
17,
84,
23,
26,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_cmp_y_eq_m() {
let code = vec![0xC0, 0x2];
let mut nes = Cpu::new();
let mut memory = new_memory(code);
nes.Y = 0x02;
nes.next(&mut memory).unwrap();
assert_eq!(1, nes.C);
assert_eq!(1, nes.Z);
} | rust_cleaned_test_functions.jsonl/38738 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 163
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
35193,
4178,
10714,
717,
368,
341,
286,
1077,
2038,
284,
7486,
20703,
15,
12125,
15,
11,
220,
15,
87,
17,
935,
286,
1077,
5206,
308,
288,
284,
356,
5584,
486,
931,
543,
286,
1077,
5206,
4938,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_response_json() {
let server = server! {
request: b"\
GET /json HTTP/1.1\r\n\
user-agent: $USERAGENT\r\n\
accept: */*\r\n\
accept-encoding: gzip\r\n\
host: $HOST\r\n\
\r\n\
",
response: b"\
HTTP/1.1 200 OK\r\n\
Server: test\r\n\
Content-Length: 7\r\n\
\r\n\
\"Hello\"\
"
};
let url = format!("http://{}/json", server.addr());
let mut res = reqwest::get(&url).unwrap();
assert_eq!(res.url().as_str(), &url);
assert_eq!(res.status(), reqwest::StatusCode::OK);
assert_eq!(res.headers().get(reqwest::header::SERVER).unwrap(), &"test");
assert_eq!(res.headers().get(reqwest::header::CONTENT_LENGTH).unwrap(), &"7");
let body = res.json::<String>().unwrap();
assert_eq!("Hello", body);
} | rust_cleaned_test_functions.jsonl/26232 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 495
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9655,
9455,
368,
341,
262,
1077,
3538,
284,
3538,
0,
341,
286,
1681,
25,
293,
83383,
310,
7890,
608,
2236,
10130,
14,
16,
13,
16,
12016,
1699,
5661,
310,
1196,
41935,
25,
400,
6448,
90315,
120... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_brighten() {
let image: GrayImage =
ImageBuffer::from_raw(3, 2, vec![00u8, 01u8, 02u8, 10u8, 11u8, 12u8]).unwrap();
let expected: GrayImage =
ImageBuffer::from_raw(3, 2, vec![10u8, 11u8, 12u8, 20u8, 21u8, 22u8]).unwrap();
assert_pixels_eq!(&brighten(&image, 10), &expected);
} | rust_cleaned_test_functions.jsonl/26659 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 183
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
1291,
268,
368,
341,
286,
1077,
2168,
25,
23366,
1906,
4035,
310,
4654,
4095,
486,
1499,
16067,
7,
18,
11,
220,
17,
11,
7486,
20703,
15,
15,
84,
23,
11,
220,
15,
16,
84,
23,
11,
220,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_should_panic_bad_message() {
fn f() {
panic!("an error message");
}
let desc = TestDescAndFn {
desc: TestDesc {
name: StaticTestName("whatever"),
ignore: false,
should_panic: ShouldPanic::YesWithMessage("foobar"),
},
testfn: DynTestFn(Box::new(move |()| f())),
};
let (tx, rx) = channel();
run_test(&TestOpts::new(), false, desc, tx);
let (_, res, _) = rx.recv().unwrap();
assert!(res == TrFailed);
} | rust_cleaned_test_functions.jsonl/64528 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 314
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
43378,
620,
31270,
34199,
6462,
368,
341,
286,
5168,
282,
368,
341,
310,
21975,
17223,
276,
1465,
1943,
797,
286,
456,
286,
1077,
6560,
284,
3393,
11065,
3036,
24911,
341,
310,
6560,
25,
3393,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_setup_msrs() {
let kvm = Kvm::new().unwrap();
let vm = kvm.create_vm().unwrap();
let vcpu = vm.create_vcpu(0).unwrap();
setup_msrs(&vcpu).unwrap();
// See create_msr_entries for details.
let test_kvm_msrs_entry = [kvm_msr_entry {
index: msr_index::MSR_IA32_MISC_ENABLE,
..Default::default()
}];
let vec_size_bytes = mem::size_of::<kvm_msrs>() + mem::size_of::<kvm_msr_entry>();
let vec: Vec<u8> = Vec::with_capacity(vec_size_bytes);
let mut msrs: &mut kvm_msrs = unsafe {
// Converting the vector's memory to a struct is unsafe. Carefully using the read-only
// vector to size and set the members ensures no out-of-bounds errors below.
&mut *(vec.as_ptr() as *mut kvm_msrs)
};
unsafe {
let entries: &mut [kvm_msr_entry] = msrs.entries.as_mut_slice(1);
entries.copy_from_slice(&test_kvm_msrs_entry);
}
msrs.nmsrs = 1;
// get_msrs returns the number of msrs that it succeed in reading. We only want to read 1
// in this test case scenario.
let read_msrs = vcpu.get_msrs(&mut msrs).unwrap();
assert_eq!(read_msrs, 1);
// Official entries that were setup when we did setup_msrs. We need to assert that the
// expect.
let entry_vec = create_msr_entries();
unsafe {
assert_eq!(entry_vec[9], msrs.entries.as_slice(1)[0]);
}
} | rust_cleaned_test_functions.jsonl/33570 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 753
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21363,
21416,
5428,
368,
341,
286,
1077,
94748,
284,
730,
7338,
486,
931,
1005,
15454,
543,
286,
1077,
10995,
284,
94748,
2520,
39008,
1005,
15454,
543,
286,
1077,
348,
16475,
284,
10995,
2520,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_get_uri_error_mutual_exclusion() {
let log = slog::Logger::root(slog_glog_fmt::default_drain(), o!());
let config = Config::default();
let opts = Opts {
asset_id: Some(1234),
event_name: "EVENT_NAME".to_string(),
sender: "metalctl-test".to_string(),
ip_address: Some("1.2.3.4".to_string()),
mac_address: Some("11:22:33:44:55:66".to_string()),
payload: Some(serde_json::to_value("foo_payload").unwrap()),
};
get_uri(log, config, opts).unwrap();
} | rust_cleaned_test_functions.jsonl/93947 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 299
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
15572,
4096,
29523,
928,
2702,
8957,
368,
341,
286,
1077,
1487,
284,
34949,
486,
7395,
486,
2888,
1141,
839,
1889,
839,
38128,
486,
2258,
26680,
466,
1507,
297,
0,
1423,
286,
1077,
2193,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_prerequisite_events_are_captured() {
let recorder = InMemoryPrerequisiteEventRecorder {
events: RefCell::new(Vec::new()),
};
let store = TestStore::new();
let alice = User::with_key("alice").build();
let flag = store.flag("flagWithNestedPrereq").unwrap().clone();
let _ = evaluate(&store, &flag, &alice, Some(&recorder));
assert_that!(*recorder.events.borrow()).has_length(2);
let event = &recorder.events.borrow()[0];
assert_eq!("flagWithSatisfiedPrereq", event.target_flag_key);
assert_eq!("prereq", event.prerequisite_flag.key);
let event = &recorder.events.borrow()[1];
assert_eq!("flagWithNestedPrereq", event.target_flag_key);
assert_eq!("flagWithSatisfiedPrereq", event.prerequisite_flag.key);
} | rust_cleaned_test_functions.jsonl/133342 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 362
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5294,
90375,
19691,
56855,
666,
80228,
368,
341,
286,
1077,
48835,
284,
758,
10642,
3533,
90375,
1556,
47023,
341,
310,
4357,
25,
8550,
3599,
486,
931,
49923,
486,
931,
14702,
286,
2605,
286,
1077... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_range_vector() {
let input = vec![Token::LBracket, Token::Integer(1), Token::DotDot, Token::Integer(5), Token::RBracket];
let stmt = parse(&input).unwrap();
let range = Range {
incl_lower_bound: integer_expr(1),
excl_upper_bound: integer_expr(5),
step: integer_expr(1),
};
assert_eq!(stmt, Stmt::Eval(Expr::RangeVector(range.boxed())));
} | rust_cleaned_test_functions.jsonl/55688 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 214
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9698,
12247,
368,
341,
286,
1077,
1946,
284,
7486,
20703,
3323,
486,
43,
58500,
11,
9660,
486,
3486,
7,
16,
701,
9660,
486,
34207,
34207,
11,
9660,
486,
3486,
7,
20,
701,
9660,
486,
49,
58500,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_environment_and_offer() -> Result<(), Error> {
let decl = ComponentDecl {
offers: vec![OfferDecl::Protocol(OfferProtocolDecl {
source: OfferServiceSource::Child("childB".to_string()),
source_name: "childBOffer".into(),
target_name: "serviceSibling".into(),
target: OfferTarget::Child("childC".to_string()),
dependency_type: DependencyType::Strong,
})],
environments: vec![EnvironmentDeclBuilder::new()
.name("env")
.add_runner(cm_rust::RunnerRegistration {
source: RegistrationSource::Child("childA".into()),
source_name: "foo".into(),
target_name: "foo".into(),
})
.build()],
children: vec![
ChildDeclBuilder::new_lazy_child("childA").build(),
ChildDeclBuilder::new_lazy_child("childB").environment("env").build(),
ChildDeclBuilder::new_lazy_child("childC").build(),
],
..default_component_decl()
};
let mut expected: Vec<(DependencyNode, Vec<DependencyNode>)> = Vec::new();
expected.push((
DependencyNode::Child("childA".to_string()),
vec![DependencyNode::Child("childB".to_string())],
));
expected.push((
DependencyNode::Child("childB".to_string()),
vec![DependencyNode::Child("childC".to_string())],
));
expected.push((DependencyNode::Child("childC".to_string()), vec![]));
validate_results(expected, process_component_dependencies(&decl));
Ok(())
} | rust_cleaned_test_functions.jsonl/63296 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 844
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
51774,
8378,
67814,
368,
1464,
5714,
68843,
4600,
29,
341,
286,
1077,
3963,
284,
5578,
21629,
341,
310,
6081,
25,
7486,
20703,
39462,
21629,
486,
20689,
19238,
2945,
20689,
21629,
341,
394,
2530,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_blog_v2() {
use blog_v2::*;
let content = "I like potatoes!!!!!!";
let mut post = blog_v2::Post::new();
post.add_text(content);
let post = post.request_review();
let post = post.approve();
let post = post.approve();
assert_eq!(post.content(), content);
} | rust_cleaned_test_functions.jsonl/14854 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 164
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
35815,
2273,
17,
368,
341,
286,
990,
5010,
2273,
17,
79304,
286,
1077,
2213,
284,
330,
40,
1075,
34167,
17085,
2928,
3302,
286,
1077,
5206,
1736,
284,
5010,
2273,
17,
486,
4133,
486,
931,
1428,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_length_of_result_buffer() {
// `item_count` is chosen to not be a multiple of 64.
let item_count = 130;
let array_a = Int8Array::from_slice(&vec![1; item_count]);
let array_b = Int8Array::from_slice(&vec![2; item_count]);
let expected = BooleanArray::from_slice(&vec![false; item_count]);
let result = gt_eq(&array_a, &array_b).unwrap();
assert_eq!(result, expected)
} | rust_cleaned_test_functions.jsonl/38887 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 199
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5118,
3575,
5287,
7776,
368,
341,
286,
442,
1565,
1203,
3180,
63,
374,
11882,
311,
537,
387,
264,
5248,
315,
220,
21,
19,
624,
286,
1077,
1509,
3180,
284,
220,
16,
18,
15,
401,
286,
1077,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ancestor_iterator() {
let mut heaviest_subtree_fork_choice = setup_forks();
let parents: Vec<_> = heaviest_subtree_fork_choice
.ancestor_iterator((6, Hash::default()))
.collect();
assert_eq!(
parents,
vec![5, 3, 1, 0]
.into_iter()
.map(|s| (s, Hash::default()))
.collect::<Vec<_>>()
);
let parents: Vec<_> = heaviest_subtree_fork_choice
.ancestor_iterator((4, Hash::default()))
.collect();
assert_eq!(
parents,
vec![2, 1, 0]
.into_iter()
.map(|s| (s, Hash::default()))
.collect::<Vec<_>>()
);
let parents: Vec<_> = heaviest_subtree_fork_choice
.ancestor_iterator((1, Hash::default()))
.collect();
assert_eq!(
parents,
vec![0]
.into_iter()
.map(|s| (s, Hash::default()))
.collect::<Vec<_>>()
);
assert!(heaviest_subtree_fork_choice
.ancestor_iterator((0, Hash::default()))
.next()
.is_none());
heaviest_subtree_fork_choice.set_root((2, Hash::default()));
let parents: Vec<_> = heaviest_subtree_fork_choice
.ancestor_iterator((4, Hash::default()))
.collect();
assert_eq!(
parents,
vec![2]
.into_iter()
.map(|s| (s, Hash::default()))
.collect::<Vec<_>>()
);
} | rust_cleaned_test_functions.jsonl/70804 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 952
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
66878,
13491,
368,
341,
286,
1077,
5206,
566,
98362,
5228,
9344,
761,
669,
31936,
284,
6505,
761,
73302,
543,
286,
1077,
6562,
25,
11312,
32399,
29,
284,
566,
98362,
5228,
9344,
761,
669,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_stacktrace_default_values() {
// This needs an empty frame because "frames" is required
let json = r#"{
"frames": [
{}
]
}"#;
let stack = Annotated::new(RawStacktrace {
frames: Annotated::new(vec![Annotated::new(Frame::default())]),
..Default::default()
});
assert_eq_dbg!(stack, Annotated::from_json(json).unwrap());
assert_eq_str!(json, stack.to_json_pretty().unwrap());
} | rust_cleaned_test_functions.jsonl/14042 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 186
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15528,
15067,
9993,
9146,
368,
341,
262,
442,
1096,
3880,
458,
4287,
4034,
1576,
330,
23719,
1,
374,
2567,
198,
262,
1077,
2951,
284,
435,
55543,
515,
220,
330,
23719,
788,
2278,
262,
5613,
220,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_point_area_quater_hemisphere() {
// Triangles with near-180 degree edges that sum to a quarter-sphere.
area_quater_hemi_case(
&Point(Vector::new(1., 0.1 * EPSILON, EPSILON)),
&p000,
&p045,
&p180,
&pz,
PI,
);
// Four other triangles that sum to a quarter-sphere.
area_quater_hemi_case(
&Point(Vector::new(1., 1., EPSILON)),
&p000,
&p045,
&p180,
&pz,
PI,
);
// C++ Includes a loop of 100 perturbations on a hemisphere for more tests.
} | rust_cleaned_test_functions.jsonl/70559 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 382
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6085,
15030,
11280,
962,
1523,
336,
46794,
368,
341,
286,
442,
12359,
17248,
448,
3143,
12,
16,
23,
15,
8381,
12822,
429,
2629,
311,
264,
8338,
1331,
8023,
624,
286,
3082,
11280,
962,
1523,
2178... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_coalesce() {
assert_parses("const f = options.prop ?? 0;");
assert_syntax_error("if (options.prop ?? 0 || options.prop > 1000) {}");
} | rust_cleaned_test_functions.jsonl/7982 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 68
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11393,
73250,
368,
341,
262,
2060,
77113,
288,
445,
1024,
282,
284,
2606,
18417,
9415,
220,
15,
34649,
262,
2060,
78894,
4096,
445,
333,
320,
2875,
18417,
9415,
220,
15,
1369,
2606,
18417,
861,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_let() {
let t = LetTemplate { name: "world" }; // instantiate your struct
assert_eq!("Hello, world!", t.call().unwrap()); // then call it.
} | rust_cleaned_test_functions.jsonl/92834 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 65
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
1149,
368,
341,
262,
1077,
259,
284,
6771,
7275,
314,
829,
25,
330,
14615,
1,
20066,
442,
40902,
697,
2036,
198,
262,
2060,
10714,
17223,
9707,
11,
1879,
18789,
259,
8524,
1005,
15454,
13426... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_explorer_url() {
let mainnet = Network::Mainnet;
assert!(mainnet.explorer_url().is_some());
assert_eq!(mainnet.explorer_url().unwrap().as_str(), EXPLORER_MAIN.as_str());
let devnet = Network::Devnet;
assert!(devnet.explorer_url().is_some());
assert_eq!(devnet.explorer_url().unwrap().as_str(), EXPLORER_DEV.as_str());
let mut other = Network::try_from_name("atoi").unwrap();
assert!(other.explorer_url().is_none());
// Try setting a `cannot_be_a_base` url.
assert!(matches!(
other
.set_explorer_url(Url::parse("data:text/plain,stuff").unwrap())
.unwrap_err(),
Error::InvalidExplorerURL
));
let url = Url::parse("https://explorer.iota.org/devnet").unwrap();
assert!(other.set_explorer_url(url.clone()).is_ok());
assert_eq!(other.explorer_url().unwrap().clone(), url);
} | rust_cleaned_test_functions.jsonl/64592 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 374
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2702,
79825,
2903,
368,
341,
262,
1077,
1887,
4711,
284,
8141,
486,
6202,
4711,
280,
262,
2060,
10297,
3817,
4711,
2223,
79825,
2903,
1005,
285,
61855,
1423,
262,
2060,
10714,
10297,
3817,
4711,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_bundle_deserialize() {
let bun = Bundle::from_file("testdata/bundle.json").expect("parse testdata/bundle.json");
assert_that(&bun.name).is_equal_to("helloworld".to_string());
assert_that(&bun.schema_version).is_equal_to("v1.0.0".to_string());
assert_that(&bun.version).is_equal_to(Version::new(0, 1, 2));
assert_that(&bun.maintainers.unwrap().len()).is_equal_to(&1);
assert_that(&bun.custom.unwrap().len()).is_equal_to(&2);
} | rust_cleaned_test_functions.jsonl/112268 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 202
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
60986,
15768,
9050,
368,
341,
262,
1077,
44821,
284,
13182,
486,
1499,
2458,
445,
92425,
3470,
4206,
4323,
1827,
17119,
445,
6400,
1273,
691,
3470,
4206,
4323,
3071,
262,
2060,
70197,
2099,
65,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_lazy_arithmetic() {
let df = get_df();
let lf = df
.lazy()
.select(&[((col("sepal.width") * lit(100)).alias("super_wide"))])
.sort("super_wide", false);
print_plans(&lf);
let new = lf.collect().unwrap();
println!("{:?}", new);
assert_eq!(new.height(), 7);
assert_eq!(
new.column("super_wide").unwrap().f64().unwrap().get(0),
Some(300.0)
);
} | rust_cleaned_test_functions.jsonl/87593 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 271
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
49646,
25842,
25922,
368,
341,
286,
1077,
6764,
284,
633,
10894,
543,
286,
1077,
58080,
284,
6764,
198,
310,
659,
49013,
741,
310,
659,
1742,
2099,
46519,
2074,
445,
325,
19308,
5441,
899,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_trigonometric() {
let spec = "import math\noutput o: Float32 := sin(2.0)";
assert_eq!(0, num_type_errors(spec));
assert_eq!(get_type(spec), ValueTy::Float(FloatTy::F32));
} | rust_cleaned_test_functions.jsonl/110664 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 106
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3547,
73881,
23375,
368,
341,
286,
1077,
1398,
284,
330,
474,
6888,
1699,
3006,
297,
25,
13001,
18,
17,
1669,
7437,
7,
17,
13,
15,
24023,
286,
2060,
10714,
10297,
15,
11,
1629,
1819,
20196,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sub_assign_neg_overflow() {
let mut x = Decimal::new_raw(i128::MIN + 99999, 4);
x -= Decimal::TEN;
} | rust_cleaned_test_functions.jsonl/29272 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 75
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5228,
20688,
28209,
79073,
368,
341,
286,
1077,
5206,
856,
284,
26728,
486,
931,
16067,
1956,
16,
17,
23,
486,
16413,
488,
220,
24,
24,
24,
24,
24,
11,
220,
19,
317,
286,
856,
5982,
26728,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_cysteine_tgy() {
// "compressed" name for TGT and TGC
let info = codons::parse(make_pairs());
assert_eq!(info.name_for("TGT"), info.name_for("TGY"));
assert_eq!(info.name_for("TGC"), info.name_for("TGY"));
} | rust_cleaned_test_functions.jsonl/98932 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 113
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
666,
597,
68,
482,
528,
4577,
368,
341,
262,
442,
330,
45703,
1,
829,
369,
350,
25388,
323,
350,
22863,
198,
262,
1077,
3546,
284,
20329,
2382,
486,
6400,
36944,
36430,
1423,
262,
2060,
10714,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_camel_name() {
let cases = vec![
("AsyncRequest", "AsyncRequest"),
("asyncRequest", "AsyncRequest"),
("async_request", "AsyncRequest"),
("createID", "CreateId"),
("AsyncRClient", "AsyncRClient"),
("async_r_client", "AsyncRClient"),
("CreateIDForReq", "CreateIdForReq"),
("Create_ID_For_Req", "CreateIdForReq"),
("Create_ID_For__Req", "CreateIdForReq"),
("ID", "Id"),
("id", "Id"),
];
for (origin, exp) in cases {
let res = super::to_camel_case(&origin);
assert_eq!(res, exp);
}
} | rust_cleaned_test_functions.jsonl/96334 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 371
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
666,
35562,
1269,
368,
341,
286,
1077,
5048,
284,
7486,
90515,
310,
3489,
6525,
1900,
497,
330,
6525,
1900,
4461,
310,
3489,
7692,
1900,
497,
330,
6525,
1900,
4461,
310,
3489,
7692,
7893,
497,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_ecp_mul() {
let mut secp256r1 = EcGroup::new(EcGroupId::SecP256R1).unwrap();
let g = secp256r1.generator().unwrap();
assert_eq!(g.is_zero().unwrap(), false);
let k = Mpi::new(380689).unwrap();
let half_k = Mpi::new(617).unwrap();
/*
Basic sanity check - multiplying twice by k is same as multiply by k**2
*/
let pt1 = g.mul(&mut secp256r1, &k).unwrap();
assert_eq!(pt1.is_zero().unwrap(), false);
let pt2 = g.mul(&mut secp256r1, &half_k).unwrap();
assert_eq!(pt2.is_zero().unwrap(), false);
assert_eq!(pt1.eq(&pt2).unwrap(), false);
let pt3 = pt2.mul(&mut secp256r1, &half_k).unwrap();
assert_eq!(pt1.eq(&pt3).unwrap(), true);
assert_eq!(pt3.eq(&pt1).unwrap(), true);
assert_eq!(secp256r1.contains_point(&pt3).unwrap(), true);
let secp256k1 = EcGroup::new(EcGroupId::SecP256K1).unwrap();
assert_eq!(secp256k1.contains_point(&pt3).unwrap(), false);
} | rust_cleaned_test_functions.jsonl/78921 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 515
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
36844,
79,
24944,
368,
341,
286,
1077,
5206,
511,
4672,
17,
20,
21,
81,
16,
284,
36111,
2808,
486,
931,
10722,
66,
48410,
486,
8430,
47,
17,
20,
21,
49,
16,
568,
15454,
1428,
286,
1077,
342,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_no_fdset_files() {
assert_cli::Assert::main_binary()
.with_env(
assert_cli::Environment::inherit()
.insert("FDSET_PATH", get_fdset_dir("fdsets-invalid")),
)
.with_args(&["--msgtype=com.example.dog.Dog"])
.stdin(include_str!("samples/dog"))
.fails()
.and()
.stderr()
.contains("No valid fdset files found. Checked:")
.unwrap();
} | rust_cleaned_test_functions.jsonl/108208 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 244
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6536,
17676,
746,
10931,
368,
341,
262,
2060,
47147,
486,
8534,
486,
3817,
31761,
741,
286,
659,
4197,
15879,
1006,
310,
2060,
47147,
486,
12723,
486,
12825,
741,
394,
659,
4208,
445,
14596,
5884,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_public_key_ignores_highbit() {
let u = [0u8; 32];
let mut msb_zero = u;
msb_zero[31] &= 127u8;
let mut msb_one = u;
msb_one[31] |= 128u8;
assert_eq!(PublicKey::from(msb_zero), msb_one.as_ref());
assert_eq!(PublicKey::from(msb_zero), PublicKey::from(msb_one));
} | rust_cleaned_test_functions.jsonl/4451 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 198
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27074,
3097,
62,
622,
4589,
22680,
4489,
368,
341,
286,
1077,
575,
284,
508,
15,
84,
23,
26,
220,
18,
17,
4821,
286,
1077,
5206,
9829,
65,
19359,
284,
575,
280,
286,
9829,
65,
19359,
58,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_optional_field_some() {
let schema = r#"
{
"type":"record",
"name":"TestOptional",
"fields":[
{
"name":"a",
"type":["null","int"]
}
]
}
"#;
let schema = Schema::parse_str(schema).unwrap();
assert_eq!(schema, TestOptional::get_schema());
let optional_field = TestOptional { a: Some(4) };
serde_assert(optional_field);
} | rust_cleaned_test_functions.jsonl/114073 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 305
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
74644,
5013,
61855,
368,
341,
286,
1077,
10802,
284,
435,
2,
698,
286,
341,
310,
330,
1313,
3252,
8548,
756,
310,
330,
606,
3252,
2271,
15309,
756,
310,
330,
9007,
8899,
198,
394,
341,
503,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_receive_echo() {
crate::testutil::set_logger_for_test();
// reply with the appropriate parameters.
fn test<I: TestIpExt + IcmpIpExt>(assert_counters: &[&str])
where
IcmpEchoRequest: for<'a> IcmpMessage<I, &'a [u8], Code = IcmpUnusedCode>,
IcmpEchoReply: for<'a> IcmpMessage<
I,
&'a [u8],
Code = IcmpUnusedCode,
Body = OriginalPacket<&'a [u8]>,
>,
{
let req = IcmpEchoRequest::new(0, 0);
let req_body = &[1, 2, 3, 4];
let mut buffer = Buf::new(req_body.to_vec(), ..)
.encapsulate(IcmpPacketBuilder::<I, &[u8], _>::new(
I::DUMMY_CONFIG.remote_ip.get(),
I::DUMMY_CONFIG.local_ip.get(),
IcmpUnusedCode,
req,
))
.serialize_vec_outer()
.unwrap();
test_receive_ip_packet::<I, _, _, _, _>(
|_| {},
buffer.as_mut(),
I::DUMMY_CONFIG.local_ip,
64,
I::ICMP_IP_PROTO,
assert_counters,
Some((req.reply(), IcmpUnusedCode)),
|packet| assert_eq!(packet.original_packet().bytes(), req_body),
);
}
test::<Ipv4>(&["<IcmpIpTransportContext as BufferIpTransportContext<Ipv4>>::receive_ip_packet::echo_request", "send_ipv4_packet"]);
test::<Ipv6>(&["<IcmpIpTransportContext as BufferIpTransportContext<Ipv6>>::receive_ip_packet::echo_request", "send_ipv6_packet"]);
} | rust_cleaned_test_functions.jsonl/65666 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 992
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
38557,
68628,
368,
341,
286,
17717,
486,
1944,
1314,
486,
746,
27413,
5478,
4452,
1428,
1789,
286,
442,
9851,
448,
279,
8311,
5029,
382,
286,
5168,
1273,
13332,
25,
3393,
23378,
6756,
488,
358,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 4 |
#[test]
fn test_no_impl() {
let hdr = indoc! {"
struct A {
int a;
};
"};
let rs = quote! {};
run_test_ex(
"",
hdr,
rs,
quote! {
exclude_impls!()
exclude_utilities!()
generate!("A")
},
None,
None,
None,
);
} | rust_cleaned_test_functions.jsonl/9922 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 234
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6536,
21007,
368,
341,
262,
1077,
36615,
284,
1257,
509,
0,
314,
698,
286,
2036,
362,
341,
310,
526,
264,
280,
286,
2605,
262,
330,
2440,
262,
1077,
10036,
284,
12641,
0,
9321,
262,
1598,
4452... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_mod_inverse() {
let tests = [
["1234567", "458948883992"],
["239487239847", "2410312426921032588552076022197566074856950548502459942654116941958108831682612228890093858261341614673227141477904012196503648957050582631942730706805009223062734745341073406696246014589361659774041027169249453200378729434170325843778659198143763193776859869524088940195577346119843545301547043747207749969763750084308926339295559968882457872412993810129130294592999947926365264059284647209730384947211681434464714438488520940127459844288859336526896320919633919"],
["-10", "13"],
["-6193420858199668535", "2881"],
];
for test in &tests {
let element = BigInt::parse_bytes(test[0].as_bytes(), 10).unwrap();
let modulus = BigInt::parse_bytes(test[1].as_bytes(), 10).unwrap();
let inverse = element.clone().mod_inverse(&modulus).unwrap();
let cmp = (inverse * &element).mod_floor(&modulus);
assert_eq!(
cmp,
BigInt::one(),
"mod_inverse({}, {}) * {} % {} = {}, not 1",
&element,
&modulus,
&element,
&modulus,
&cmp
);
}
// exhaustive tests for small numbers
for n in 2..100 {
let modulus = BigInt::from_u64(n).unwrap();
for x in 1..n {
for sign in vec![1i64, -1i64] {
let element = BigInt::from_i64(sign * x as i64).unwrap();
let gcd = element.gcd(&modulus);
if !gcd.is_one() {
continue;
}
let inverse = element.clone().mod_inverse(&modulus).unwrap();
let cmp = (&inverse * &element).mod_floor(&modulus);
assert_eq!(
cmp,
BigInt::one(),
"mod_inverse({}, {}) * {} % {} = {}, not 1",
&element,
&modulus,
&element,
&modulus,
&cmp
);
}
}
}
} | rust_cleaned_test_functions.jsonl/14144 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1383
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7480,
63333,
368,
341,
286,
1077,
7032,
284,
2278,
310,
4383,
16,
17,
18,
19,
20,
21,
22,
497,
330,
19,
20,
23,
24,
19,
23,
23,
23,
18,
24,
24,
17,
8097,
2760,
4383,
17,
18,
24,
19,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 6 |
#[test]
fn test_calculate_storage_count_and_alive_bytes_0_accounts() {
let accounts = AccountsDb::new_single_for_tests();
let storage_maps = vec![];
let storage_info = StorageSizeAndCountMap::default();
let accounts_map = accounts.process_storage_slot(&storage_maps[..]);
AccountsDb::update_storage_info(&storage_info, &accounts_map, &Mutex::default());
assert!(storage_info.is_empty());
} | rust_cleaned_test_functions.jsonl/7053 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 179
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24005,
11207,
23310,
3180,
8378,
58850,
12524,
62,
15,
55665,
368,
341,
286,
1077,
9618,
284,
40655,
7994,
486,
931,
19487,
5478,
32509,
543,
286,
1077,
5819,
46512,
284,
7486,
0,
15078,
286,
1077... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_array_chunks_infer() {
let v: &[i32] = &[0, 1, 2, 3, 4, -4];
let c = v.array_chunks();
for &[a, b, c] in c {
assert_eq!(a + b + c, 3);
}
let v2: &[i32] = &[0, 1, 2, 3, 4, 5, 6];
let total = v2.array_chunks().map(|&[a, b]| a * b).sum::<i32>();
assert_eq!(total, 2 * 3 + 4 * 5);
} | rust_cleaned_test_functions.jsonl/9642 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 194
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3858,
65470,
1243,
802,
368,
341,
262,
1077,
348,
25,
44590,
72,
18,
17,
60,
284,
44590,
15,
11,
220,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
481,
19,
935,
262,
1077,
272,
284,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_spj_0_with_ac() {
let task = generate_judge_task(SOURCE_AC, PROBLEM);
let judge = Judge::new();
for report in judge.judge(task) {
match report {
Report::Accepted {
resource_usage: usage,
} => {
assert!(usage.real_time < Duration::from_secs(1) * 2);
assert!(usage.cpu_time < Duration::from_secs(1));
assert!(usage.memory < 32 * BYTES_PER_MB);
}
res => panic!("Wrong judge result: {}", res),
}
}
} | rust_cleaned_test_functions.jsonl/52119 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 297
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10123,
73,
62,
15,
6615,
14718,
368,
341,
262,
1077,
3383,
284,
6923,
5374,
19561,
12184,
3759,
13077,
15500,
11,
5308,
69292,
317,
262,
1077,
11651,
284,
20207,
486,
931,
543,
262,
369,
1895,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_decode_cmap_format_2() {
let font_buffer = read_fixture("../../../tests/data/fonts/HardGothicNormal.ttf");
let scope = ReadScope::new(&font_buffer);
let font_file = scope
.read::<OpenTypeFile>()
.expect("error reading font file");
let ttf = match font_file.font {
OpenTypeFont::Single(ttf) => ttf,
OpenTypeFont::Collection(_ttc) => panic!("expected TTF"),
};
let cmap = ttf
.read_table(&font_file.scope, tag::CMAP)
.unwrap()
.unwrap()
.read::<Cmap>()
.unwrap();
let encoding_record = cmap
.find_subtable(PlatformId::MACINTOSH, EncodingId(2))
.unwrap();
let cmap_subtable = cmap
.scope
.offset(usize::try_from(encoding_record.offset).unwrap())
.read::<CmapSubtable<'_>>()
.unwrap();
match cmap_subtable {
CmapSubtable::Format2 { .. } => {}
_ => panic!("expected cmap sub-table format 2 got something else"),
}
// Classic Mac OS Traditional Chinese encoding maps 0xA5CF to Unicode '\u0x7529' 甩
// // The expected value was determined by examining the glyph table generated by the tx tool
// that is part of https://github.com/adobe-type-tools/afdko/
// tx -dump data/fonts/HardGothicNormal.ttf | grep U+7529
assert_eq!(cmap_subtable.map_glyph(0xA5CF).unwrap(), Some(629));
// NOTE: Further test coverage of this format is done as part of
// aots::cmap2_test1
} | rust_cleaned_test_functions.jsonl/6594 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 648
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15227,
666,
2186,
8955,
62,
17,
368,
341,
262,
1077,
3301,
7776,
284,
1349,
74409,
445,
26744,
23841,
13167,
60667,
23354,
567,
38,
8767,
292,
12206,
45192,
797,
262,
1077,
6891,
284,
4457,
10803,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_write_bytes() {
let mut b = BooleanBufferBuilder::new(4);
b.append(false);
b.append(true);
b.append(false);
b.append(true);
assert_eq!(4, b.len());
assert_eq!(512, b.capacity());
let buffer = b.finish();
assert_eq!(1, buffer.len());
let mut b = BooleanBufferBuilder::new(4);
b.append_slice(&[false, true, false, true]);
assert_eq!(4, b.len());
assert_eq!(512, b.capacity());
let buffer = b.finish();
assert_eq!(1, buffer.len());
} | rust_cleaned_test_functions.jsonl/74113 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 289
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9165,
12524,
368,
341,
286,
1077,
5206,
293,
284,
6992,
4095,
3297,
486,
931,
7,
19,
317,
286,
293,
2057,
3576,
317,
286,
293,
2057,
3715,
317,
286,
293,
2057,
3576,
317,
286,
293,
2057,
3715,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_tag_downcast_mut() {
let mut tag = DummyTag::new(132, 1);
let t: &mut dyn ILTag = &mut tag;
match tag_downcast_mut::<DummyTag>(t) {
Some(v) => {
v.set_dummy(1234);
assert_eq!(1234, v.get_dummy())
}
None => panic!(),
}
let mut tag = ILRawTag::default_with_id(123);
let t: &mut dyn ILTag = &mut tag;
match tag_downcast_mut::<DummyTag>(t) {
None => (),
Some(_) => panic!(),
}
} | rust_cleaned_test_functions.jsonl/25692 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 257
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9372,
13998,
3829,
29523,
368,
341,
262,
1077,
5206,
4772,
284,
50567,
5668,
486,
931,
7,
16,
18,
17,
11,
220,
16,
317,
262,
1077,
259,
25,
609,
6984,
31070,
11344,
5668,
284,
609,
6984,
4772,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_tight_infinite_recursion() {
test_interpreter_and_jit_asm!(
"
entrypoint:
mov64 r3, 0x41414141
call entrypoint
exit",
[],
(),
{
|_vm, res: Result| {
matches!(res.unwrap_err(),
EbpfError::ExceededMaxInstructions(pc, initial_insn_count)
if pc == 31 && initial_insn_count == 4
)
}
},
4
);
} | rust_cleaned_test_functions.jsonl/59059 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 303
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
528,
491,
1243,
25722,
7080,
34280,
368,
341,
262,
1273,
15318,
28637,
8378,
5374,
275,
67529,
33673,
286,
6228,
286,
4343,
2768,
510,
286,
1974,
21,
19,
435,
18,
11,
220,
15,
87,
19,
16,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_stanza() {
let gem = test_gem();
assert_eq!(gem.stanza(), "gem 'cocoapods', '~> 1.4.0'")
} | rust_cleaned_test_functions.jsonl/126602 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 64
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1261,
26466,
368,
341,
262,
1077,
18747,
284,
1273,
87135,
543,
262,
2060,
10714,
10297,
34103,
1236,
26466,
1507,
330,
34103,
364,
66,
13140,
391,
29697,
516,
63470,
29,
220,
16,
13,
19,
13,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_task_too_much_gas() {
let mut context = get_context(accounts(1));
testing_env!(context.build());
let mut contract = Contract::new();
testing_env!(context
.is_view(false)
.attached_deposit(1000000000020000000100)
.build());
contract.create_task(
accounts(3),
"increment".to_string(),
"0 0 */1 * * *".to_string(),
Some(true),
Some(U128::from(100)),
Some(270_000_000_000_000),
None,
);
} | rust_cleaned_test_functions.jsonl/42991 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 315
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
12184,
2346,
78,
717,
1387,
82116,
368,
341,
286,
1077,
5206,
2266,
284,
633,
8467,
91868,
7,
16,
1106,
286,
7497,
15879,
10297,
2147,
13239,
1423,
286,
1077,
5206,
5116,
284,
19185,
486,
931,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_code_fmt() {
let expect_output = r#"Script {
code: "6d6f7665",
ty_args: [],
args: [],
}"#;
let script = Script::new(b"move".to_vec(), vec![], vec![]);
let mut output = String::new();
fmt::write(&mut output, format_args!("{:#?}", script))
.expect("Error occurred while trying to format Script.");
assert_eq!(output, expect_output);
println!("{:#?}", script);
} | rust_cleaned_test_functions.jsonl/34011 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 184
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4136,
38128,
368,
341,
262,
1077,
1720,
7645,
284,
435,
55543,
5910,
341,
262,
2038,
25,
330,
21,
67,
21,
69,
22,
21,
21,
20,
756,
262,
13580,
8384,
25,
10239,
262,
2827,
25,
10239,
9863,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_role() {
let role = Role {
color: 0,
hoist: true,
id: RoleId(123),
managed: false,
mentionable: true,
name: "test".to_owned(),
permissions: Permissions::ADMINISTRATOR,
position: 12,
tags: None,
};
serde_test::assert_tokens(
&role,
&[
Token::Struct {
name: "Role",
len: 8,
},
Token::Str("color"),
Token::U32(0),
Token::Str("hoist"),
Token::Bool(true),
Token::Str("id"),
Token::NewtypeStruct { name: "RoleId" },
Token::Str("123"),
Token::Str("managed"),
Token::Bool(false),
Token::Str("mentionable"),
Token::Bool(true),
Token::Str("name"),
Token::Str("test"),
Token::Str("permissions"),
Token::Str("8"),
Token::Str("position"),
Token::I64(12),
Token::StructEnd,
],
);
} | rust_cleaned_test_functions.jsonl/66287 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 772
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
19792,
368,
341,
286,
1077,
3476,
284,
15404,
341,
310,
1894,
25,
220,
15,
345,
310,
11386,
380,
25,
830,
345,
310,
877,
25,
15404,
764,
7,
16,
17,
18,
1326,
310,
8975,
25,
895,
345,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ldf_filter_invalid_label() {
let data_graph = graph(DATA_GRAPH_1);
let query_graph = graph("(n0:L3), (n1:L1), (n2:L2), (n0)-->(n1), (n1)-->(n2)");
let candidates = ldf_filter(&data_graph, &query_graph);
assert!(candidates.is_none())
} | rust_cleaned_test_functions.jsonl/13051 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 148
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
50573,
69,
8727,
31433,
6106,
368,
341,
286,
1077,
821,
14738,
284,
4771,
59093,
58360,
62,
16,
317,
286,
1077,
3239,
14738,
284,
4771,
31732,
77,
15,
69233,
18,
701,
320,
77,
16,
69233,
16,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sizes() {
assert_eq!(core::mem::size_of::<LeafNode<(), ()>>(), 16);
assert_eq!(core::mem::size_of::<LeafNode<i64, i64>>(), 16 + CAPACITY * 8 * 2);
assert_eq!(core::mem::size_of::<InternalNode<(), ()>>(), 112);
assert_eq!(core::mem::size_of::<InternalNode<i64, i64>>(), 112 + CAPACITY * 8 * 2);
} | rust_cleaned_test_functions.jsonl/92236 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 152
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
32159,
368,
341,
262,
2060,
10714,
10297,
2153,
486,
10536,
486,
2141,
3575,
27638,
31461,
1955,
68843,
1719,
2452,
1507,
220,
16,
21,
317,
262,
2060,
10714,
10297,
2153,
486,
10536,
486,
2141,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_common_prefix_bits_len() {
{
let hash1 = b"hello".test_only_hash();
let hash2 = b"HELLO".test_only_hash();
assert_eq!(hash1[0], 0b0011_0011);
assert_eq!(hash2[0], 0b1011_1000);
assert_eq!(hash1.common_prefix_bits_len(hash2), 0);
}
{
let hash1 = b"hello".test_only_hash();
let hash2 = b"world".test_only_hash();
assert_eq!(hash1[0], 0b0011_0011);
assert_eq!(hash2[0], 0b0100_0010);
assert_eq!(hash1.common_prefix_bits_len(hash2), 1);
}
{
let hash1 = b"hello".test_only_hash();
let hash2 = b"100011001000".test_only_hash();
assert_eq!(hash1[0], 0b0011_0011);
assert_eq!(hash2[0], 0b0011_0011);
assert_eq!(hash1[1], 0b0011_1000);
assert_eq!(hash2[1], 0b0010_0010);
assert_eq!(hash1.common_prefix_bits_len(hash2), 11);
}
{
let hash1 = b"hello".test_only_hash();
let hash2 = b"hello".test_only_hash();
assert_eq!(
hash1.common_prefix_bits_len(hash2),
HashValue::LENGTH_IN_BITS
);
}
} | rust_cleaned_test_functions.jsonl/118042 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 605
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21107,
13974,
20034,
6043,
368,
341,
262,
341,
286,
1077,
5175,
16,
284,
293,
1,
14990,
3263,
1944,
18410,
8950,
543,
286,
1077,
5175,
17,
284,
293,
1,
50712,
1593,
3263,
1944,
18410,
8950,
543,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_push() {
let example = "hello world";
let mut repr = Repr::new(example);
repr.push('!');
assert_eq!(repr.as_str(), "hello world!");
assert_eq!(repr.len(), 12);
} | rust_cleaned_test_functions.jsonl/14391 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 115
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14218,
368,
341,
286,
1077,
3110,
284,
330,
14990,
1879,
876,
286,
1077,
5206,
30636,
284,
1032,
649,
486,
931,
66203,
317,
286,
30636,
2552,
492,
0,
3755,
286,
2060,
10714,
10297,
30837,
5357,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_message_downcast() {
let value = 11 as i32;
let msg = Message::new(value);
assert_eq!(value, *msg.content_as::<i32>().unwrap());
assert_eq!(None, msg.content_as::<u32>());
} | rust_cleaned_test_functions.jsonl/122614 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 114
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6462,
13998,
3829,
368,
341,
286,
1077,
897,
284,
220,
16,
16,
438,
600,
18,
17,
280,
286,
1077,
3750,
284,
4856,
486,
931,
3679,
317,
286,
2060,
10714,
10297,
957,
11,
353,
3236,
5406,
11898,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_start_as_follower() {
let r = new_test_raft(1, vec![1, 2, 3], 10, 1, new_storage());
assert_eq!(r.state, StateRole::Follower);
} | rust_cleaned_test_functions.jsonl/130677 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 75
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4906,
11898,
761,
29034,
368,
341,
262,
1077,
435,
284,
501,
4452,
62,
2944,
7,
16,
11,
7486,
20703,
16,
11,
220,
17,
11,
220,
18,
1125,
220,
16,
15,
11,
220,
16,
11,
501,
23310,
1423,
262... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_serde() {
macro_rules! state_tokens {
($len:expr, $($state:expr => $city:expr),*) => (&[
Token::Map { len: Some($len) },
$(
Token::Enum { name: "KnownState" },
Token::Str(stringify!($state)),
Token::Unit,
Token::BorrowedStr($city),
)*
Token::MapEnd
]);
}
const EXPECTED_TOKENS: &[Token] = state_tokens!(3,
Arizona => "Phoenix",
California => "Los Angeles",
NewYork => "New York City"
);
assert_tokens(&important_cities(), EXPECTED_TOKENS);
} | rust_cleaned_test_functions.jsonl/38668 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 345
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
75861,
450,
368,
341,
262,
18072,
21407,
0,
1584,
28838,
341,
286,
1711,
2892,
96011,
11,
93977,
2454,
96011,
589,
400,
8926,
96011,
701,
3764,
589,
15899,
9640,
310,
9660,
486,
2227,
314,
2422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_slice_wrong_type() {
let mut runtime = Runtime::new().unwrap();
let handshake = connect("user=postgres");
let (mut client, connection) = runtime.block_on(handshake).unwrap();
let connection = connection.map_err(|e| panic!("{}", e));
runtime.spawn(connection);
let batch = client
.simple_query(
"CREATE TEMPORARY TABLE foo (
id SERIAL PRIMARY KEY
)",
)
.for_each(|_| Ok(()));
runtime.block_on(batch).unwrap();
let prepare = client.prepare("SELECT * FROM foo WHERE id = ANY($1)");
let stmt = runtime.block_on(prepare).unwrap();
let query = client.query(&stmt, &[&&[&"hi"][..]]).collect();
let err = runtime.block_on(query).err().unwrap();
match err.source() {
Some(e) if e.is::<WrongType>() => {}
_ => panic!("Unexpected error {:?}", err),
};
} | rust_cleaned_test_functions.jsonl/127923 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 388
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
26488,
75198,
1819,
368,
341,
262,
1077,
5206,
15592,
284,
10954,
486,
931,
1005,
15454,
1428,
262,
1077,
57020,
284,
4564,
445,
872,
28,
43070,
797,
262,
1077,
320,
6984,
2943,
11,
3633,
8,
284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 4 |
#[test]
fn test_show() {
let mut e = EnumSet::new();
assert_eq!("{}", e.to_string());
e.insert(A);
assert_eq!("{A}", e.to_string());
e.insert(C);
assert_eq!("{A, C}", e.to_string());
} | rust_cleaned_test_functions.jsonl/56665 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 138
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15267,
368,
341,
286,
1077,
5206,
384,
284,
14086,
1649,
486,
931,
543,
286,
2060,
10714,
79878,
384,
2389,
3904,
1423,
286,
384,
7030,
4346,
317,
286,
2060,
10714,
88928,
32,
9545,
384,
2389,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_usage() {
let mut opts = Options::new();
opts.reqopt("b", "banana", "Desc", "VAL");
opts.optopt("a", "012345678901234567890123456789", "Desc", "VAL");
opts.optflag("k", "kiwi", "Desc");
opts.optflagopt("p", "", "Desc", "VAL");
opts.optmulti("l", "", "Desc", "VAL");
opts.optflag("", "starfruit", "Starfruit");
let expected = "Usage: fruits
Options:
-b, --banana VAL Desc
-a, --012345678901234567890123456789 VAL
Desc
-k, --kiwi Desc
-p [VAL] Desc
-l VAL Desc
--starfruit Starfruit
";
let generated_usage = opts.usage("Usage: fruits");
debug!("expected: <<{}>>", expected);
debug!("generated: <<{}>>", generated_usage);
assert_eq!(generated_usage, expected);
} | rust_cleaned_test_functions.jsonl/52390 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 396
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31507,
368,
341,
262,
1077,
5206,
12185,
284,
14566,
486,
931,
543,
262,
12185,
48369,
2912,
445,
65,
497,
330,
87747,
497,
330,
11065,
497,
330,
5594,
797,
262,
12185,
28102,
2912,
445,
64,
497... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_volatile_is_unsupported() {
let ir = ir_from_cc("volatile int* foo();").unwrap();
let f = ir.unsupported_items().find(|i| i.message.contains("volatile")).unwrap();
assert_eq!("foo", f.name);
} | rust_cleaned_test_functions.jsonl/37229 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 96
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2273,
25517,
6892,
4907,
18216,
368,
341,
262,
1077,
6216,
284,
6216,
5673,
28955,
445,
27307,
526,
9,
15229,
2129,
1827,
15454,
543,
262,
1077,
282,
284,
6216,
6307,
18216,
12134,
1005,
3903,
224... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_get_2_isog() {
let dbl_p = dbl_k((a(), b()), paxy(), EA - 1);
let dbl_xp = xdbl_e(paxz(), a24plus(), c24(), EA - 1);
let (iso_a, iso_b) = curve_2_iso(dbl_p, (a(), b()));
let (a24plus, c24) = get_2_isog(dbl_xp);
let quarter = fp2inv(fp2from_literals(4, 0));
let c = fp2mul(quarter, c24);
let c2 = fp2add(c, c);
let a = fp2sub(a24plus, c2);
let jinv = j_inv((iso_a, iso_b));
let jinv_p = j_inv_p(a, c);
assert_eq!(jinv, jinv_p)
} | rust_cleaned_test_functions.jsonl/11572 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 274
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
62,
17,
6892,
538,
368,
341,
262,
1077,
88995,
620,
284,
88995,
4698,
1188,
64,
1507,
293,
11858,
281,
13773,
1507,
38362,
481,
220,
16,
626,
262,
1077,
88995,
3212,
79,
284,
856,
72602,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_hash_stored_account() {
// This test uses some UNSAFE trick to detect most of account's field
// addition and deletion without changing the hash code
const ACCOUNT_DATA_LEN: usize = 3;
// the type of InputTuple elements must not contain references;
// they should be simple scalars or data blobs
type InputTuple = (
Slot,
StoredMeta,
AccountMeta,
[u8; ACCOUNT_DATA_LEN],
usize, // for StoredAccountMeta::offset
Hash,
);
const INPUT_LEN: usize = std::mem::size_of::<InputTuple>();
type InputBlob = [u8; INPUT_LEN];
let mut blob: InputBlob = [0u8; INPUT_LEN];
for (i, byte) in blob.iter_mut().enumerate() {
*byte = (INPUT_LEN - i) as u8;
}
//UNSAFE: forcibly cast the special byte pattern to actual account fields.
let (slot, meta, account_meta, data, offset, hash): InputTuple =
unsafe { std::mem::transmute::<InputBlob, InputTuple>(blob) };
let stored_account = StoredAccountMeta {
meta: &meta,
account_meta: &account_meta,
data: &data,
offset,
stored_size: CACHE_VIRTUAL_STORED_SIZE,
hash: &hash,
};
let account = stored_account.clone_account();
let expected_account_hash = if cfg!(debug_assertions) {
Hash::from_str("4StuvYHFd7xuShVXB94uHHvpqGMCaacdZnYB74QQkPA1").unwrap()
} else {
Hash::from_str("33ruy7m3Xto7irYfsBSN74aAzQwCQxsfoZxXuZy2Rra3").unwrap()
};
assert_eq!(
AccountsDb::hash_stored_account(slot, &stored_account),
expected_account_hash,
"StoredAccountMeta's data layout might be changed; update hashing if needed."
);
assert_eq!(
AccountsDb::hash_account(slot, &account, &stored_account.meta.pubkey),
expected_account_hash,
"Account-based hashing must be consistent with StoredAccountMeta-based one."
);
} | rust_cleaned_test_functions.jsonl/1375 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1020
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8950,
1261,
3018,
13500,
368,
341,
286,
442,
1096,
1273,
5711,
1045,
45983,
29852,
14068,
311,
11140,
1429,
315,
2692,
594,
2070,
198,
286,
442,
5256,
323,
36066,
2041,
10018,
279,
5175,
2038,
271... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_shuffle() {
let mut r = task_rng();
let empty: &mut [int] = &mut [];
r.shuffle(empty);
let mut one = [1];
r.shuffle(one);
assert_eq!(one.as_slice(), &[1]);
let mut two = [1, 2];
r.shuffle(two);
assert!(two == [1, 2] || two == [2, 1]);
let mut x = [1, 1, 1];
r.shuffle(x);
assert_eq!(x.as_slice(), &[1, 1, 1]);
} | rust_cleaned_test_functions.jsonl/46781 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 247
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
73484,
368,
341,
286,
1077,
5206,
435,
284,
3383,
66849,
543,
286,
1077,
4287,
25,
609,
6984,
508,
396,
60,
284,
609,
6984,
5907,
286,
435,
45048,
24216,
317,
286,
1077,
5206,
825,
284,
508,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_mul_doubling_128() {
let a = 1234567890123456789u128;
let m = 1u128 << 100;
assert_eq!(
mul_doubling(a, a, m),
a * a % m,
);
} | rust_cleaned_test_functions.jsonl/38816 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 168
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24944,
814,
283,
9695,
62,
16,
17,
23,
368,
972,
310,
1077,
264,
284,
220,
16,
17,
18,
19,
20,
21,
22,
23,
24,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
84,
16,
17,
23,
463,
310,
1077,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_primitive_json_equal() {
// Test equaled array
let arrow_array = Int32Array::from(vec![Some(1), None, Some(2), Some(3)]);
let json_array: Value = serde_json::from_str(
r#"
[
1, null, 2, 3
]
"#,
)
.unwrap();
assert!(arrow_array.eq(&json_array));
assert!(json_array.eq(&arrow_array));
// Test unequaled array
let arrow_array = Int32Array::from(vec![Some(1), None, Some(2), Some(3)]);
let json_array: Value = serde_json::from_str(
r#"
[
1, 1, 2, 3
]
"#,
)
.unwrap();
assert!(arrow_array.ne(&json_array));
assert!(json_array.ne(&arrow_array));
// Test unequal length case
let arrow_array = Int32Array::from(vec![Some(1), None, Some(2), Some(3)]);
let json_array: Value = serde_json::from_str(
r#"
[
1, 1
]
"#,
)
.unwrap();
assert!(arrow_array.ne(&json_array));
assert!(json_array.ne(&arrow_array));
// Test not json array type case
let arrow_array = Int32Array::from(vec![Some(1), None, Some(2), Some(3)]);
let json_array: Value = serde_json::from_str(
r#"
{
"a": 1
}
"#,
)
.unwrap();
assert!(arrow_array.ne(&json_array));
assert!(json_array.ne(&arrow_array));
} | rust_cleaned_test_functions.jsonl/894 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 865
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
84087,
9455,
11478,
368,
341,
286,
442,
3393,
3232,
5838,
1334,
198,
286,
1077,
17921,
3858,
284,
1333,
18,
17,
1857,
486,
1499,
25592,
20703,
8373,
7,
16,
701,
2240,
11,
4329,
7,
17,
701,
432... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_transpose() {
let blocks = [
[0; BLOCKBYTES],
[1; BLOCKBYTES],
[2; BLOCKBYTES],
[3; BLOCKBYTES],
[4; BLOCKBYTES],
[5; BLOCKBYTES],
[6; BLOCKBYTES],
[7; BLOCKBYTES],
];
let transposed = transpose8(blocks);
let back = transpose8_back(transposed);
for i in 0..blocks.len() {
println!("block {}", i);
assert_eq!(&blocks[i][..], &back[i][..]);
}
} | rust_cleaned_test_functions.jsonl/49286 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 327
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7965,
2900,
368,
341,
286,
1077,
10010,
284,
2278,
310,
508,
15,
26,
28677,
97849,
1259,
310,
508,
16,
26,
28677,
97849,
1259,
310,
508,
17,
26,
28677,
97849,
1259,
310,
508,
18,
26,
28677,
97... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_start_end_attr() {
let mut r = Reader::from_str("<a b=\"test\"></a>");
r.trim_text(true);
next_eq!(r, Start, b"a", End, b"a");
} | rust_cleaned_test_functions.jsonl/42065 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 83
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4906,
6213,
10422,
368,
341,
262,
1077,
5206,
435,
284,
25166,
486,
1499,
2895,
9639,
64,
293,
4070,
1944,
40497,
64,
15084,
262,
435,
16419,
4326,
3715,
317,
262,
1790,
10714,
10297,
81,
11,
51... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_tree() {
let root = TreeNode::root();
let a = Arc::clone(&root).add_child("a");
let one = Arc::clone(&a).add_child("1");
let two = Arc::clone(&a).add_child("2");
let b = Arc::clone(&root).add_child("b");
assert_eq!(Vec::from(&*two.read().unwrap()), vec!["a", "2"]);
assert_eq!(Vec::from(&*one.read().unwrap()), vec!["a", "1"]);
assert_eq!(Vec::from(&*b.read().unwrap()), vec!["b"]);
// This should cause panic as root node has no value
Vec::<&str>::from(&*TreeNode::root().read().unwrap());
} | rust_cleaned_test_functions.jsonl/54757 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 239
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11663,
368,
341,
262,
1077,
3704,
284,
17111,
486,
2888,
543,
262,
1077,
264,
284,
19689,
486,
19982,
2099,
2888,
568,
718,
17268,
445,
64,
797,
262,
1077,
825,
284,
19689,
486,
19982,
2099,
64,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_public_encrypt_private_decrypt_with_padding() {
let key = include_bytes!("../test/rsa.pem.pub");
let public_key = Rsa::public_key_from_pem(key).unwrap();
let mut result = vec![0; public_key.size()];
let original_data = b"This is test";
let len = public_key.public_encrypt(original_data, &mut result, PKCS1_PADDING).unwrap();
assert_eq!(len, 256);
let pkey = include_bytes!("../test/rsa.pem");
let private_key = Rsa::private_key_from_pem(pkey).unwrap();
let mut dec_result = vec![0; private_key.size()];
let len = private_key.private_decrypt(&result, &mut dec_result, PKCS1_PADDING).unwrap();
assert_eq!(&dec_result[..len], original_data);
} | rust_cleaned_test_functions.jsonl/6927 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 336
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27074,
66593,
26249,
80764,
6615,
40726,
368,
341,
286,
1077,
1376,
284,
2924,
12524,
17223,
1244,
1944,
14,
60869,
49373,
47773,
797,
286,
1077,
584,
3097,
284,
431,
9081,
486,
888,
3097,
5673,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_create_context_from_type() {
let platform_ids = get_platform_ids().unwrap();
// Choose the first platform
// let platform_id = platform_ids[0];
let platform_id = PlatformPtr::from_ptr(platform_ids[0], "test_fn").unwrap();
let properties = ContextProperties.gen(Some(&platform_id), None);
let default_device = DeviceType::new(DeviceType::DEFAULT).unwrap();
let context =
create_context_from_type(&properties, default_device, None, WrapMutPtr::null());
let context = context.unwrap();
eprintln!("CL_CONTEXT_PTR: {:?}", context);
assert_ne!(context.unwrap(), ptr::null_mut());
release_context(context).unwrap();
} | rust_cleaned_test_functions.jsonl/101960 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 306
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8657,
8467,
5673,
1819,
368,
341,
286,
1077,
5339,
8077,
284,
633,
34260,
8077,
1005,
15454,
543,
286,
442,
22201,
279,
1156,
5339,
198,
286,
442,
1077,
5339,
842,
284,
5339,
8077,
58,
15,
935,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_casting_on_in_array___returns_expected_result() {
#[derive(Arraygen)]
#[gen_array(fn bytes: u8)]
struct Sut {
#[in_array(bytes { cast })]
pub a: i32,
}
let actual = Sut { a: -1 };
assert_eq!(actual.bytes()[0], 255);
} | rust_cleaned_test_functions.jsonl/76353 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 172
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5303,
287,
4470,
1243,
3858,
5973,
4216,
32190,
5287,
368,
341,
286,
11506,
27098,
38192,
4370,
5563,
286,
11506,
4370,
3858,
24008,
5820,
25,
575,
23,
5563,
286,
2036,
328,
332,
341,
310,
11506,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_node_merge_crash_before_snapshot_then_catch_up_logs() {
let mut cluster = new_node_cluster(0, 3);
cluster.cfg.raft_store.merge_max_log_gap = 10;
cluster.cfg.raft_store.raft_log_gc_count_limit = 11;
cluster.cfg.raft_store.raft_log_gc_tick_interval = ReadableDuration::millis(50);
// Make merge check resume quickly.
cluster.cfg.raft_store.raft_base_tick_interval = ReadableDuration::millis(10);
cluster.cfg.raft_store.raft_election_timeout_ticks = 10;
// election timeout must be greater than lease
cluster.cfg.raft_store.raft_store_max_leader_lease = ReadableDuration::millis(90);
cluster.cfg.raft_store.merge_check_tick_interval = ReadableDuration::millis(100);
cluster.cfg.raft_store.peer_stale_state_check_interval = ReadableDuration::millis(500);
let pd_client = Arc::clone(&cluster.pd_client);
pd_client.disable_default_operator();
let on_raft_gc_log_tick_fp = "on_raft_gc_log_tick";
fail::cfg(on_raft_gc_log_tick_fp, "return()").unwrap();
cluster.run();
let mut region = pd_client.get_region(b"k1").unwrap();
cluster.must_split(®ion, b"k2");
let left = pd_client.get_region(b"k1").unwrap();
let right = pd_client.get_region(b"k2").unwrap();
let left_on_store1 = find_peer(&left, 1).unwrap().to_owned();
cluster.must_transfer_leader(left.get_id(), left_on_store1);
let right_on_store1 = find_peer(&right, 1).unwrap().to_owned();
cluster.must_transfer_leader(right.get_id(), right_on_store1);
cluster.must_put(b"k1", b"v1");
cluster.add_send_filter(IsolationFilterFactory::new(3));
pd_client.must_merge(left.get_id(), right.get_id());
region = pd_client.get_region(b"k1").unwrap();
// Write some logs and the logs' number is greater than `raft_log_gc_count_limit`
// for latter log compaction
for i in 2..15 {
cluster.must_put(format!("k{}", i).as_bytes(), b"v");
}
// Aim at making peer 2 only know the compact log but do not know it is committed
let condition = Arc::new(AtomicBool::new(false));
let recv_filter = Box::new(
RegionPacketFilter::new(region.get_id(), 2)
.direction(Direction::Recv)
.when(condition.clone())
.set_msg_callback(Arc::new(move |msg: &RaftMessage| {
if !condition.load(Ordering::Acquire)
&& msg.get_message().get_msg_type() == MessageType::MsgAppend
&& !msg.get_message().get_entries().is_empty()
{
condition.store(true, Ordering::Release);
}
})),
);
cluster.sim.wl().add_recv_filter(2, recv_filter);
let state1 = cluster.truncated_state(region.get_id(), 1);
// Remove log compaction failpoint
fail::remove(on_raft_gc_log_tick_fp);
// Wait to trigger compact raft log
cluster.wait_log_truncated(region.get_id(), 1, state1.get_index() + 1);
let peer_on_store3 = find_peer(®ion, 3).unwrap().to_owned();
assert_eq!(peer_on_store3.get_id(), 3);
// Make peer 3 do not handle snapshot ready
// So making its source peer be destroyed and do not apply snapshot to reproduce the problem
let before_handle_snapshot_ready_3_fp = "before_handle_snapshot_ready_3";
fail::cfg(before_handle_snapshot_ready_3_fp, "return()").unwrap();
cluster.clear_send_filters();
// Peer 1 will send snapshot to peer 3
// Source peer sends msg to others to get target region info until the election timeout.
// The max election timeout is 2 * 10 * 10 = 200ms
let election_timeout = 2
* cluster.cfg.raft_store.raft_base_tick_interval.as_millis()
* cluster.cfg.raft_store.raft_election_timeout_ticks as u64;
sleep_ms(election_timeout + 100);
cluster.stop_node(1);
cluster.stop_node(3);
cluster.sim.wl().clear_recv_filters(2);
fail::remove(before_handle_snapshot_ready_3_fp);
cluster.run_node(3).unwrap();
// Peer 2 will become leader and it don't know the compact log is committed.
// So it will send logs not snapshot to peer 3
for i in 20..30 {
cluster.must_put(format!("k{}", i).as_bytes(), b"v");
}
must_get_equal(&cluster.get_engine(3), b"k29", b"v");
} | rust_cleaned_test_functions.jsonl/56290 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1724
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5084,
20888,
32331,
988,
23708,
53265,
68367,
666,
754,
8237,
42899,
368,
341,
262,
1077,
5206,
10652,
284,
501,
5084,
28441,
7,
15,
11,
220,
18,
317,
262,
10652,
30481,
13,
2944,
14809,
25002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 6 |
#[test]
fn test_primitives() {
let a = 192830918u64;
let mut serialized = vec![0u8; a.serialized_size()];
let mut cursor = Cursor::new(&mut serialized[..]);
a.serialize(&mut cursor).unwrap();
let mut cursor = Cursor::new(&serialized[..]);
let b = u64::deserialize(&mut cursor).unwrap();
assert_eq!(a, b);
} | rust_cleaned_test_functions.jsonl/134769 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 173
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5294,
35209,
368,
341,
286,
1077,
264,
284,
220,
16,
24,
17,
23,
18,
15,
24,
16,
23,
84,
21,
19,
280,
286,
1077,
5206,
32916,
284,
7486,
20703,
15,
84,
23,
26,
264,
29818,
1506,
2368,
3380... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_multiple_levels_create_data_directory() {
let temp_dir = tempdir().unwrap();
let dir = &PathBuf::from(
temp_dir.path().to_path_buf().display().to_string() +
"/" +
&(0..12)
.collect::<Vec<usize>>()
.iter()
.map(|_| string(2))
.collect::<Vec<std::string::String>>()
.join("/") +
"/",
);
assert_eq!(std::path::Path::new(&dir.display().to_string()).exists(), false);
dir_utils::create_data_directory(Some(&dir)).unwrap();
assert_eq!(std::path::Path::new(&dir.display().to_string()).exists(), true);
} | rust_cleaned_test_functions.jsonl/65693 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 405
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45233,
37819,
8657,
1769,
14846,
368,
341,
286,
1077,
2730,
4334,
284,
2730,
3741,
1005,
15454,
543,
286,
1077,
5419,
284,
609,
1820,
15064,
486,
1499,
1006,
310,
2730,
4334,
3875,
1005,
983,
2638... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_dh_generate_params_generate_key_compute_key() {
let dh_params1 = Dh::generate_params(512, 2).unwrap();
let dh_params2 = Dh::from_pqg(
dh_params1.prime_p().to_owned().unwrap(),
None,
dh_params1.generator().to_owned().unwrap(),
)
.unwrap();
let dh1 = dh_params1.generate_key().unwrap();
let dh2 = dh_params2.generate_key().unwrap();
let shared_a = dh1.compute_key(dh2.public_key()).unwrap();
let shared_b = dh2.compute_key(dh1.public_key()).unwrap();
assert_eq!(shared_a, shared_b);
} | rust_cleaned_test_functions.jsonl/54788 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 312
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
814,
71,
48851,
6745,
48851,
3097,
57028,
3097,
368,
341,
286,
1077,
34096,
6745,
16,
284,
43227,
486,
19366,
6745,
7,
20,
16,
17,
11,
220,
17,
568,
15454,
543,
286,
1077,
34096,
6745,
17,
284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_set_and_registers() {
assert_eq!(
parse(
"
Set RX1 4
SET RX1 RLI
SET RX1 RS0
SET RX1 RZR
"
)
.unwrap()
.body,
vec![
Node(
Statement::Operator(Node(
Operator::Set(
Node(RegisterRef::User(1), span(2, 21, 2, 24)),
Node(
ValueSource::Const(Node(4, span(2, 25, 2, 26))),
span(2, 25, 2, 26)
)
),
span(2, 17, 2, 26)
),),
span(2, 17, 2, 26)
),
Node(
Statement::Operator(Node(
Operator::Set(
Node(RegisterRef::User(1), span(3, 21, 3, 24)),
Node(
ValueSource::Register(Node(
RegisterRef::InputLength,
span(3, 25, 3, 28)
),),
span(3, 25, 3, 28)
)
),
span(3, 17, 3, 28)
),),
span(3, 17, 3, 28)
),
Node(
Statement::Operator(Node(
Operator::Set(
Node(RegisterRef::User(1), span(4, 21, 4, 24)),
Node(
ValueSource::Register(Node(
RegisterRef::StackLength(0),
span(4, 25, 4, 28)
),),
span(4, 25, 4, 28)
)
),
span(4, 17, 4, 28)
),),
span(4, 17, 4, 28)
),
Node(
Statement::Operator(Node(
Operator::Set(
Node(RegisterRef::User(1), span(5, 21, 5, 24)),
Node(
ValueSource::Register(Node(
RegisterRef::Null,
span(5, 25, 5, 28)
),),
span(5, 25, 5, 28)
)
),
span(5, 17, 5, 28)
),),
span(5, 17, 5, 28)
),
]
);
} | rust_cleaned_test_functions.jsonl/118214 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2185
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
8378,
78360,
368,
341,
286,
2060,
10714,
33673,
310,
4715,
1006,
394,
6228,
394,
2573,
28170,
16,
220,
19,
198,
394,
9019,
28170,
16,
431,
18537,
198,
394,
9019,
28170,
16,
23229,
15,
198,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_header_with_inodes() {
let options = Options {
columns: COLUMNS_WITH_INODES.to_vec(),
..Default::default()
};
assert_eq!(
Header::get_headers(&options),
vec!(
"Filesystem",
"Inodes",
"IUsed",
"IFree",
"IUse%",
"Mounted on"
)
);
} | rust_cleaned_test_functions.jsonl/110414 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 287
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8757,
6615,
1243,
2539,
368,
341,
286,
1077,
2606,
284,
14566,
341,
310,
8147,
25,
356,
48770,
23929,
2158,
2880,
50,
2389,
13251,
3148,
310,
5241,
3675,
486,
2258,
741,
286,
2605,
286,
2060,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_integral_image_matches_reference_implementation() {
fn prop(image: GrayTestImage) -> TestResult {
let expected = integral_image_ref(&image.0);
let actual = integral_image(&image.0);
match pixel_diff_summary(&actual, &expected) {
None => TestResult::passed(),
Some(err) => TestResult::error(err),
}
}
quickcheck(prop as fn(GrayTestImage) -> TestResult);
} | rust_cleaned_test_functions.jsonl/122526 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 224
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
64076,
4954,
38344,
25433,
62,
14369,
368,
341,
286,
5168,
2004,
10075,
25,
23366,
2271,
1906,
8,
1464,
3393,
2077,
341,
310,
1077,
3601,
284,
25098,
4954,
7793,
2099,
1805,
13,
15,
317,
310,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_utf8() {
let expected = "Iñtërnâtiônàlizætiøn";
unsafe {
let built = NSString::alloc(nil).init_str(expected);
let bytes = built.UTF8String() as *const u8;
let objc_string = str::from_utf8(slice::from_raw_parts(bytes, built.len()))
.unwrap();
assert_eq!(objc_string.len(), expected.len());
assert_eq!(objc_string, expected);
}
} | rust_cleaned_test_functions.jsonl/78763 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 278
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39453,
23,
368,
341,
310,
1077,
3601,
284,
330,
40,
5653,
83,
12179,
35622,
8835,
10251,
61452,
6362,
75,
449,
9191,
10251,
6151,
77,
876,
310,
19860,
341,
394,
1077,
5798,
284,
9335,
486,
4742,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_literal_int_overflow() {
err(
"fun f() { let x = 2147483648; }",
pos(1, 19),
Msg::NumberOverflow("int".into()),
);
ok("fun f() { let x = 2147483647; }");
err(
"fun f() { let x = -2147483649; }",
pos(1, 20),
Msg::NumberOverflow("int".into()),
);
ok("fun f() { let x = -2147483648; }");
} | rust_cleaned_test_functions.jsonl/106622 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 258
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34100,
4042,
79073,
368,
341,
286,
1848,
1006,
310,
330,
11894,
282,
368,
314,
1077,
856,
284,
220,
17,
16,
19,
22,
19,
23,
18,
21,
19,
23,
26,
335,
756,
310,
1133,
7,
16,
11,
220,
16,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_delete() {
let s = "a=1&b=2&c=3&c=4";
let mut q = UrlEncodedData::parse_str(s);
println!("got qs: {}", q);
assert_eq!(q.get_first("c").unwrap(), "3");
assert_eq!(q.get_last("c").unwrap(), "4");
q.delete("c");
println!("got qs: {}", q);
assert_eq!(q.get("c"), None);
assert_eq!(q.get_first("c"), None);
assert_eq!(q.get_last("c"), None);
assert_eq!(q.get_first("a").unwrap(), "1");
assert_eq!(q.get_first("b").unwrap(), "2");
assert_eq!(q.get_first("non-exist"), None);
} | rust_cleaned_test_functions.jsonl/70300 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 335
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11353,
368,
341,
286,
1077,
274,
284,
330,
64,
28,
16,
5,
65,
28,
17,
5,
66,
28,
18,
5,
66,
28,
19,
876,
286,
1077,
5206,
2804,
284,
22840,
46795,
1043,
486,
6400,
2895,
1141,
317,
286,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_named_file_set_content_type() {
let mut file = NamedFile::open("Cargo.toml")
.unwrap()
.set_content_type(mime::TEXT_XML);
{
file.file();
let _f: &File = &file;
}
{
let _f: &mut File = &mut file;
}
let req = TestRequest::default().to_http_request();
let resp = file.respond_to(&req).unwrap();
assert_eq!(
resp.headers().get(header::CONTENT_TYPE).unwrap(),
"text/xml"
);
assert_eq!(
resp.headers().get(header::CONTENT_DISPOSITION).unwrap(),
"inline; filename=\"Cargo.toml\""
);
} | rust_cleaned_test_functions.jsonl/35485 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 381
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
71834,
2458,
2602,
7495,
1819,
368,
341,
286,
1077,
5206,
1034,
284,
40459,
1703,
486,
2508,
445,
98228,
73494,
75,
1138,
310,
659,
15454,
741,
310,
659,
746,
7495,
1819,
1255,
545,
486,
12708,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_from_value_struct() -> Result<(), Box<dyn std::error::Error>> {
let lua = Lua::new();
#[derive(Deserialize, PartialEq, Debug)]
struct Test {
int: u32,
seq: Vec<String>,
map: HashMap<i32, i32>,
empty: Vec<()>,
tuple: (u8, u8, u8),
}
let value = lua
.load(
r#"
{
int = 1,
seq = {"a", "b"},
map = {2, [4] = 1},
empty = {},
tuple = {10, 20, 30},
}
"#,
)
.eval::<Value>()?;
let got = lua.from_value(value)?;
assert_eq!(
Test {
int: 1,
seq: vec!["a".into(), "b".into()],
map: vec![(1, 2), (4, 1)].into_iter().collect(),
empty: vec![],
tuple: (10, 20, 30),
},
got
);
Ok(())
} | rust_cleaned_test_functions.jsonl/50708 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 554
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5673,
3142,
15126,
368,
1464,
5714,
68843,
8261,
92846,
1460,
486,
841,
486,
1454,
2452,
341,
262,
1077,
20357,
284,
37662,
486,
931,
1428,
262,
11506,
27098,
7,
64465,
11,
55039,
11,
11091,
5563,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_mutable_iterator_reverse_yields_only_nodes_from_the_same_list() {
let mut test = test_rev();
let list_indices: Vec<_> = test.set.list_indices().collect();
for list_index in list_indices.iter().copied() {
let expected = &test.expected[&list_index];
let result: Vec<usize> = test.set
.iter_mut(list_index)
.rev()
.map(|v| *v)
.collect();
assert_eq!(&result, expected);
}
} | rust_cleaned_test_functions.jsonl/56926 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 280
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
717,
5922,
13491,
43277,
4178,
6907,
18410,
14896,
5673,
16068,
33574,
2019,
368,
341,
286,
1077,
5206,
1273,
284,
1273,
38082,
543,
286,
1077,
1140,
18333,
25,
11312,
32399,
29,
284,
1273,
980,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_prover_handle_invalid_presentation_message() {
let _setup = SetupAriesMocks::init();
set_config_value(settings::MOCK_INDY_PROOF_VALIDATION, "false");
let mut verifier_sm = _verifier_sm();
verifier_sm = verifier_sm.step(VerifierMessages::SendPresentationRequest(mock_connection())).unwrap();
verifier_sm = verifier_sm.step(VerifierMessages::VerifyPresentation(_presentation())).unwrap();
assert_match!(VerifierState::Finished(_), verifier_sm.state);
assert_eq!(VcxStateType::VcxStateAccepted as u32, verifier_sm.state());
assert_eq!(Status::Failed(ProblemReport::create()).code(), verifier_sm.presentation_status());
} | rust_cleaned_test_functions.jsonl/57248 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 319
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2540,
423,
10630,
31433,
620,
13584,
6462,
368,
341,
310,
1077,
716,
15188,
284,
18626,
32,
4019,
72577,
486,
2327,
543,
310,
738,
5332,
3142,
23369,
486,
10531,
3021,
41003,
56,
5756,
12483,
2733... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_request_message_side_effects_3() {
let canister_id = canister_test_id(42);
let mut system_state = SystemStateBuilder::default()
.canister_id(canister_id)
.build();
system_state.freeze_threshold = NumSeconds::from(0);
inject_request(&mut system_state);
test_outgoing_messages(system_state, REJECT_WAT, |mut execute_message_result| {
assert_eq!(
execute_message_result
.canister
.system_state
.queues()
.output_queues_len(),
1
);
assert_eq!(
execute_message_result
.canister
.system_state
.queues()
.output_message_count(),
1
);
let dst = canister_test_id(55);
let (_, message) = execute_message_result
.canister
.system_state
.queues_mut()
.pop_canister_output(&dst)
.unwrap();
if let RequestOrResponse::Response(msg) = message {
assert_eq!(msg.originator, dst);
assert_eq!(msg.respondent, canister_id);
assert_eq!(
msg.response_payload,
Payload::Reject(RejectContext {
code: RejectCode::CanisterReject,
message: "MONOLORD".to_string()
})
);
} else {
panic!("unexpected message popped: {:?}", message);
}
});
} | rust_cleaned_test_functions.jsonl/17020 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 835
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7893,
6462,
30862,
83171,
62,
18,
368,
341,
262,
1077,
646,
1571,
842,
284,
646,
1571,
4452,
842,
7,
19,
17,
317,
262,
1077,
5206,
1849,
4387,
284,
739,
1397,
3297,
486,
2258,
741,
286,
659,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_auto() -> Ret {
#[derive(Debug, PartialEq, Eq)]
struct TestAuto {
string: String,
bytes: Box<[u8]>,
}
struct TestAutoVisitor;
impl<'de> Visitor<'de> for TestAutoVisitor {
type Value = TestAuto;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
todo!()
}
fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
where
A: de::MapAccess<'de>,
{
let mut string = None;
let mut bytes: Option<&[u8]> = None;
match map.next_key()?.unwrap() {
"string" => string = Some(map.next_value()?),
"bytes" => bytes = Some(map.next_value()?),
_ => panic!(),
};
match map.next_key()?.unwrap() {
"string" => string = Some(map.next_value()?),
"bytes" => bytes = Some(map.next_value()?),
_ => panic!(),
};
assert!(map.next_key::<()>()?.is_none());
Ok(TestAuto {
bytes: bytes.unwrap().to_vec().into_boxed_slice(),
string: string.unwrap(),
})
}
}
impl<'de> de::Deserialize<'de> for TestAuto {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(TestAutoVisitor)
}
};
let input = b"d6:string4:12345:bytes4:\x01\x02\x03\xFFe";
let de = from_bytes_auto::<TestAuto>(input)?;
assert_eq!(
de,
TestAuto {
string: String::from("1234"),
bytes: vec![1, 2, 3, 0xFF].into_boxed_slice(),
}
);
Ok(())
} | rust_cleaned_test_functions.jsonl/55345 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1191
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27740,
368,
1464,
10392,
341,
286,
11506,
27098,
42618,
11,
55039,
11,
33122,
5563,
286,
2036,
3393,
13253,
341,
310,
914,
25,
923,
345,
310,
5820,
25,
8261,
66746,
84,
23,
60,
12520,
286,
555,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_col_from_str() {
use std::str::FromStr;
assert!(matches!(
fruit::Column::from_str("id"),
Ok(fruit::Column::Id)
));
assert!(matches!(
fruit::Column::from_str("name"),
Ok(fruit::Column::Name)
));
assert!(matches!(
fruit::Column::from_str("cake_id"),
Ok(fruit::Column::CakeId)
));
assert!(matches!(
fruit::Column::from_str("cakeId"),
Ok(fruit::Column::CakeId)
));
assert!(matches!(
fruit::Column::from_str("does_not_exist"),
Err(crate::ColumnFromStrErr(_))
));
} | rust_cleaned_test_functions.jsonl/50440 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 387
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10211,
5673,
2895,
368,
341,
286,
990,
1460,
486,
495,
486,
3830,
2580,
401,
286,
2060,
10297,
19914,
33673,
310,
13779,
486,
2933,
486,
1499,
2895,
445,
307,
4461,
310,
7622,
955,
21026,
486,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_bounded_uncommitted_entries_growth_with_partition() {
let l = default_logger();
let config = &Config {
id: 1,
max_uncommitted_size: 12,
..Config::default()
};
let s = new_storage();
let mut raw_node = new_raw_node_with_config(vec![1], config, s.clone(), &l);
// wait raw_node to be leader
raw_node.campaign().unwrap();
loop {
let rd = raw_node.ready();
s.wl().set_hardstate(rd.hs().unwrap().clone());
s.wl().append(rd.entries()).unwrap();
if rd
.ss()
.map_or(false, |ss| ss.leader_id == raw_node.raft.leader_id)
{
let _ = raw_node.advance(rd);
break;
}
let _ = raw_node.advance(rd);
}
// should be accepted
let data = b"hello world!";
let result = raw_node.propose(vec![], data.to_vec());
assert!(result.is_ok());
// shoule be dropped
let result = raw_node.propose(vec![], data.to_vec());
assert!(!result.is_ok());
assert_eq!(result.unwrap_err(), Error::ProposalDropped);
// should be accepted when previous data has been committed
let rd = raw_node.ready();
s.wl().append(rd.entries()).unwrap();
let _ = raw_node.advance(rd);
let data = b"hello world!".to_vec();
let result = raw_node.propose(vec![], data);
assert!(result.is_ok());
} | rust_cleaned_test_functions.jsonl/53371 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 633
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
13082,
4907,
97446,
26092,
49182,
6615,
43840,
368,
341,
262,
1077,
326,
284,
1638,
27413,
543,
262,
1077,
2193,
284,
609,
2648,
341,
286,
877,
25,
220,
16,
345,
286,
1932,
4907,
97446,
236... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_parse_number_literal() {
assert_eq!(parse_number_literal("10"), Some(10));
assert_eq!(parse_number_literal("0x10"), Some(0x10));
assert_eq!(parse_number_literal("-0x10"), Some(-0x10));
assert_eq!(parse_number_literal("0b11"), Some(3));
assert_eq!(parse_number_literal("0"), Some(0));
assert_eq!(parse_number_literal(""), None);
assert_eq!(parse_number_literal("0xbeef"), Some(0xbeef));
assert_eq!(parse_number_literal("0xbeef"), Some(0xbeef));
assert_eq!(parse_number_literal("010"), Some(8));
assert_eq!(parse_number_literal("abcdef"), None);
assert_eq!(parse_number_literal("-0xbeef"), Some(-0xbeef));
assert_eq!(parse_number_literal("0x1ull"), Some(1));
assert_eq!(parse_number_literal("0x100ULL"), Some(0x100));
assert_eq!(parse_number_literal("0x100z"), Some(0x100));
assert_eq!(parse_number_literal("100'000"), Some(100000));
assert_eq!(parse_number_literal("0.0"), None);
assert_eq!(parse_number_literal("not-a-literal"), None);
assert_eq!(parse_number_literal("-"), None);
} | rust_cleaned_test_functions.jsonl/1620 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 463
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
5500,
34100,
368,
341,
262,
2060,
10714,
10297,
6400,
5500,
34100,
445,
16,
15,
3975,
4329,
7,
16,
15,
1106,
262,
2060,
10714,
10297,
6400,
5500,
34100,
445,
15,
87,
16,
15,
3975,
4329,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sha256() {
let tmp_dir = TempDir::new().unwrap();
let large_file = tmp_dir.path().join("large.txt");
gen_rand_file(&large_file, DIGEST_BUFFER_SIZE * 4);
let large_file_bytes = fs::read(&large_file).unwrap();
let direct_sha256 = sha256(&large_file_bytes).unwrap();
let large_file_reader = fs::File::open(&large_file).unwrap();
let (mut sha256_reader, sha256_hasher) = Sha256Reader::new(large_file_reader).unwrap();
let ret = sha256_reader.read_to_end(&mut Vec::new());
assert_eq!(ret.unwrap(), DIGEST_BUFFER_SIZE * 4);
assert_eq!(
sha256_hasher.lock().unwrap().finish().unwrap().to_vec(),
direct_sha256
);
} | rust_cleaned_test_functions.jsonl/23429 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 348
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
48836,
17,
20,
21,
368,
341,
286,
1077,
4174,
4334,
284,
19944,
6184,
486,
931,
1005,
15454,
543,
286,
1077,
3460,
2458,
284,
4174,
4334,
3875,
1005,
5987,
445,
16767,
3909,
797,
286,
4081,
3386... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_background() {
let mut cursor = Cursor::new();
let style = Some(Arc::new(Style::new(COLORS)));
assert_eq!(
cursor.background(&DEFAULT_COLORS),
DEFAULT_COLORS.foreground.clone().unwrap()
);
cursor.style = style.clone();
assert_eq!(
cursor.background(&DEFAULT_COLORS),
COLORS.background.clone().unwrap()
);
cursor.style = Some(Arc::new(Style::new(NONE_COLORS)));
assert_eq!(
cursor.background(&DEFAULT_COLORS),
DEFAULT_COLORS.foreground.clone().unwrap()
);
} | rust_cleaned_test_functions.jsonl/94972 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 315
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24103,
368,
341,
286,
1077,
5206,
8128,
284,
28067,
486,
931,
543,
286,
1077,
1707,
284,
4329,
4346,
1287,
486,
931,
7,
2323,
486,
931,
87411,
50,
22525,
286,
2060,
10714,
33673,
310,
8128,
1171... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_from_angle() {
let matrix: Matrix2x2<f64> = Matrix2x2::from_angle(Radians::full_turn_div_4());
let unit_x = Vector2::unit_x();
let unit_y = Vector2::unit_y();
let expected = unit_y;
let result = matrix * unit_x;
assert!(relative_eq!(result, expected, epsilon = 1e-8));
let expected = -unit_x;
let result = matrix * unit_y;
assert!(relative_eq!(result, expected, epsilon = 1e-8));
} | rust_cleaned_test_functions.jsonl/128998 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 227
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5673,
21727,
368,
341,
286,
1077,
6172,
25,
11631,
17,
87,
17,
63895,
21,
19,
29,
284,
11631,
17,
87,
17,
486,
1499,
21727,
2785,
20736,
486,
8878,
37274,
16237,
62,
19,
1423,
286,
1077,
4982,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_vec3mask_all() {
assert_eq!(Vec3Mask::new(true, true, true).all(), true);
assert_eq!(Vec3Mask::new(false, true, true).all(), false);
assert_eq!(Vec3Mask::new(true, false, true).all(), false);
assert_eq!(Vec3Mask::new(true, true, false).all(), false);
} | rust_cleaned_test_functions.jsonl/48596 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 127
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13251,
18,
11258,
5705,
368,
341,
262,
2060,
10714,
10297,
10050,
18,
12686,
486,
931,
3715,
11,
830,
11,
830,
568,
541,
1507,
830,
317,
262,
2060,
10714,
10297,
10050,
18,
12686,
486,
931,
3576... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_custom_type_attributes() {
// We abuse the ident conversion protobuf for the custom attribute additions. We placed
let mut set1 = BTreeSet::new();
let msg1 = foo::bar_baz::FooBarBaz::default();
set1.insert(msg1);
let mut set2 = BTreeSet::new();
let msg2 = oneof_attributes::Msg::default();
set2.insert(msg2.field);
} | rust_cleaned_test_functions.jsonl/8850 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 191
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15875,
1819,
18240,
368,
341,
286,
442,
1205,
11480,
279,
3524,
14409,
69634,
369,
279,
2526,
7035,
37214,
13,
1205,
9099,
8945,
286,
1077,
5206,
738,
16,
284,
425,
6533,
1649,
486,
931,
543,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.