text
stringlengths 93
16.4k
| id
stringlengths 35
40
| metadata
dict | input_ids
sequencelengths 45
2.05k
| attention_mask
sequencelengths 45
2.05k
| complexity
int64 1
9
|
---|---|---|---|---|---|
#[test]
fn test_list_dir() {
let mut target_path = PathBuf::new();
target_path.push("./");
let filesystem = Filesystem::default();
let expected: Vec<Option<PathBuf>> = target_path
.as_path()
.read_dir()
.unwrap()
.map(|content| match content {
Ok(content) => Some(content.path()),
Err(_) => None,
})
.collect();
assert_eq!(expected, filesystem.list_dir(&target_path).unwrap())
} | rust_cleaned_test_functions.jsonl/6602 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 222
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2019,
4334,
368,
341,
262,
1077,
5206,
2169,
2638,
284,
7933,
15064,
486,
931,
543,
262,
2169,
2638,
2552,
13988,
797,
262,
1077,
38389,
284,
2887,
8948,
486,
2258,
1428,
262,
1077,
3601,
25,
11312,
94150,
82883,
15064,
2452,
284,
2169,
2638,
198,
286,
659,
300,
2638,
741,
286,
659,
878,
4334,
741,
286,
659,
15454,
741,
286,
659,
2186,
22428,
1796,
91,
2432,
2213,
341,
310,
7622,
15063,
8,
589,
4329,
15063,
3875,
14702,
310,
15495,
48139,
589,
2240,
345,
286,
2751,
286,
659,
17384,
543,
262,
2060,
10714,
10297,
7325,
11,
38389,
6420,
4334,
2099,
5657,
2638,
568,
15454,
2398,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_cycle_empty() {
let mut vector_in:Vec<i32> = vec![];
cycle_sort(&mut vector_in);
debug_assert_eq!(vector_in, &[]);
} | rust_cleaned_test_functions.jsonl/84299 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 88
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39079,
15124,
368,
341,
286,
1077,
5206,
4621,
1243,
25,
10050,
21897,
18,
17,
29,
284,
7486,
0,
15078,
286,
10775,
18435,
2099,
6984,
4621,
1243,
317,
286,
7390,
16553,
10714,
10297,
3215,
1243,
11,
609,
56703,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_parse_net_ip_socket_queues() {
let line = " 73: 0100007F:0143 00000000:0000 07 00000010:00000005 00:00000000 00000000 0 0 36799 2 0000000000000000 0 ";
let (tx, rx) = parse_net_ip_socket_queues(line).unwrap();
assert_eq!(tx, 16);
assert_eq!(rx, 5);
} | rust_cleaned_test_functions.jsonl/102907 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 153
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
19722,
10385,
19555,
82413,
368,
341,
286,
1077,
1555,
284,
330,
256,
220,
22,
18,
25,
220,
15,
16,
15,
15,
15,
15,
22,
37,
25,
15,
16,
19,
18,
220,
15,
15,
15,
15,
15,
15,
15,
15,
25,
15,
15,
15,
15,
220,
15,
22,
220,
15,
15,
15,
15,
15,
15,
16,
15,
25,
15,
15,
15,
15,
15,
15,
15,
20,
220,
15,
15,
25,
15,
15,
15,
15,
15,
15,
15,
15,
220,
15,
15,
15,
15,
15,
15,
15,
15,
257,
220,
15,
286,
220,
15,
220,
18,
21,
22,
24,
24,
220,
17,
220,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
220,
15,
7620,
286,
1077,
320,
3998,
11,
19111,
8,
284,
4715,
19722,
10385,
19555,
82413,
8797,
568,
15454,
1428,
286,
2060,
10714,
10297,
3998,
11,
220,
16,
21,
317,
286,
2060,
10714,
10297,
12651,
11,
220,
20,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_temp_enum_field() {
#[deku_derive(DekuRead, DekuWrite)]
#[derive(PartialEq, Debug)]
#[deku(type = "u8")]
enum TestEnum {
#[deku(id = "0xAB")]
VarA {
#[deku(temp)]
field_a: u8,
#[deku(count = "field_a")]
field_b: Vec<u8>,
},
}
let test_data: Vec<u8> = [0xAB, 0x01, 0x02].to_vec();
let ret_read = TestEnum::try_from(test_data.as_ref()).unwrap();
assert_eq!(
TestEnum::VarA {
field_b: vec![0x02]
},
ret_read
);
let ret_write: Vec<u8> = ret_read.try_into().unwrap();
assert_eq!(vec![0xAB, 0x02], ret_write);
} | rust_cleaned_test_functions.jsonl/97095 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 403
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11771,
31054,
5013,
368,
341,
262,
11506,
450,
12133,
35345,
533,
5432,
1225,
84,
4418,
11,
74463,
84,
7985,
5563,
262,
11506,
27098,
5304,
20894,
27312,
11,
11091,
5563,
262,
11506,
450,
12133,
5808,
284,
330,
84,
23,
5422,
262,
7618,
3393,
10766,
341,
286,
11506,
450,
12133,
3724,
284,
330,
15,
78146,
5422,
286,
8735,
32,
341,
310,
11506,
450,
12133,
9758,
5563,
310,
2070,
4306,
25,
575,
23,
345,
310,
11506,
450,
12133,
11512,
284,
330,
2566,
4306,
5422,
310,
2070,
880,
25,
11312,
34837,
23,
12520,
286,
1153,
262,
555,
262,
1077,
1273,
1769,
25,
11312,
34837,
23,
29,
284,
508,
15,
78146,
11,
220,
15,
87,
15,
16,
11,
220,
15,
87,
15,
17,
936,
983,
13251,
1428,
262,
1077,
2112,
6443,
284,
3393,
10766,
486,
1539,
5673,
8623,
1769,
5357,
7793,
6011,
15454,
543,
262,
2060,
10714,
33673,
286,
3393,
10766,
486,
3962,
32,
341,
310,
2070,
880,
25,
7486,
20703,
15,
87,
15,
17,
921,
286,
1153,
286,
2112,
6443,
198,
262,
3475,
262,
1077,
2112,
9165,
25,
11312,
34837,
23,
29,
284,
2112,
6443,
48779,
45514,
1005,
15454,
543,
262,
2060,
10714,
10297,
4083,
20703,
15,
78146,
11,
220,
15,
87,
15,
17,
1125,
2112,
9165,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_char_indicesator() {
let s = "ศไทย中华Việt Nam";
let p = [0, 3, 6, 9, 12, 15, 18, 19, 20, 23, 24, 25, 26, 27];
let v = ['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m'];
let mut pos = 0;
let it = s.char_indices();
for c in it {
assert_eq!(c, (p[pos], v[pos]));
pos += 1;
}
assert_eq!(pos, v.len());
assert_eq!(pos, p.len());
} | rust_cleaned_test_functions.jsonl/11130 | {
"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,
9232,
18333,
850,
368,
341,
262,
1077,
274,
284,
330,
123863,
125451,
100849,
35544,
124382,
29974,
876,
262,
1077,
281,
284,
508,
15,
11,
220,
18,
11,
220,
21,
11,
220,
24,
11,
220,
16,
17,
11,
220,
16,
20,
11,
220,
16,
23,
11,
220,
16,
24,
11,
220,
17,
15,
11,
220,
17,
18,
11,
220,
17,
19,
11,
220,
17,
20,
11,
220,
17,
21,
11,
220,
17,
22,
935,
262,
1077,
348,
284,
2509,
123863,
1844,
49756,
1844,
35884,
1844,
34509,
1844,
15946,
1844,
85361,
1844,
53,
1844,
72,
1844,
25232,
1844,
83,
1844,
22262,
45,
1844,
64,
1844,
76,
15538,
262,
1077,
5206,
1133,
284,
220,
15,
280,
262,
1077,
432,
284,
274,
11154,
18333,
1428,
262,
369,
272,
304,
432,
341,
286,
2060,
10714,
10297,
66,
11,
320,
79,
21643,
1125,
348,
21643,
14382,
286,
1133,
1421,
220,
16,
280,
262,
456,
262,
2060,
10714,
10297,
966,
11,
348,
19406,
1423,
262,
2060,
10714,
10297,
966,
11,
281,
19406,
1423,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_get_matching_files() {
let dir = std::env::current_dir().unwrap();
let path = format!("{}/test", dir.as_path().to_str().unwrap());
let files = get_matching_files(path.as_ref()).unwrap();
let found = files
.iter()
.map(|pf| pf.original_filename())
.any(|n| "invalid (100) (19231).jpg" == n);
assert!(!found);
} | rust_cleaned_test_functions.jsonl/16985 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 209
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
70763,
10931,
368,
341,
286,
1077,
5419,
284,
1460,
486,
3160,
486,
3231,
4334,
1005,
15454,
543,
286,
1077,
1815,
284,
3561,
88928,
4472,
1944,
497,
5419,
5357,
2638,
1005,
983,
2895,
1005,
15454,
1423,
286,
1077,
3542,
284,
633,
70763,
10931,
5581,
5357,
7793,
6011,
15454,
543,
286,
1077,
1730,
284,
3542,
198,
310,
659,
2015,
741,
310,
659,
2186,
22428,
15897,
91,
27418,
34925,
13323,
2398,
310,
659,
3767,
22428,
77,
91,
330,
11808,
320,
16,
15,
15,
8,
320,
16,
24,
17,
18,
16,
568,
17974,
1,
621,
308,
317,
286,
2060,
0,
3471,
15105,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_eval_fail_2() {
#[rpn_fn(nullable)]
fn foo(v: Option<&Real>) -> Result<Option<Real>> {
Ok(v.map(|v| *v * 2.0))
}
let exp = RpnExpressionBuilder::new_for_test()
.push_constant_for_test(3.0f64)
.push_constant_for_test(1.5f64)
.push_fn_call_for_test(foo_fn_meta(), 1, FieldTypeTp::Double)
.build_for_test();
let mut ctx = EvalContext::default();
let mut columns = LazyBatchColumnVec::empty();
let hooked_eval = panic_hook::recover_safe(|| {
let _ = exp.eval(&mut ctx, &[], &mut columns, &[], 3);
});
assert!(hooked_eval.is_err());
} | rust_cleaned_test_functions.jsonl/92673 | {
"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,
21296,
22121,
62,
17,
368,
341,
394,
11506,
81,
19958,
15246,
34885,
5563,
286,
5168,
15229,
3747,
25,
6959,
52244,
12768,
9231,
1464,
5714,
94150,
64829,
2452,
341,
310,
7622,
3747,
4770,
22428,
85,
91,
353,
85,
353,
220,
17,
13,
15,
1171,
286,
555,
23459,
286,
1077,
1343,
284,
431,
19958,
9595,
3297,
486,
931,
5478,
4452,
741,
310,
659,
9077,
34967,
5478,
4452,
7,
18,
13,
15,
69,
21,
19,
340,
310,
659,
9077,
34967,
5478,
4452,
7,
16,
13,
20,
69,
21,
19,
340,
310,
659,
9077,
15246,
13429,
5478,
4452,
71880,
15246,
13381,
1507,
220,
16,
11,
84614,
62241,
486,
7378,
340,
310,
659,
5834,
5478,
4452,
543,
286,
1077,
5206,
5635,
284,
58239,
1972,
486,
2258,
543,
286,
1077,
5206,
8147,
284,
44263,
21074,
2933,
10050,
486,
3194,
543,
286,
1077,
42670,
21296,
284,
21975,
32005,
486,
74283,
34067,
79453,
341,
310,
1077,
716,
284,
1343,
31710,
2099,
6984,
5635,
11,
609,
12995,
609,
6984,
8147,
11,
609,
12995,
220,
18,
317,
286,
1625,
286,
2060,
10297,
20873,
291,
21296,
2079,
9266,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_bam_fails_on_vcf() {
let bam_path = "./test/test_left.vcf";
let bam_reader = Reader::from_path(bam_path);
assert!(bam_reader.is_err());
} | rust_cleaned_test_functions.jsonl/34040 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 101
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
309,
761,
6209,
4470,
2273,
9792,
368,
341,
286,
1077,
41304,
2638,
284,
5924,
1944,
12697,
9579,
3133,
9792,
876,
286,
1077,
41304,
22306,
284,
25166,
486,
1499,
2638,
1883,
309,
2638,
317,
286,
2060,
10297,
80567,
22306,
2079,
9266,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_find_bridge_bin() {
let hello_world = MetadataCommand::new()
.manifest_path(&Path::new("test-crates/hello-world").join("Cargo.toml"))
.exec()
.unwrap();
assert_eq!(
find_bridge(&hello_world, Some("bin")).unwrap(),
BridgeModel::Bin
);
assert_eq!(find_bridge(&hello_world, None).unwrap(), BridgeModel::Bin);
assert!(find_bridge(&hello_world, Some("rust-cpython")).is_err());
assert!(find_bridge(&hello_world, Some("pyo3")).is_err());
} | rust_cleaned_test_functions.jsonl/4513 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 275
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21814,
54944,
21816,
368,
341,
286,
1077,
23811,
31792,
284,
33589,
4062,
486,
931,
741,
310,
659,
42315,
2638,
2099,
1820,
486,
931,
445,
1944,
47589,
973,
7530,
4791,
30084,
1827,
5987,
445,
98228,
73494,
75,
5455,
310,
659,
11748,
741,
310,
659,
15454,
1428,
286,
2060,
10714,
33673,
310,
1477,
54944,
2099,
14990,
31792,
11,
4329,
445,
6863,
15197,
15454,
3148,
310,
19874,
1712,
486,
28794,
198,
286,
1439,
286,
2060,
10714,
10297,
3903,
54944,
2099,
14990,
31792,
11,
2240,
568,
15454,
1507,
19874,
1712,
486,
28794,
626,
286,
2060,
10297,
3903,
54944,
2099,
14990,
31792,
11,
4329,
445,
35788,
1786,
12669,
15197,
285,
9266,
1423,
286,
2060,
10297,
3903,
54944,
2099,
14990,
31792,
11,
4329,
445,
3288,
78,
18,
15197,
285,
9266,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_augmentation_parse_R() {
let bases = Default::default();
let address_size = 8;
let rest = [9, 8, 7, 6, 5, 4, 3, 2, 1];
let section = Section::with_endian(Endian::Little)
.uleb(1)
.D8(constants::DW_EH_PE_udata4.0)
.append_bytes(&rest)
.get_contents()
.unwrap();
let section = EhFrame::new(§ion, LittleEndian);
let input = &mut section.section().clone();
let aug_str = &mut EndianSlice::new(b"zR", LittleEndian);
let mut augmentation = Augmentation::default();
augmentation.fde_address_encoding = Some(constants::DW_EH_PE_udata4);
assert_eq!(
Augmentation::parse(aug_str, &bases, address_size, §ion, input),
Ok(augmentation)
);
assert_eq!(*input, EndianSlice::new(&rest, LittleEndian));
} | rust_cleaned_test_functions.jsonl/9392 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 439
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
60411,
31099,
21039,
2568,
368,
341,
286,
1077,
23092,
284,
7899,
486,
2258,
543,
286,
1077,
2621,
2368,
284,
220,
23,
280,
286,
1077,
2732,
284,
508,
24,
11,
220,
23,
11,
220,
22,
11,
220,
21,
11,
220,
20,
11,
220,
19,
11,
220,
18,
11,
220,
17,
11,
220,
16,
4821,
286,
1077,
3772,
284,
11113,
486,
4197,
87193,
7,
43231,
486,
38103,
340,
310,
659,
1111,
65,
7,
16,
340,
310,
659,
35,
23,
80368,
486,
54219,
2089,
39,
45784,
71939,
459,
19,
13,
15,
340,
310,
659,
5090,
12524,
2099,
3927,
340,
310,
659,
455,
16682,
741,
310,
659,
15454,
543,
286,
1077,
3772,
284,
60551,
4369,
486,
931,
2099,
2809,
11,
14671,
43231,
317,
286,
1077,
1946,
284,
609,
6984,
3772,
29168,
1005,
19982,
543,
286,
1077,
19303,
2895,
284,
609,
6984,
3972,
1103,
33236,
486,
931,
1883,
1,
89,
49,
497,
14671,
43231,
626,
286,
1077,
5206,
78785,
284,
4928,
31099,
486,
2258,
543,
286,
78785,
833,
450,
6744,
37613,
284,
4329,
80368,
486,
54219,
2089,
39,
45784,
71939,
459,
19,
626,
286,
2060,
10714,
33673,
310,
4928,
31099,
486,
6400,
2877,
768,
2895,
11,
609,
78267,
11,
2621,
2368,
11,
609,
2809,
11,
1946,
1326,
310,
7622,
2877,
768,
31099,
340,
286,
1439,
286,
2060,
10714,
0,
4071,
1355,
11,
3972,
1103,
33236,
486,
931,
2099,
3927,
11,
14671,
43231,
1106,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_fold_get_elem1() {
fold("x = [,10][0]", "x = void 0");
fold("x = [10, 20][0]", "x = 10");
fold("x = [10, 20][1]", "x = 20");
fold("x = [10, 20][-1]", "x = void 0;");
fold("x = [10, 20][2]", "x = void 0;");
fold("x = [foo(), 0][1]", "x = (foo(), 0);");
fold("x = [0, foo()][1]", "x = foo()");
fold("x = [0, foo()][0]", "x = (foo(), 0)");
fold_same("for([1][0] in {});");
} | rust_cleaned_test_functions.jsonl/122192 | {
"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,
61187,
3062,
28179,
16,
368,
341,
262,
11555,
445,
87,
284,
78168,
16,
15,
1457,
15,
19076,
330,
87,
284,
737,
220,
15,
797,
262,
11555,
445,
87,
284,
508,
16,
15,
11,
220,
17,
15,
1457,
15,
19076,
330,
87,
284,
220,
16,
15,
797,
262,
11555,
445,
87,
284,
508,
16,
15,
11,
220,
17,
15,
1457,
16,
19076,
330,
87,
284,
220,
17,
15,
3071,
262,
11555,
445,
87,
284,
508,
16,
15,
11,
220,
17,
15,
62872,
16,
19076,
330,
87,
284,
737,
220,
15,
34649,
262,
11555,
445,
87,
284,
508,
16,
15,
11,
220,
17,
15,
1457,
17,
19076,
330,
87,
284,
737,
220,
15,
26,
3071,
262,
11555,
445,
87,
284,
508,
7975,
1507,
220,
15,
1457,
16,
19076,
330,
87,
284,
320,
7975,
1507,
220,
15,
1215,
797,
262,
11555,
445,
87,
284,
508,
15,
11,
15229,
75453,
16,
19076,
330,
87,
284,
15229,
45961,
262,
11555,
445,
87,
284,
508,
15,
11,
15229,
75453,
15,
19076,
330,
87,
284,
320,
7975,
1507,
220,
15,
20996,
262,
11555,
33574,
445,
1958,
2561,
16,
1457,
15,
60,
304,
4687,
1215,
797,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_log_level() {
#[derive(Debug)]
struct TestData<'a> {
param: &'a str,
result: Result<slog::Level>,
}
let tests = &[
TestData {
param: "",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_PARAM)),
},
TestData {
param: "=",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_KEY)),
},
TestData {
param: "x=",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_KEY)),
},
TestData {
param: "=y",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_KEY)),
},
TestData {
param: "==",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_PARAM)),
},
TestData {
param: "= =",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_PARAM)),
},
TestData {
param: "x=y",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_KEY)),
},
TestData {
param: "agent=debug",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_KEY)),
},
TestData {
param: "agent.logg=debug",
result: Err(make_err(ERR_INVALID_LOG_LEVEL_KEY)),
},
TestData {
param: "agent.log=trace",
result: Ok(slog::Level::Trace),
},
TestData {
param: "agent.log=debug",
result: Ok(slog::Level::Debug),
},
TestData {
param: "agent.log=info",
result: Ok(slog::Level::Info),
},
TestData {
param: "agent.log=warn",
result: Ok(slog::Level::Warning),
},
TestData {
param: "agent.log=warning",
result: Ok(slog::Level::Warning),
},
TestData {
param: "agent.log=error",
result: Ok(slog::Level::Error),
},
TestData {
param: "agent.log=critical",
result: Ok(slog::Level::Critical),
},
TestData {
param: "agent.log=fatal",
result: Ok(slog::Level::Critical),
},
TestData {
param: "agent.log=panic",
result: Ok(slog::Level::Critical),
},
];
for (i, d) in tests.iter().enumerate() {
let msg = format!("test[{}]: {:?}", i, d);
let result = get_log_level(d.param);
let msg = format!("{}: result: {:?}", msg, result);
assert_result!(d.result, result, format!("{}", msg));
}
} | rust_cleaned_test_functions.jsonl/4048 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1797
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
5224,
8274,
368,
341,
286,
11506,
27098,
42618,
5563,
286,
2036,
93200,
18291,
64,
29,
341,
310,
1685,
25,
30136,
64,
607,
345,
310,
1102,
25,
5714,
44047,
839,
486,
4449,
12520,
286,
555,
286,
1077,
7032,
284,
609,
9640,
310,
93200,
341,
394,
1685,
25,
8324,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
12073,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
36234,
345,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
6600,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
87,
428,
345,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
6600,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
37827,
88,
756,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
6600,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
98651,
756,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
12073,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
37827,
284,
756,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
12073,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
87,
29368,
756,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
6600,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
28,
8349,
756,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
6600,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
70,
28,
8349,
756,
394,
1102,
25,
15495,
36944,
9266,
68174,
15167,
8419,
17415,
6600,
6965,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
15067,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
6550,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
8349,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
7939,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
2733,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
1731,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
33481,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
12087,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
18928,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
12087,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
841,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
1454,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
19535,
14509,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
42008,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
18111,
4212,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
42008,
1326,
310,
1153,
310,
93200,
341,
394,
1685,
25,
330,
8092,
1665,
28,
19079,
756,
394,
1102,
25,
7622,
1141,
839,
486,
4449,
486,
42008,
1326,
310,
1153,
286,
15424,
286,
369,
320,
72,
11,
294,
8,
304,
7032,
19471,
1005,
76569,
368,
341,
310,
1077,
3750,
284,
3561,
17223,
1944,
58,
6257,
5669,
71964,
600,
11,
294,
626,
310,
1077,
1102,
284,
633,
5224,
8274,
1500,
6634,
626,
310,
1077,
3750,
284,
3561,
17223,
6257,
25,
1102,
25,
71964,
3750,
11,
1102,
626,
310,
2060,
5287,
10297,
67,
12071,
11,
1102,
11,
3561,
79878,
3750,
1106,
286,
456,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_parse_header() {
let a: AcceptEncoding = Header::parse_header([b"gzip;q=1.0, identity; q=0.5".to_vec()].as_ref()).unwrap();
let b = AcceptEncoding(vec![
qitem(Encoding::Gzip),
QualityItem::new(Encoding::Identity, Quality(500)),
]);
assert_eq!(a, b);
} | rust_cleaned_test_functions.jsonl/16379 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 170
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
8757,
368,
341,
286,
1077,
264,
25,
20829,
14690,
284,
12104,
486,
6400,
8757,
2561,
65,
59719,
9964,
60899,
28,
16,
13,
15,
11,
9569,
26,
2804,
28,
15,
13,
20,
3263,
983,
13251,
57590,
300,
7793,
6011,
15454,
543,
286,
1077,
293,
284,
20829,
14690,
25592,
90515,
310,
2804,
1203,
85177,
486,
38,
9964,
1326,
310,
17927,
1234,
486,
931,
85177,
486,
18558,
11,
17927,
7,
20,
15,
15,
6965,
286,
13201,
286,
2060,
10714,
10297,
64,
11,
293,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_block_encoder_huffman() {
let test_cases: [TestElement; 6] = [
// test a header with ref to static - encode_indexed
TestElement {
headers: vec![(String::from(":method"), String::from("GET"))],
header_block: &[0x00, 0x00, 0xd1],
encoder_inst: &[],
},
// test encode_literal_with_name_ref
TestElement {
headers: vec![(String::from(":path"), String::from("/somewhere"))],
header_block: &[
0x00, 0x00, 0x51, 0x87, 0x61, 0x07, 0xa4, 0xbe, 0x27, 0x2d, 0x85,
],
encoder_inst: &[],
},
TestElement {
headers: vec![(String::from("my-header"), String::from("my-value"))],
header_block: &[0x02, 0x80, 0x10],
encoder_inst: &[
0x67, 0xa7, 0xd2, 0xd3, 0x94, 0x72, 0x16, 0xcf, 0x86, 0xa7, 0xd2, 0xdd, 0xc7,
0x45, 0xa5,
],
},
// test encode_indexed with a ref to dynamic table.
TestElement {
headers: vec![(String::from("my-header"), String::from("my-value"))],
header_block: ENCODE_INDEXED_REF_DYNAMIC,
encoder_inst: &[],
},
// test encode_literal_with_name_ref.
TestElement {
headers: vec![(String::from("my-header"), String::from("my-value2"))],
header_block: &[
0x02, 0x00, 0x40, 0x87, 0xa7, 0xd2, 0xdd, 0xc7, 0x45, 0xa5, 0x17,
],
encoder_inst: &[],
},
// test multiple headers
TestElement {
headers: vec![
(String::from(":method"), String::from("GET")),
(String::from(":path"), String::from("/somewhere")),
(String::from(":authority"), String::from("example.com")),
(String::from(":scheme"), String::from("https")),
],
header_block: &[
0x00, 0x01, 0xd1, 0x51, 0x87, 0x61, 0x07, 0xa4, 0xbe, 0x27, 0x2d, 0x85, 0x50,
0x88, 0x2f, 0x91, 0xd3, 0x5d, 0x05, 0x5c, 0x87, 0xa7, 0xd7,
],
encoder_inst: &[],
},
];
let mut encoder = connect(true);
encoder.encoder.set_max_blocked_streams(100).unwrap();
encoder.encoder.set_max_capacity(200).unwrap();
// test the change capacity instruction.
send_instructions(&mut encoder, CAP_INSTRUCTION_200);
for t in &test_cases {
let buf = encoder
.encoder
.encode_header_block(&mut encoder.conn, &t.headers, 1)
.unwrap();
assert_eq!(&buf[..], t.header_block);
send_instructions(&mut encoder, t.encoder_inst);
}
} | rust_cleaned_test_functions.jsonl/18411 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1766
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8757,
7113,
39068,
1523,
77708,
368,
341,
286,
1077,
1273,
41427,
25,
508,
2271,
1691,
26,
220,
21,
60,
284,
2278,
310,
442,
1273,
264,
4247,
448,
2053,
311,
1099,
481,
16164,
3560,
291,
198,
310,
3393,
1691,
341,
394,
7102,
25,
7486,
0,
9697,
703,
486,
1499,
18893,
4393,
3975,
923,
486,
1499,
445,
3806,
2761,
1259,
394,
4247,
7113,
25,
44590,
15,
87,
15,
15,
11,
220,
15,
87,
15,
15,
11,
220,
15,
9703,
16,
1259,
394,
23668,
17740,
25,
44590,
1259,
310,
1153,
310,
442,
1273,
16164,
34100,
6615,
1269,
7793,
198,
310,
3393,
1691,
341,
394,
7102,
25,
7486,
0,
9697,
703,
486,
1499,
18893,
2343,
3975,
923,
486,
1499,
4283,
56739,
60652,
2761,
1259,
394,
4247,
7113,
25,
609,
9640,
503,
220,
15,
87,
15,
15,
11,
220,
15,
87,
15,
15,
11,
220,
15,
87,
20,
16,
11,
220,
15,
87,
23,
22,
11,
220,
15,
87,
21,
16,
11,
220,
15,
87,
15,
22,
11,
220,
15,
9591,
19,
11,
220,
15,
42459,
11,
220,
15,
87,
17,
22,
11,
220,
15,
87,
17,
67,
11,
220,
15,
87,
23,
20,
345,
394,
3211,
394,
23668,
17740,
25,
44590,
1259,
310,
1153,
3374,
310,
3393,
1691,
341,
394,
7102,
25,
7486,
0,
9697,
703,
486,
1499,
445,
2408,
9351,
3975,
923,
486,
1499,
445,
2408,
19083,
2761,
1259,
394,
4247,
7113,
25,
44590,
15,
87,
15,
17,
11,
220,
15,
87,
23,
15,
11,
220,
15,
87,
16,
15,
1259,
394,
23668,
17740,
25,
609,
9640,
503,
220,
15,
87,
21,
22,
11,
220,
15,
9591,
22,
11,
220,
15,
9703,
17,
11,
220,
15,
9703,
18,
11,
220,
15,
87,
24,
19,
11,
220,
15,
87,
22,
17,
11,
220,
15,
87,
16,
21,
11,
220,
15,
55649,
11,
220,
15,
87,
23,
21,
11,
220,
15,
9591,
22,
11,
220,
15,
9703,
17,
11,
220,
15,
53432,
11,
220,
15,
8148,
22,
345,
503,
220,
15,
87,
19,
20,
11,
220,
15,
9591,
20,
345,
394,
3211,
310,
1153,
310,
442,
1273,
16164,
3560,
291,
448,
264,
2053,
311,
8741,
1965,
624,
310,
3393,
1691,
341,
394,
7102,
25,
7486,
0,
9697,
703,
486,
1499,
445,
2408,
9351,
3975,
923,
486,
1499,
445,
2408,
19083,
2761,
1259,
394,
4247,
7113,
25,
5190,
14866,
14515,
1479,
12312,
57356,
345,
394,
23668,
17740,
25,
44590,
1259,
310,
1153,
310,
442,
1273,
16164,
34100,
6615,
1269,
7793,
624,
310,
3393,
1691,
341,
394,
7102,
25,
7486,
0,
9697,
703,
486,
1499,
445,
2408,
9351,
3975,
923,
486,
1499,
445,
2408,
19083,
17,
2761,
1259,
394,
4247,
7113,
25,
609,
9640,
503,
220,
15,
87,
15,
17,
11,
220,
15,
87,
15,
15,
11,
220,
15,
87,
19,
15,
11,
220,
15,
87,
23,
22,
11,
220,
15,
9591,
22,
11,
220,
15,
9703,
17,
11,
220,
15,
53432,
11,
220,
15,
8148,
22,
11,
220,
15,
87,
19,
20,
11,
220,
15,
9591,
20,
11,
220,
15,
87,
16,
22,
345,
394,
3211,
394,
23668,
17740,
25,
44590,
1259,
310,
1153,
310,
442,
1273,
5248,
7102,
198,
310,
3393,
1691,
341,
394,
7102,
25,
7486,
90515,
503,
320,
703,
486,
1499,
18893,
4393,
3975,
923,
486,
1499,
445,
3806,
30154,
503,
320,
703,
486,
1499,
18893,
2343,
3975,
923,
486,
1499,
4283,
56739,
60652,
30154,
503,
320,
703,
486,
1499,
18893,
84454,
3975,
923,
486,
1499,
445,
8687,
905,
30154,
503,
320,
703,
486,
1499,
18893,
46141,
3975,
923,
486,
1499,
445,
2428,
30154,
394,
3211,
394,
4247,
7113,
25,
609,
9640,
503,
220,
15,
87,
15,
15,
11,
220,
15,
87,
15,
16,
11,
220,
15,
9703,
16,
11,
220,
15,
87,
20,
16,
11,
220,
15,
87,
23,
22,
11,
220,
15,
87,
21,
16,
11,
220,
15,
87,
15,
22,
11,
220,
15,
9591,
19,
11,
220,
15,
42459,
11,
220,
15,
87,
17,
22,
11,
220,
15,
87,
17,
67,
11,
220,
15,
87,
23,
20,
11,
220,
15,
87,
20,
15,
345,
503,
220,
15,
87,
23,
23,
11,
220,
15,
87,
17,
69,
11,
220,
15,
87,
24,
16,
11,
220,
15,
9703,
18,
11,
220,
15,
87,
20,
67,
11,
220,
15,
87,
15,
20,
11,
220,
15,
87,
20,
66,
11,
220,
15,
87,
23,
22,
11,
220,
15,
9591,
22,
11,
220,
15,
9703,
22,
345,
394,
3211,
394,
23668,
17740,
25,
44590,
1259,
310,
1153,
286,
15424,
286,
1077,
5206,
23668,
284,
4564,
3715,
626,
286,
23668,
69042,
980,
6345,
89223,
74872,
7,
16,
15,
15,
568,
15454,
543,
286,
23668,
69042,
980,
6345,
35603,
7,
17,
15,
15,
568,
15454,
1428,
286,
442,
1273,
279,
2297,
8654,
7600,
624,
286,
3624,
82427,
2099,
6984,
23668,
11,
26101,
2158,
57455,
62,
17,
15,
15,
626,
286,
369,
259,
304,
609,
1944,
41427,
341,
310,
1077,
6607,
284,
23668,
198,
394,
659,
27008,
198,
394,
659,
6180,
8757,
7113,
2099,
6984,
23668,
22810,
11,
609,
83,
18022,
11,
220,
16,
340,
394,
659,
15454,
543,
310,
2060,
10714,
0,
2099,
5909,
95874,
1125,
259,
17093,
7113,
317,
310,
3624,
82427,
2099,
6984,
23668,
11,
259,
69042,
17740,
317,
286,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_decode() {
for &case in crate::test::TEST_CASES {
println!("case {}", case);
let input = make_test_input(case);
let (encoded, hash) = { encode::encode(&input) };
let output = decode(&encoded, &hash).unwrap();
assert_eq!(input, output);
assert_eq!(output.len(), output.capacity());
}
} | rust_cleaned_test_functions.jsonl/118133 | {
"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,
15227,
368,
341,
286,
369,
609,
5638,
304,
17717,
486,
1944,
486,
10033,
28540,
50,
341,
310,
13751,
17223,
5638,
24689,
1142,
317,
310,
1077,
1946,
284,
1281,
4452,
5898,
59475,
317,
310,
1077,
320,
19329,
11,
5175,
8,
284,
314,
16164,
486,
6180,
2099,
1355,
8,
2605,
310,
1077,
2550,
284,
16895,
2099,
19329,
11,
609,
8296,
568,
15454,
543,
310,
2060,
10714,
10297,
1355,
11,
2550,
317,
310,
2060,
10714,
10297,
3006,
19406,
1507,
2550,
59168,
1423,
286,
456,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 5 |
#[test]
fn test_flush() {
for cards in gen_flushes() {
let result = hand(cards);
if result.hand_type == StraightFlush {
continue;
}
assert_eq!(result.hand_type, Flush, "{:#?}", result);
}
} | rust_cleaned_test_functions.jsonl/3092 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 154
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39213,
368,
341,
286,
369,
7411,
304,
4081,
39213,
288,
368,
341,
310,
1077,
1102,
284,
1424,
73863,
317,
310,
421,
1102,
34338,
1819,
621,
45810,
46874,
341,
394,
3060,
280,
310,
456,
310,
2060,
10714,
10297,
1382,
34338,
1819,
11,
57626,
11,
13868,
14111,
52652,
1102,
317,
286,
456,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_decoding2() {
assert_eq!(
decoding(String::from("ABCDEFGHIJKLMNOPQRSTUVWXYZ")),
String::from("ZZZZZZZZZZZZZZZZZZZZZZZZZZ")
);
} | rust_cleaned_test_functions.jsonl/100636 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 111
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13783,
3700,
17,
368,
341,
286,
2060,
10714,
33673,
310,
47116,
2242,
486,
1499,
445,
75902,
30154,
310,
923,
486,
1499,
445,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
33536,
1138,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_simple_application() {
let app = glib::Object::new(
SimpleApplication::get_type(),
&[
("application-id", &"org.gtk-rs.SimpleApplication"),
("flags", &::ApplicationFlags::empty()),
],
)
.unwrap()
.downcast::<::Application>()
.unwrap();
app.set_inactivity_timeout(10000);
assert!(app.run(&["--local".to_string()]) == EXIT_STATUS);
} | rust_cleaned_test_functions.jsonl/24086 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 248
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
30015,
38721,
368,
341,
286,
1077,
906,
284,
342,
2740,
486,
1190,
486,
931,
1006,
310,
8993,
4988,
486,
455,
1819,
3148,
310,
609,
9640,
394,
3489,
5132,
12897,
497,
609,
1,
1775,
1302,
6242,
3795,
82,
24252,
4988,
4461,
394,
3489,
11161,
497,
609,
486,
4988,
9195,
486,
3194,
14702,
310,
3211,
286,
1727,
286,
659,
15454,
741,
286,
659,
2923,
3829,
27638,
486,
4988,
18949,
286,
659,
15454,
1428,
286,
906,
980,
1243,
7175,
20537,
7,
16,
15,
15,
15,
15,
626,
286,
2060,
10297,
676,
7634,
2099,
1183,
313,
2438,
3263,
983,
3904,
368,
2467,
621,
29839,
9348,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_xlinker() {
let args = rpaths_to_flags(&[
"a/normal/path".to_string(),
"a,comma,path".to_string()
]);
assert_eq!(args, vec![
"-Wl,-rpath,a/normal/path".to_string(),
"-Wl,-rpath".to_string(),
"-Xlinker".to_string(),
"a,comma,path".to_string()
]);
} | rust_cleaned_test_functions.jsonl/38656 | {
"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,
3212,
2080,
261,
368,
341,
262,
1077,
2827,
284,
435,
21623,
2346,
14130,
2099,
9640,
286,
330,
64,
14,
8252,
50976,
3263,
983,
3904,
3148,
286,
330,
64,
11,
45386,
76987,
3263,
983,
3904,
741,
262,
22712,
262,
2060,
10714,
10297,
2116,
11,
7486,
90515,
286,
6523,
54,
75,
4999,
81,
2343,
15012,
14,
8252,
50976,
3263,
983,
3904,
3148,
286,
6523,
54,
75,
4999,
81,
2343,
3263,
983,
3904,
3148,
286,
6523,
55,
2080,
261,
3263,
983,
3904,
3148,
286,
330,
64,
11,
45386,
76987,
3263,
983,
3904,
741,
262,
13201,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_many() {
let dir = tempdir().unwrap();
let file1 = dir.path().join("file1");
fs::write(&file1, b"foo").unwrap();
let file2 = dir.path().join("file2");
fs::write(&file2, b"bar").unwrap();
let output = cmd!(baokeshed_exe(), &file1, &file2, "-")
.stdin_bytes("baz")
.read()
.unwrap();
let foo_hash = baokeshed::hash(b"foo");
let bar_hash = baokeshed::hash(b"bar");
let baz_hash = baokeshed::hash(b"baz");
let expected = format!(
"{} {}\n{} {}\n{} -",
foo_hash.to_hex(),
file1.to_string_lossy(),
bar_hash.to_hex(),
file2.to_string_lossy(),
baz_hash.to_hex(),
);
assert_eq!(expected, output);
} | rust_cleaned_test_functions.jsonl/40678 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 367
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8950,
22101,
368,
341,
262,
1077,
5419,
284,
2730,
3741,
1005,
15454,
543,
262,
1077,
1034,
16,
284,
5419,
3875,
1005,
5987,
445,
1192,
16,
797,
262,
8619,
486,
4934,
2099,
1192,
16,
11,
293,
1,
7975,
1827,
15454,
543,
262,
1077,
1034,
17,
284,
5419,
3875,
1005,
5987,
445,
1192,
17,
797,
262,
8619,
486,
4934,
2099,
1192,
17,
11,
293,
1,
2257,
1827,
15454,
543,
262,
1077,
2550,
284,
5439,
10297,
4645,
562,
4288,
291,
76074,
1507,
609,
1192,
16,
11,
609,
1192,
17,
11,
6523,
1138,
286,
659,
51602,
12524,
445,
42573,
1138,
286,
659,
878,
741,
286,
659,
15454,
543,
262,
1077,
15229,
8950,
284,
12789,
562,
4288,
291,
486,
8296,
1883,
1,
7975,
797,
262,
1077,
3619,
8950,
284,
12789,
562,
4288,
291,
486,
8296,
1883,
1,
2257,
797,
262,
1077,
50247,
8950,
284,
12789,
562,
4288,
291,
486,
8296,
1883,
1,
42573,
797,
262,
1077,
3601,
284,
3561,
33673,
286,
35503,
220,
56057,
77,
6257,
220,
56057,
77,
6257,
220,
481,
756,
286,
15229,
8950,
2389,
32655,
3148,
286,
1034,
16,
2389,
3904,
11193,
88,
3148,
286,
3619,
8950,
2389,
32655,
3148,
286,
1034,
17,
2389,
3904,
11193,
88,
3148,
286,
50247,
8950,
2389,
32655,
3148,
262,
1439,
262,
2060,
10714,
10297,
7325,
11,
2550,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_compute_bank_stats_confirmed() {
let node_keypair = Keypair::new();
let vote_keypair = Keypair::new();
let stake_keypair = Keypair::new();
let node_pubkey = node_keypair.pubkey();
let mut keypairs = HashMap::new();
keypairs.insert(
node_pubkey,
ValidatorVoteKeypairs::new(node_keypair, vote_keypair, stake_keypair),
);
let (bank_forks, mut progress) = initialize_state(&keypairs, 10_000);
let bank0 = bank_forks.get(0).unwrap().clone();
let my_keypairs = keypairs.get(&node_pubkey).unwrap();
let vote_tx = vote_transaction::new_vote_transaction(
vec![0],
bank0.hash(),
bank0.last_blockhash(),
&my_keypairs.node_keypair,
&my_keypairs.vote_keypair,
&my_keypairs.vote_keypair,
);
let bank_forks = RwLock::new(bank_forks);
let bank1 = Bank::new_from_parent(&bank0, &node_pubkey, 1);
bank1.process_transaction(&vote_tx).unwrap();
bank1.freeze();
// Test confirmations
let ancestors = bank_forks.read().unwrap().ancestors();
let mut frozen_banks: Vec<_> = bank_forks
.read()
.unwrap()
.frozen_banks()
.values()
.cloned()
.collect();
let tower = Tower::new_for_tests(0, 0.67);
let newly_computed = ReplayStage::compute_bank_stats(
&node_pubkey,
&ancestors,
&mut frozen_banks,
&tower,
&mut progress,
&VoteTracker::default(),
&ClusterSlots::default(),
&bank_forks,
&mut HashSet::new(),
);
assert_eq!(newly_computed, vec![0]);
{
let fork_progress = progress.get(&0).unwrap();
let confirmed_forks = ReplayStage::confirm_forks(
&tower,
&fork_progress.fork_stats.stake_lockouts,
fork_progress.fork_stats.total_staked,
&progress,
&bank_forks,
);
assert!(confirmed_forks.is_empty())
}
bank_forks.write().unwrap().insert(bank1);
progress.insert(
1,
ForkProgress::new(bank0.last_blockhash(), None, None, 0, 0),
);
let ancestors = bank_forks.read().unwrap().ancestors();
let mut frozen_banks: Vec<_> = bank_forks
.read()
.unwrap()
.frozen_banks()
.values()
.cloned()
.collect();
let newly_computed = ReplayStage::compute_bank_stats(
&node_pubkey,
&ancestors,
&mut frozen_banks,
&tower,
&mut progress,
&VoteTracker::default(),
&ClusterSlots::default(),
&bank_forks,
&mut HashSet::new(),
);
assert_eq!(newly_computed, vec![1]);
{
let fork_progress = progress.get(&1).unwrap();
let confirmed_forks = ReplayStage::confirm_forks(
&tower,
&fork_progress.fork_stats.stake_lockouts,
fork_progress.fork_stats.total_staked,
&progress,
&bank_forks,
);
assert_eq!(confirmed_forks, vec![0]);
}
let ancestors = bank_forks.read().unwrap().ancestors();
let mut frozen_banks: Vec<_> = bank_forks
.read()
.unwrap()
.frozen_banks()
.values()
.cloned()
.collect();
let newly_computed = ReplayStage::compute_bank_stats(
&node_pubkey,
&ancestors,
&mut frozen_banks,
&tower,
&mut progress,
&VoteTracker::default(),
&ClusterSlots::default(),
&bank_forks,
&mut HashSet::new(),
);
// No new stats should have been computed
assert!(newly_computed.is_empty());
} | rust_cleaned_test_functions.jsonl/91763 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2242
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
57028,
35733,
15381,
16059,
8434,
368,
341,
286,
1077,
2436,
3097,
12670,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
6910,
3097,
12670,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
18279,
3097,
12670,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
2436,
34014,
792,
284,
2436,
3097,
12670,
47773,
792,
543,
286,
1077,
5206,
1376,
77256,
284,
10528,
486,
931,
543,
286,
1376,
77256,
7030,
1006,
310,
2436,
34014,
792,
345,
310,
32566,
41412,
6608,
1082,
4720,
486,
931,
6958,
3097,
12670,
11,
6910,
3097,
12670,
11,
18279,
3097,
12670,
1326,
286,
3475,
286,
1077,
320,
17033,
761,
73302,
11,
5206,
5098,
8,
284,
9468,
4387,
2099,
792,
77256,
11,
220,
16,
15,
62,
15,
15,
15,
317,
286,
1077,
6073,
15,
284,
6073,
761,
73302,
670,
7,
15,
568,
15454,
1005,
19982,
543,
286,
1077,
847,
3097,
77256,
284,
1376,
77256,
670,
2099,
3509,
34014,
792,
568,
15454,
543,
286,
1077,
6910,
17805,
284,
6910,
28884,
486,
931,
54360,
28884,
1006,
310,
7486,
20703,
15,
1259,
310,
6073,
15,
15101,
3148,
310,
6073,
15,
9110,
7113,
8296,
3148,
310,
609,
2408,
3097,
77256,
12097,
3097,
12670,
345,
310,
609,
2408,
3097,
77256,
79422,
3097,
12670,
345,
310,
609,
2408,
3097,
77256,
79422,
3097,
12670,
345,
286,
3475,
286,
1077,
6073,
761,
73302,
284,
55294,
11989,
486,
931,
1883,
1180,
761,
73302,
317,
286,
1077,
6073,
16,
284,
8547,
486,
931,
5673,
15960,
2099,
17033,
15,
11,
609,
3509,
34014,
792,
11,
220,
16,
317,
286,
6073,
16,
16988,
28884,
2099,
29358,
17805,
568,
15454,
543,
286,
6073,
16,
76685,
1428,
286,
442,
3393,
7683,
804,
198,
286,
1077,
37518,
284,
6073,
761,
73302,
4125,
1005,
15454,
1005,
681,
267,
1087,
543,
286,
1077,
5206,
19690,
880,
4039,
25,
11312,
32399,
29,
284,
6073,
761,
73302,
198,
310,
659,
878,
741,
310,
659,
15454,
741,
310,
659,
69,
42240,
880,
4039,
741,
310,
659,
3661,
741,
310,
659,
564,
19684,
741,
310,
659,
17384,
543,
286,
1077,
21271,
284,
21938,
486,
931,
5478,
32509,
7,
15,
11,
220,
15,
13,
21,
22,
317,
286,
1077,
13631,
2965,
19292,
284,
59061,
19398,
486,
27706,
35733,
15381,
1006,
310,
609,
3509,
34014,
792,
345,
310,
609,
681,
267,
1087,
345,
310,
609,
6984,
19690,
880,
4039,
345,
310,
609,
77578,
345,
310,
609,
6984,
5098,
345,
310,
609,
41412,
31133,
486,
2258,
3148,
310,
609,
28678,
51647,
486,
2258,
3148,
310,
609,
17033,
761,
73302,
345,
310,
609,
6984,
18931,
486,
931,
3148,
286,
1439,
286,
2060,
10714,
10297,
931,
398,
2965,
19292,
11,
7486,
20703,
15,
2558,
16885,
286,
341,
310,
1077,
22435,
27200,
284,
5098,
670,
2099,
15,
568,
15454,
543,
310,
1077,
10774,
761,
73302,
284,
59061,
19398,
486,
13800,
761,
73302,
1006,
394,
609,
77578,
345,
394,
609,
44738,
27200,
833,
669,
15381,
1236,
726,
9818,
11672,
345,
394,
22435,
27200,
833,
669,
15381,
13717,
1261,
7741,
345,
394,
609,
14366,
345,
394,
609,
17033,
761,
73302,
345,
310,
3475,
310,
2060,
10297,
41028,
761,
73302,
2079,
15124,
2398,
286,
555,
1789,
286,
6073,
761,
73302,
3836,
1005,
15454,
1005,
4208,
1883,
1180,
16,
317,
286,
5098,
7030,
1006,
310,
220,
16,
345,
310,
47850,
9496,
486,
931,
1883,
1180,
15,
9110,
7113,
8296,
1507,
2240,
11,
2240,
11,
220,
15,
11,
220,
15,
1326,
286,
1439,
286,
1077,
37518,
284,
6073,
761,
73302,
4125,
1005,
15454,
1005,
681,
267,
1087,
543,
286,
1077,
5206,
19690,
880,
4039,
25,
11312,
32399,
29,
284,
6073,
761,
73302,
198,
310,
659,
878,
741,
310,
659,
15454,
741,
310,
659,
69,
42240,
880,
4039,
741,
310,
659,
3661,
741,
310,
659,
564,
19684,
741,
310,
659,
17384,
543,
286,
1077,
13631,
2965,
19292,
284,
59061,
19398,
486,
27706,
35733,
15381,
1006,
310,
609,
3509,
34014,
792,
345,
310,
609,
681,
267,
1087,
345,
310,
609,
6984,
19690,
880,
4039,
345,
310,
609,
77578,
345,
310,
609,
6984,
5098,
345,
310,
609,
41412,
31133,
486,
2258,
3148,
310,
609,
28678,
51647,
486,
2258,
3148,
310,
609,
17033,
761,
73302,
345,
310,
609,
6984,
18931,
486,
931,
3148,
286,
3475,
286,
2060,
10714,
10297,
931,
398,
2965,
19292,
11,
7486,
20703,
16,
2558,
286,
341,
310,
1077,
22435,
27200,
284,
5098,
670,
2099,
16,
568,
15454,
543,
310,
1077,
10774,
761,
73302,
284,
59061,
19398,
486,
13800,
761,
73302,
1006,
394,
609,
77578,
345,
394,
609,
44738,
27200,
833,
669,
15381,
1236,
726,
9818,
11672,
345,
394,
22435,
27200,
833,
669,
15381,
13717,
1261,
7741,
345,
394,
609,
14366,
345,
394,
609,
17033,
761,
73302,
345,
310,
1439,
310,
2060,
10714,
10297,
41028,
761,
73302,
11,
7486,
20703,
15,
2558,
286,
555,
286,
1077,
37518,
284,
6073,
761,
73302,
4125,
1005,
15454,
1005,
681,
267,
1087,
543,
286,
1077,
5206,
19690,
880,
4039,
25,
11312,
32399,
29,
284,
6073,
761,
73302,
198,
310,
659,
878,
741,
310,
659,
15454,
741,
310,
659,
69,
42240,
880,
4039,
741,
310,
659,
3661,
741,
310,
659,
564,
19684,
741,
310,
659,
17384,
543,
286,
1077,
13631,
2965,
19292,
284,
59061,
19398,
486,
27706,
35733,
15381,
1006,
310,
609,
3509,
34014,
792,
345,
310,
609,
681,
267,
1087,
345,
310,
609,
6984,
19690,
880,
4039,
345,
310,
609,
77578,
345,
310,
609,
6984,
5098,
345,
310,
609,
41412,
31133,
486,
2258,
3148,
310,
609,
28678,
51647,
486,
2258,
3148,
310,
609,
17033,
761,
73302,
345,
310,
609,
6984,
18931,
486,
931,
3148,
286,
1439,
286,
442,
2308,
501,
10472,
1265,
614,
1012,
24182,
198,
286,
2060,
10297,
931,
398,
2965,
19292,
2079,
15124,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_sort() -> Result<()> {
let data0 = vec![4, 1, 2, 10, 3, 3];
let data1 = vec![5, 1, 0, 6, 7];
let mut expected_data = [data0.clone(), data1.clone()].concat();
expected_data.sort_unstable();
let expected = Int32Array::from_slice(&expected_data);
let a0: &dyn Array = &Int32Array::from_slice(&data0);
let a1: &dyn Array = &Int32Array::from_slice(&data1);
let options = SortOptions::default();
let a0 = sort(a0, &options)?;
let a1 = sort(a1, &options)?;
let result = merge_sort(a0.as_ref(), a1.as_ref(), &options)?;
assert_eq!(expected, result.as_ref());
Ok(())
} | rust_cleaned_test_functions.jsonl/47143 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 347
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18435,
368,
1464,
5714,
71698,
341,
286,
1077,
821,
15,
284,
7486,
20703,
19,
11,
220,
16,
11,
220,
17,
11,
220,
16,
15,
11,
220,
18,
11,
220,
18,
935,
286,
1077,
821,
16,
284,
7486,
20703,
20,
11,
220,
16,
11,
220,
15,
11,
220,
21,
11,
220,
22,
4821,
286,
1077,
5206,
3601,
1769,
284,
508,
691,
15,
15997,
1507,
821,
16,
15997,
57590,
20164,
543,
286,
3601,
1769,
10614,
4907,
27992,
543,
286,
1077,
3601,
284,
1333,
18,
17,
1857,
486,
1499,
26488,
2099,
7325,
1769,
626,
286,
1077,
264,
15,
25,
609,
43085,
2910,
284,
609,
1072,
18,
17,
1857,
486,
1499,
26488,
2099,
691,
15,
317,
286,
1077,
264,
16,
25,
609,
43085,
2910,
284,
609,
1072,
18,
17,
1857,
486,
1499,
26488,
2099,
691,
16,
626,
286,
1077,
2606,
284,
15967,
3798,
486,
2258,
1428,
1789,
286,
1077,
264,
15,
284,
3378,
2877,
15,
11,
609,
2875,
40007,
286,
1077,
264,
16,
284,
3378,
2877,
16,
11,
609,
2875,
89720,
1789,
286,
1077,
1102,
284,
10880,
18435,
2877,
15,
5357,
7793,
1507,
264,
16,
5357,
7793,
1507,
609,
2875,
89720,
286,
2060,
10714,
10297,
7325,
11,
1102,
5357,
7793,
1423,
286,
7622,
50432,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_326_path_segment_expansion() {
let mut templates = [
UriTemplate::new("{/who}"),
UriTemplate::new("{/who,who}"),
UriTemplate::new("{/half,who}"),
UriTemplate::new("{/who,dub}"),
UriTemplate::new("{/var}"),
UriTemplate::new("{/var,empty}"),
UriTemplate::new("{/var,undef}"),
UriTemplate::new("{/var,x}/here"),
UriTemplate::new("{/var:1,var}"),
UriTemplate::new("{/list}"),
UriTemplate::new("{/list*}"),
UriTemplate::new("{/list*,path:4}"),
UriTemplate::new("{/keys}"),
UriTemplate::new("{/keys*}"),
];
for i in 0..templates.len() {
templates[i].set("dub", "me/too");
templates[i].set("v", "6");
templates[i].set("var", "value");
templates[i].set("hello", "Hello World!");
templates[i].set("list", &["red", "green", "blue"] as &[&str]);
templates[i].set("dom", &["example", "com"] as &[&str]);
templates[i].set("count", &["one", "two", "three"] as &[&str]);
templates[i].set("half", "50%");
templates[i].set("x", "1024");
templates[i].set(
"keys",
&[("semi", ";"), ("dot", "."), ("comma", ",")] as &[(&str, &str)],
);
templates[i].set("y", "768");
templates[i].set("who", "fred");
templates[i].set("empty", "");
templates[i].set("path", "/foo/bar");
templates[i].set("empty_keys", &[] as &[&str]);
templates[i].set("base", "http://example.com/home/");
}
assert_eq!(templates[0].build(), "/fred");
assert_eq!(templates[1].build(), "/fred/fred");
assert_eq!(templates[2].build(), "/50%25/fred");
assert_eq!(templates[3].build(), "/fred/me%2Ftoo");
assert_eq!(templates[4].build(), "/value");
assert_eq!(templates[5].build(), "/value/");
assert_eq!(templates[6].build(), "/value");
assert_eq!(templates[7].build(), "/value/1024/here");
assert_eq!(templates[8].build(), "/v/value");
assert_eq!(templates[9].build(), "/red,green,blue");
assert_eq!(templates[10].build(), "/red/green/blue");
assert_eq!(templates[11].build(), "/red/green/blue/%2Ffoo");
let template_12_answers = vec![
"/comma,%2C,dot,.,semi,%3B",
"/comma,%2C,semi,%3B,dot,.",
"/dot,.,comma,%2C,semi,%3B",
"/dot,.,semi,%3B,comma,%2C",
"/semi,%3B,comma,%2C,dot,.",
"/semi,%3B,dot,.,comma,%2C",
];
assert!(template_12_answers.contains(&templates[12].build().as_ref()));
let template_13_answers = vec![
"/comma=%2C/dot=./semi=%3B",
"/comma=%2C/semi=%3B/dot=.",
"/dot=./comma=%2C/semi=%3B",
"/dot=./semi=%3B/comma=%2C",
"/semi=%3B/comma=%2C/dot=.",
"/semi=%3B/dot=./comma=%2C",
];
assert!(template_13_answers.contains(&templates[13].build().as_ref()));
} | rust_cleaned_test_functions.jsonl/36936 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1441
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
18,
17,
21,
2638,
28061,
14214,
10501,
368,
341,
262,
1077,
5206,
19911,
284,
2278,
286,
17226,
7275,
486,
931,
13976,
14,
14623,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
14623,
11,
14623,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
37006,
11,
14623,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
14623,
11991,
392,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
947,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
947,
11,
3194,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
947,
11,
16135,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
947,
12803,
4472,
6739,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
947,
25,
16,
64055,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
1607,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
1607,
9,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
1607,
12314,
2343,
25,
19,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
10563,
92,
4461,
286,
17226,
7275,
486,
931,
13976,
14,
10563,
9,
92,
4461,
262,
15424,
262,
369,
600,
304,
220,
15,
496,
15463,
19406,
368,
341,
286,
19911,
989,
936,
746,
445,
67,
392,
497,
330,
2660,
32429,
78,
797,
286,
19911,
989,
936,
746,
445,
85,
497,
330,
21,
797,
286,
19911,
989,
936,
746,
445,
947,
497,
330,
957,
797,
286,
19911,
989,
936,
746,
445,
14990,
497,
330,
9707,
4337,
11142,
286,
19911,
989,
936,
746,
445,
1607,
497,
609,
1183,
1151,
497,
330,
13250,
497,
330,
12203,
1341,
438,
44590,
5,
495,
2558,
286,
19911,
989,
936,
746,
445,
5600,
497,
609,
1183,
8687,
497,
330,
874,
1341,
438,
44590,
5,
495,
2558,
286,
19911,
989,
936,
746,
445,
1830,
497,
609,
1183,
603,
497,
330,
19789,
497,
330,
27856,
1341,
438,
44590,
5,
495,
2558,
286,
19911,
989,
936,
746,
445,
37006,
497,
330,
20,
15,
92243,
286,
19911,
989,
936,
746,
445,
87,
497,
330,
16,
15,
17,
19,
797,
286,
19911,
989,
936,
746,
1006,
310,
330,
10563,
756,
310,
44590,
445,
86598,
497,
18963,
3975,
3489,
16119,
497,
22760,
701,
3489,
45386,
497,
3670,
30917,
438,
44590,
2099,
495,
11,
609,
495,
30749,
286,
1439,
286,
19911,
989,
936,
746,
445,
88,
497,
330,
22,
21,
23,
797,
286,
19911,
989,
936,
746,
445,
14623,
497,
330,
27993,
797,
286,
19911,
989,
936,
746,
445,
3194,
497,
14498,
286,
19911,
989,
936,
746,
445,
2343,
497,
3521,
7975,
49513,
797,
286,
19911,
989,
936,
746,
445,
3194,
12631,
497,
609,
1294,
438,
44590,
5,
495,
2558,
286,
19911,
989,
936,
746,
445,
3152,
497,
330,
1254,
1110,
8687,
905,
18215,
49897,
262,
555,
262,
2060,
10714,
10297,
15463,
58,
15,
936,
5834,
1507,
3521,
27993,
797,
262,
2060,
10714,
10297,
15463,
58,
16,
936,
5834,
1507,
3521,
27993,
6663,
1151,
797,
262,
2060,
10714,
10297,
15463,
58,
17,
936,
5834,
1507,
3521,
20,
15,
4,
17,
20,
6663,
1151,
797,
262,
2060,
10714,
10297,
15463,
58,
18,
936,
5834,
1507,
3521,
27993,
50899,
4,
17,
37,
36127,
797,
262,
2060,
10714,
10297,
15463,
58,
19,
936,
5834,
1507,
3521,
957,
797,
262,
2060,
10714,
10297,
15463,
58,
20,
936,
5834,
1507,
3521,
957,
49897,
262,
2060,
10714,
10297,
15463,
58,
21,
936,
5834,
1507,
3521,
957,
797,
262,
2060,
10714,
10297,
15463,
58,
22,
936,
5834,
1507,
3521,
957,
14,
16,
15,
17,
19,
14,
6739,
797,
262,
2060,
10714,
10297,
15463,
58,
23,
936,
5834,
1507,
3521,
85,
57542,
797,
262,
2060,
10714,
10297,
15463,
58,
24,
936,
5834,
1507,
3521,
1151,
11,
13250,
11,
12203,
797,
262,
2060,
10714,
10297,
15463,
58,
16,
15,
936,
5834,
1507,
3521,
1151,
4846,
4442,
97916,
797,
262,
2060,
10714,
10297,
15463,
58,
16,
16,
936,
5834,
1507,
3521,
1151,
4846,
4442,
97916,
12627,
17,
37,
7975,
797,
262,
1077,
3811,
62,
16,
17,
61610,
284,
7486,
90515,
286,
3521,
45386,
18191,
17,
34,
11991,
354,
11,
2572,
86598,
18191,
18,
33,
756,
286,
3521,
45386,
18191,
17,
34,
11,
86598,
18191,
18,
33,
11991,
354,
11,
10346,
286,
3521,
16119,
11,
2572,
45386,
18191,
17,
34,
11,
86598,
18191,
18,
33,
756,
286,
3521,
16119,
11,
2572,
86598,
18191,
18,
33,
11,
45386,
18191,
17,
34,
756,
286,
3521,
86598,
18191,
18,
33,
11,
45386,
18191,
17,
34,
11991,
354,
11,
10346,
286,
3521,
86598,
18191,
18,
33,
11991,
354,
11,
2572,
45386,
18191,
17,
34,
756,
262,
9747,
262,
2060,
10297,
4214,
62,
16,
17,
61610,
8786,
2099,
15463,
58,
16,
17,
936,
5834,
1005,
300,
7793,
7392,
262,
1077,
3811,
62,
16,
18,
61610,
284,
7486,
90515,
286,
3521,
45386,
7846,
17,
34,
3446,
354,
97183,
86598,
7846,
18,
33,
756,
286,
3521,
45386,
7846,
17,
34,
14,
86598,
7846,
18,
33,
3446,
354,
28,
10346,
286,
3521,
16119,
97183,
45386,
7846,
17,
34,
14,
86598,
7846,
18,
33,
756,
286,
3521,
16119,
97183,
86598,
7846,
18,
33,
25093,
1728,
7846,
17,
34,
756,
286,
3521,
86598,
7846,
18,
33,
25093,
1728,
7846,
17,
34,
3446,
354,
28,
10346,
286,
3521,
86598,
7846,
18,
33,
3446,
354,
97183,
45386,
7846,
17,
34,
756,
262,
9747,
262,
2060,
10297,
4214,
62,
16,
18,
61610,
8786,
2099,
15463,
58,
16,
18,
936,
5834,
1005,
300,
7793,
7392,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_examples() {
assert!(check_part1("111111"));
assert!(!check_part1("223450"));
assert!(!check_part1("123789"));
} | rust_cleaned_test_functions.jsonl/108523 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 87
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45279,
368,
341,
286,
2060,
10297,
2028,
10495,
16,
445,
16,
16,
16,
16,
16,
16,
4010,
286,
2060,
0,
3471,
2028,
10495,
16,
445,
17,
17,
18,
19,
20,
15,
4010,
286,
2060,
0,
3471,
2028,
10495,
16,
445,
16,
17,
18,
22,
23,
24,
4010,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_writer_gtf2() {
let mut reader = Reader::new(GTF_FILE_ONE_ATTRIB, GffType::GTF2);
let mut writer = Writer::new(vec![], GffType::GTF2);
for r in reader.records() {
writer
.write(&r.ok().expect("Error reading record"))
.ok()
.expect("Error writing record");
}
assert_eq!(writer.inner.into_inner().unwrap(), GTF_FILE_ONE_ATTRIB)
} | rust_cleaned_test_functions.jsonl/74496 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 236
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
28908,
1889,
8935,
17,
368,
341,
286,
1077,
5206,
6604,
284,
25166,
486,
931,
6699,
10808,
8087,
34727,
99043,
11,
479,
542,
929,
486,
38,
10808,
17,
317,
286,
1077,
5206,
6916,
284,
29404,
486,
931,
25592,
0,
12995,
479,
542,
929,
486,
38,
10808,
17,
317,
286,
369,
435,
304,
6604,
64516,
368,
341,
310,
6916,
198,
394,
659,
4934,
2099,
81,
18165,
1005,
17119,
445,
1454,
5290,
3255,
5455,
394,
659,
562,
741,
394,
659,
17119,
445,
1454,
4378,
3255,
797,
286,
456,
286,
2060,
10714,
10297,
18189,
9398,
39860,
34345,
1005,
15454,
1507,
479,
10808,
8087,
34727,
99043,
340,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_calculate_width() {
let badge = Badge::new(options());
assert_eq!(badge.calculate_width("build"), 29);
assert_eq!(badge.calculate_width("passing"), 44);
} | rust_cleaned_test_functions.jsonl/17844 | {
"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,
24005,
11207,
7927,
368,
341,
286,
1077,
23961,
284,
59083,
486,
931,
12078,
1423,
286,
2060,
10714,
10297,
31524,
43965,
7927,
445,
5834,
3975,
220,
17,
24,
317,
286,
2060,
10714,
10297,
31524,
43965,
7927,
445,
6385,
287,
3975,
220,
19,
19,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_accept() {
let text_plain = qitem(Mime(Text, Plain, vec![]));
let application_vendor = "application/vnd.github.v3.full+json; q=0.5".parse().unwrap();
let accept = Header::parse_header([b"text/plain".to_vec()].as_ref());
assert_eq!(accept.ok(), Some(Accept(vec![text_plain.clone()])));
let bytevec = [b"application/vnd.github.v3.full+json; q=0.5, text/plain".to_vec()];
let accept = Header::parse_header(bytevec.as_ref());
assert_eq!(accept.ok(), Some(Accept(vec![application_vendor, text_plain])));
} | rust_cleaned_test_functions.jsonl/38839 | {
"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,
35728,
368,
341,
286,
1077,
1467,
41015,
284,
2804,
1203,
3189,
545,
34082,
11,
43199,
11,
7486,
0,
1294,
1106,
286,
1077,
3766,
58320,
284,
330,
5132,
42701,
11021,
3133,
18,
21534,
10,
2236,
26,
2804,
28,
15,
13,
20,
3263,
6400,
1005,
15454,
1428,
286,
1077,
4193,
284,
12104,
486,
6400,
8757,
2561,
65,
66251,
36971,
3263,
983,
13251,
57590,
300,
7793,
1423,
286,
2060,
10714,
10297,
10330,
18165,
1507,
4329,
4346,
66,
1484,
25592,
20703,
1318,
41015,
15997,
368,
9365,
626,
286,
1077,
4922,
4083,
284,
508,
65,
1,
5132,
42701,
11021,
3133,
18,
21534,
10,
2236,
26,
2804,
28,
15,
13,
20,
11,
1467,
36971,
3263,
983,
13251,
33800,
286,
1077,
4193,
284,
12104,
486,
6400,
8757,
19738,
4083,
5357,
7793,
1423,
286,
2060,
10714,
10297,
10330,
18165,
1507,
4329,
4346,
66,
1484,
25592,
20703,
5132,
58320,
11,
1467,
41015,
81868,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_parse_invalid_credit_handshake() {
let buf = [
0b00000000, // DLCI of 0 is OK.
0b10010000, // Invalid handshake value.
0b00000010, // Priority = 2.
0b00000000, // Ignored.
0b00000010, // Max Frame Size Octet 1 = 4.
0b00000000, // Max Frame Size Octet 2 = 0.
0b00000000, // Ignored
0b00000001, // Initial Credits = 1.
];
assert_matches!(
ParameterNegotiationParams::decode(&buf[..]),
Err(FrameParseError::OutOfRange)
);
} | rust_cleaned_test_functions.jsonl/69345 | {
"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,
21039,
31433,
51569,
23194,
29661,
368,
341,
286,
1077,
6607,
284,
2278,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
15,
15,
11,
442,
42919,
40,
315,
220,
15,
374,
10402,
624,
310,
220,
15,
65,
16,
15,
15,
16,
15,
15,
15,
15,
11,
442,
13882,
57020,
897,
624,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
16,
15,
11,
442,
31920,
284,
220,
17,
624,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
15,
15,
11,
442,
33781,
3018,
624,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
16,
15,
11,
442,
7487,
16321,
8478,
4915,
295,
220,
16,
284,
220,
19,
624,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
15,
15,
11,
442,
7487,
16321,
8478,
4915,
295,
220,
17,
284,
220,
15,
624,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
15,
15,
11,
442,
33781,
3018,
198,
310,
220,
15,
65,
15,
15,
15,
15,
15,
15,
15,
16,
11,
442,
4127,
48700,
284,
220,
16,
624,
286,
9747,
286,
2060,
38344,
33673,
310,
15168,
47800,
354,
7101,
4870,
486,
18196,
2099,
5909,
95874,
17036,
310,
15495,
91008,
14463,
1454,
486,
46608,
340,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_is_file_get_path() {
let bank_forks = create_bank_forks();
let rrm = RpcRequestMiddleware::new(
PathBuf::from("/"),
None,
bank_forks.clone(),
RpcHealth::stub(),
);
let rrm_with_snapshot_config = RpcRequestMiddleware::new(
PathBuf::from("/"),
Some(SnapshotConfig::default()),
bank_forks,
RpcHealth::stub(),
);
assert!(rrm.is_file_get_path(DEFAULT_GENESIS_DOWNLOAD_PATH));
assert!(!rrm.is_file_get_path(DEFAULT_GENESIS_ARCHIVE));
assert!(!rrm.is_file_get_path("/snapshot.tar.bz2")); // This is a redirect
assert!(!rrm.is_file_get_path(
"/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(!rrm.is_file_get_path(
"/incremental-snapshot-100-200-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(rrm_with_snapshot_config.is_file_get_path(
"/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(rrm_with_snapshot_config.is_file_get_path(
"/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.zst"
));
assert!(rrm_with_snapshot_config
.is_file_get_path("/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.gz"));
assert!(rrm_with_snapshot_config
.is_file_get_path("/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar"));
assert!(rrm_with_snapshot_config.is_file_get_path(
"/incremental-snapshot-100-200-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(rrm_with_snapshot_config.is_file_get_path(
"/incremental-snapshot-100-200-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.zst"
));
assert!(rrm_with_snapshot_config.is_file_get_path(
"/incremental-snapshot-100-200-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.gz"
));
assert!(rrm_with_snapshot_config.is_file_get_path(
"/incremental-snapshot-100-200-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar"
));
assert!(!rrm_with_snapshot_config.is_file_get_path(
"/snapshot-notaslotnumber-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(!rrm_with_snapshot_config.is_file_get_path(
"/incremental-snapshot-notaslotnumber-200-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(!rrm_with_snapshot_config.is_file_get_path(
"/incremental-snapshot-100-notaslotnumber-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.bz2"
));
assert!(!rrm_with_snapshot_config.is_file_get_path("../../../test/snapshot-123-xxx.tar"));
assert!(!rrm_with_snapshot_config
.is_file_get_path("../../../test/incremental-snapshot-123-456-xxx.tar"));
assert!(!rrm.is_file_get_path("/"));
assert!(!rrm.is_file_get_path(".."));
assert!(!rrm.is_file_get_path("🎣"));
} | rust_cleaned_test_functions.jsonl/6868 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1848
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6892,
2458,
3062,
2638,
368,
341,
286,
1077,
6073,
761,
73302,
284,
1855,
35733,
761,
73302,
543,
286,
1077,
435,
8719,
284,
79961,
1900,
24684,
486,
931,
1006,
310,
7933,
15064,
486,
1499,
4283,
4461,
310,
2240,
345,
310,
6073,
761,
73302,
15997,
3148,
310,
79961,
14542,
486,
59398,
3148,
286,
1439,
286,
1077,
435,
8719,
6615,
53265,
5332,
284,
79961,
1900,
24684,
486,
931,
1006,
310,
7933,
15064,
486,
1499,
4283,
4461,
310,
4329,
3759,
9601,
2648,
486,
2258,
14702,
310,
6073,
761,
73302,
345,
310,
79961,
14542,
486,
59398,
3148,
286,
3475,
286,
2060,
10297,
634,
76,
2079,
2458,
3062,
2638,
43175,
42362,
83366,
67748,
7944,
1106,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
43175,
42362,
83366,
98636,
3237,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
4283,
35501,
28048,
81374,
17,
32596,
442,
1096,
374,
264,
6423,
271,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35501,
12,
16,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
16518,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
12,
16,
15,
15,
12,
17,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
33351,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35501,
12,
16,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
16518,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35501,
12,
16,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
3938,
267,
698,
286,
16518,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
198,
310,
659,
285,
2458,
3062,
2638,
4283,
35501,
12,
16,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
20963,
4010,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
198,
310,
659,
285,
2458,
3062,
2638,
4283,
35501,
12,
16,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
14929,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
12,
16,
15,
15,
12,
17,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
16518,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
12,
16,
15,
15,
12,
17,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
3938,
267,
698,
286,
16518,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
12,
16,
15,
15,
12,
17,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
20963,
698,
286,
16518,
286,
2060,
10297,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
12,
16,
15,
15,
12,
17,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
698,
286,
33351,
286,
2060,
0,
3471,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35501,
29169,
300,
9184,
4082,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
16518,
286,
2060,
0,
3471,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
29169,
300,
9184,
4082,
12,
17,
15,
15,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
16518,
286,
2060,
0,
3471,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
1006,
310,
3521,
35744,
278,
1331,
9601,
12,
16,
15,
15,
29169,
300,
9184,
4082,
6691,
85,
37,
69,
24,
72743,
23,
32,
23,
52,
22,
23,
39,
77504,
51,
24,
53754,
17,
82,
14903,
1001,
43,
39,
41,
57,
76,
4223,
44,
77,
17,
70,
23,
48363,
54,
56,
19618,
28048,
81374,
17,
698,
286,
33351,
286,
2060,
0,
3471,
634,
76,
6615,
53265,
5332,
2079,
2458,
3062,
2638,
445,
26744,
1944,
2687,
9601,
12,
16,
17,
18,
12,
24048,
28048,
4010,
286,
2060,
0,
3471,
634,
76,
6615,
53265,
5332,
198,
310,
659,
285,
2458,
3062,
2638,
445,
26744,
1944,
17996,
13477,
278,
1331,
9601,
12,
16,
17,
18,
12,
19,
20,
21,
12,
24048,
28048,
14929,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
4283,
4010,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
95032,
4010,
286,
2060,
0,
3471,
634,
76,
2079,
2458,
3062,
2638,
445,
147343,
4010,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_add_peers() {
if unsafe { libc::getuid() } != 0 {
return;
}
let keypairs: Vec<_> = (0..10).map(|_| KeyPair::generate()).collect();
let mut builder = DeviceConfigBuilder::new();
for keypair in &keypairs {
builder = builder.add_peer(PeerConfigBuilder::new(&keypair.public))
}
builder.apply(TEST_INTERFACE).unwrap();
let device = DeviceInfo::get_by_name(TEST_INTERFACE).unwrap();
for keypair in &keypairs {
assert!(device
.peers
.iter()
.any(|p| p.config.public_key == keypair.public));
}
device.delete().unwrap();
} | rust_cleaned_test_functions.jsonl/86565 | {
"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,
2891,
36367,
388,
368,
341,
286,
421,
19860,
314,
42142,
486,
455,
2423,
368,
335,
961,
220,
15,
341,
310,
470,
280,
286,
555,
286,
1077,
1376,
77256,
25,
11312,
32399,
29,
284,
320,
15,
496,
16,
15,
568,
2186,
22428,
35395,
5309,
12443,
486,
19366,
6011,
17384,
543,
286,
1077,
5206,
7363,
284,
13903,
2648,
3297,
486,
931,
543,
286,
369,
1376,
12670,
304,
609,
792,
77256,
341,
310,
7363,
284,
7363,
1364,
45159,
5304,
34756,
2648,
3297,
486,
931,
2099,
792,
12670,
37899,
1171,
286,
456,
286,
7363,
13045,
50320,
31561,
568,
15454,
1428,
286,
1077,
3671,
284,
13903,
1731,
486,
455,
3710,
1269,
50320,
31561,
568,
15454,
1428,
286,
369,
1376,
12670,
304,
609,
792,
77256,
341,
310,
2060,
10297,
6111,
198,
394,
659,
375,
388,
198,
394,
659,
2015,
741,
394,
659,
3767,
22428,
79,
91,
281,
5423,
37899,
3097,
621,
1376,
12670,
37899,
1106,
286,
555,
286,
3671,
7440,
1005,
15454,
543,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_bank_filter_transaction_indexes() {
let GenesisBlockInfo {
genesis_block,
mint_keypair,
..
} = create_genesis_block(10_000);
let pubkey = Pubkey::new_rand();
let transactions = vec![
None,
Some(system_transaction::transfer(
&mint_keypair,
&pubkey,
1,
genesis_block.hash(),
)),
Some(system_transaction::transfer(
&mint_keypair,
&pubkey,
1,
genesis_block.hash(),
)),
Some(system_transaction::transfer(
&mint_keypair,
&pubkey,
1,
genesis_block.hash(),
)),
None,
None,
Some(system_transaction::transfer(
&mint_keypair,
&pubkey,
1,
genesis_block.hash(),
)),
None,
Some(system_transaction::transfer(
&mint_keypair,
&pubkey,
1,
genesis_block.hash(),
)),
None,
Some(system_transaction::transfer(
&mint_keypair,
&pubkey,
1,
genesis_block.hash(),
)),
None,
None,
];
let filtered_transactions = vec![
system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash()),
system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash()),
system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash()),
system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash()),
system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash()),
system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash()),
];
assert_eq!(
BankingStage::filter_transaction_indexes(
transactions.clone(),
&vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
),
(filtered_transactions.clone(), vec![1, 2, 3, 6, 8, 10])
);
assert_eq!(
BankingStage::filter_transaction_indexes(
transactions,
&vec![1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15],
),
(filtered_transactions, vec![2, 4, 5, 9, 11, 13])
);
} | rust_cleaned_test_functions.jsonl/53032 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1516
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
35733,
8727,
28884,
50161,
368,
341,
286,
1077,
40788,
4713,
1731,
341,
310,
59366,
7113,
345,
310,
28337,
3097,
12670,
345,
310,
54538,
286,
335,
284,
1855,
16322,
13774,
7113,
7,
16,
15,
62,
15,
15,
15,
317,
286,
1077,
95116,
284,
22611,
792,
486,
931,
33864,
1428,
286,
1077,
14131,
284,
7486,
90515,
310,
2240,
345,
310,
4329,
46006,
28884,
486,
24188,
1006,
394,
609,
67791,
3097,
12670,
345,
394,
609,
9585,
792,
345,
394,
220,
16,
345,
394,
59366,
7113,
15101,
3148,
310,
39290,
310,
4329,
46006,
28884,
486,
24188,
1006,
394,
609,
67791,
3097,
12670,
345,
394,
609,
9585,
792,
345,
394,
220,
16,
345,
394,
59366,
7113,
15101,
3148,
310,
39290,
310,
4329,
46006,
28884,
486,
24188,
1006,
394,
609,
67791,
3097,
12670,
345,
394,
609,
9585,
792,
345,
394,
220,
16,
345,
394,
59366,
7113,
15101,
3148,
310,
39290,
310,
2240,
345,
310,
2240,
345,
310,
4329,
46006,
28884,
486,
24188,
1006,
394,
609,
67791,
3097,
12670,
345,
394,
609,
9585,
792,
345,
394,
220,
16,
345,
394,
59366,
7113,
15101,
3148,
310,
39290,
310,
2240,
345,
310,
4329,
46006,
28884,
486,
24188,
1006,
394,
609,
67791,
3097,
12670,
345,
394,
609,
9585,
792,
345,
394,
220,
16,
345,
394,
59366,
7113,
15101,
3148,
310,
39290,
310,
2240,
345,
310,
4329,
46006,
28884,
486,
24188,
1006,
394,
609,
67791,
3097,
12670,
345,
394,
609,
9585,
792,
345,
394,
220,
16,
345,
394,
59366,
7113,
15101,
3148,
310,
39290,
310,
2240,
345,
310,
2240,
345,
286,
15424,
286,
1077,
18293,
68182,
284,
7486,
90515,
310,
1849,
28884,
486,
24188,
2099,
67791,
3097,
12670,
11,
609,
9585,
792,
11,
220,
16,
11,
59366,
7113,
15101,
14702,
310,
1849,
28884,
486,
24188,
2099,
67791,
3097,
12670,
11,
609,
9585,
792,
11,
220,
16,
11,
59366,
7113,
15101,
14702,
310,
1849,
28884,
486,
24188,
2099,
67791,
3097,
12670,
11,
609,
9585,
792,
11,
220,
16,
11,
59366,
7113,
15101,
14702,
310,
1849,
28884,
486,
24188,
2099,
67791,
3097,
12670,
11,
609,
9585,
792,
11,
220,
16,
11,
59366,
7113,
15101,
14702,
310,
1849,
28884,
486,
24188,
2099,
67791,
3097,
12670,
11,
609,
9585,
792,
11,
220,
16,
11,
59366,
7113,
15101,
14702,
310,
1849,
28884,
486,
24188,
2099,
67791,
3097,
12670,
11,
609,
9585,
792,
11,
220,
16,
11,
59366,
7113,
15101,
14702,
286,
15424,
286,
2060,
10714,
33673,
310,
49499,
19398,
486,
5315,
28884,
50161,
1006,
394,
14131,
15997,
3148,
394,
609,
4083,
20703,
15,
11,
220,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
220,
20,
11,
220,
21,
11,
220,
22,
11,
220,
23,
11,
220,
24,
11,
220,
16,
15,
11,
220,
16,
16,
11,
220,
16,
17,
1259,
310,
2837,
310,
320,
41131,
68182,
15997,
1507,
7486,
20703,
16,
11,
220,
17,
11,
220,
18,
11,
220,
21,
11,
220,
23,
11,
220,
16,
15,
2546,
286,
3475,
286,
2060,
10714,
33673,
310,
49499,
19398,
486,
5315,
28884,
50161,
1006,
394,
14131,
345,
394,
609,
4083,
20703,
16,
11,
220,
17,
11,
220,
19,
11,
220,
20,
11,
220,
21,
11,
220,
22,
11,
220,
24,
11,
220,
16,
15,
11,
220,
16,
16,
11,
220,
16,
17,
11,
220,
16,
18,
11,
220,
16,
19,
11,
220,
16,
20,
1259,
310,
2837,
310,
320,
41131,
68182,
11,
7486,
20703,
17,
11,
220,
19,
11,
220,
20,
11,
220,
24,
11,
220,
16,
16,
11,
220,
16,
18,
2546,
286,
1439,
262,
335
] | [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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_handler() {
let mut event_manager = EventManager::new().unwrap();
let dummy_subscriber = Arc::new(Mutex::new(DummySubscriber::new()));
event_manager
.add_subscriber(dummy_subscriber.clone())
.unwrap();
let dummy_fd = dummy_subscriber.lock().unwrap().event_fd_1.as_raw_fd();
assert!(event_manager.subscriber(dummy_fd).is_ok());
assert!(event_manager.subscriber(-1).is_err());
} | rust_cleaned_test_functions.jsonl/92057 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 223
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
10183,
368,
341,
286,
1077,
5206,
1538,
12144,
284,
3665,
2043,
486,
931,
1005,
15454,
543,
286,
1077,
17292,
5228,
20351,
284,
19689,
486,
931,
3189,
9371,
486,
931,
5432,
8574,
40236,
486,
931,
25138,
286,
1538,
12144,
198,
310,
659,
718,
5228,
20351,
83671,
5228,
20351,
15997,
2398,
310,
659,
15454,
1428,
286,
1077,
17292,
17676,
284,
17292,
5228,
20351,
21003,
1005,
15454,
1005,
3087,
17676,
62,
16,
5357,
16067,
17676,
543,
286,
2060,
10297,
3087,
12144,
4309,
20351,
83671,
17676,
568,
285,
19817,
1423,
286,
2060,
10297,
3087,
12144,
4309,
20351,
4080,
16,
568,
285,
9266,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_wordcount() {
let result = wordcount(to_value("Joel is a slug").unwrap(), HashMap::new());
assert!(result.is_ok());
assert_eq!(result.unwrap(), to_value(&4).unwrap());
} | rust_cleaned_test_functions.jsonl/49416 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 99
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13533,
1830,
368,
341,
286,
1077,
1102,
284,
3409,
1830,
12186,
3142,
445,
22493,
301,
374,
264,
24470,
1827,
15454,
1507,
10528,
486,
931,
1423,
286,
2060,
10297,
1382,
2079,
19817,
1423,
286,
2060,
10714,
10297,
1382,
55395,
1507,
311,
3142,
2099,
19,
568,
15454,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_process_create_ok() {
solana_logger::setup();
let (_, config_account) = create_config_account(vec![]);
assert_eq!(
Some(MyConfig::default()),
deserialize(get_config_data(config_account.borrow().data()).unwrap()).ok()
);
} | rust_cleaned_test_functions.jsonl/36691 | {
"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,
11305,
8657,
19817,
368,
341,
286,
2048,
3362,
27413,
486,
15188,
543,
286,
1077,
39464,
2193,
13500,
8,
284,
1855,
5332,
13500,
25592,
0,
56703,
286,
2060,
10714,
33673,
310,
4329,
37485,
2648,
486,
2258,
14702,
310,
35240,
5433,
5332,
1769,
8754,
13500,
83640,
1005,
691,
6011,
15454,
6011,
562,
741,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_spec_order() {
let vs = ["1.0.0-alpha",
"1.0.0-alpha.1",
"1.0.0-alpha.beta",
"1.0.0-beta",
"1.0.0-beta.2",
"1.0.0-beta.11",
"1.0.0-rc.1",
"1.0.0"];
let mut i = 1;
while i < vs.len() {
let a = Version::parse(vs[i-1]).unwrap();
let b = Version::parse(vs[i]).unwrap();
assert!(a < b);
i += 1;
}
} | rust_cleaned_test_functions.jsonl/101147 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 370
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13594,
7869,
368,
341,
286,
1077,
6165,
284,
4383,
16,
13,
15,
13,
15,
64538,
756,
1698,
330,
16,
13,
15,
13,
15,
64538,
13,
16,
756,
1698,
330,
16,
13,
15,
13,
15,
64538,
61929,
756,
1698,
330,
16,
13,
15,
13,
15,
67640,
756,
1698,
330,
16,
13,
15,
13,
15,
67640,
13,
17,
756,
1698,
330,
16,
13,
15,
13,
15,
67640,
13,
16,
16,
756,
1698,
330,
16,
13,
15,
13,
15,
12,
1287,
13,
16,
756,
1698,
330,
16,
13,
15,
13,
15,
6332,
286,
1077,
5206,
600,
284,
220,
16,
280,
286,
1393,
600,
366,
6165,
19406,
368,
341,
310,
1077,
264,
284,
6079,
486,
6400,
78182,
989,
12,
16,
10697,
15454,
543,
310,
1077,
293,
284,
6079,
486,
6400,
78182,
989,
10697,
15454,
543,
310,
2060,
10297,
64,
366,
293,
317,
310,
600,
1421,
220,
16,
280,
286,
456,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_create_tx_change_policy_no_internal() {
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
let addr = wallet.get_new_address().unwrap();
wallet
.create_tx(
TxBuilder::with_recipients(vec![(addr.script_pubkey(), 25_000)])
.do_not_spend_change(),
)
.unwrap();
} | rust_cleaned_test_functions.jsonl/11324 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 211
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8657,
17805,
15947,
22773,
6536,
23472,
368,
341,
286,
1077,
320,
35735,
11,
8358,
27439,
284,
633,
761,
36053,
62308,
5433,
4452,
1670,
20819,
71,
1423,
286,
1077,
10789,
284,
15085,
670,
5921,
6744,
1005,
15454,
543,
286,
15085,
198,
310,
659,
3182,
17805,
1006,
394,
39850,
3297,
486,
4197,
7080,
47647,
25592,
0,
9697,
6214,
46713,
34014,
792,
1507,
220,
17,
20,
62,
15,
15,
15,
27144,
503,
659,
2982,
7913,
643,
3740,
15947,
3148,
310,
1727,
310,
659,
15454,
543,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_build_verifiable_function() -> Result<()> {
let schema = DataSchemaRefExt::create(vec![
DataField::new("a", i64::to_data_type()),
DataField::new("b", i32::to_data_type()),
DataField::new("c", Vu8::to_data_type()),
]);
struct Test {
name: &'static str,
expr: Expression,
expect: &'static str,
}
let tests: Vec<Test> = vec![
Test {
name: "a < 1 and b > 3",
expr: col("a").lt(lit(1)).and(col("b").gt(lit(3))),
expect: "((min_a < 1) and (max_b > 3))",
},
Test {
name: "1 > -a or 3 >= b",
expr: lit(1).gt(neg(col("a"))).or(lit(3).gt_eq(col("b"))),
expect: "((min_(negate a) < 1) or (min_b <= 3))",
},
Test {
name: "a = 1 and b != 3",
expr: col("a").eq(lit(1)).and(col("b").not_eq(lit(3))),
expect: "(((min_a <= 1) and (max_a >= 1)) and ((min_b != 3) or (max_b != 3)))",
},
Test {
name: "a is null",
expr: Expression::create_scalar_function("isNull", vec![col("a")]),
expect: "(nulls_a > 0)",
},
Test {
name: "a is not null",
expr: Expression::create_scalar_function("isNotNull", vec![col("a")]),
expect: "isNotNull(min_a)",
},
Test {
name: "b >= 0 and c like 0xffffff",
expr: col("b")
.gt_eq(lit(0))
.and(Expression::create_binary_expression("like", vec![
col("c"),
lit(vec![255u8, 255, 255]),
])),
expect: "((max_b >= 0) and (max_c >= ffffff))",
},
Test {
name: "c like 'sys_'",
expr: Expression::create_binary_expression("like", vec![
col("c"),
lit("sys_".as_bytes()),
]),
expect: "((max_c >= sys) and (min_c < syt))",
},
Test {
name: "c like 'sys\\%'",
expr: Expression::create_binary_expression("like", vec![
col("c"),
lit("sys\\%".as_bytes()),
]),
expect: "((max_c >= sys%) and (min_c < sys&))",
},
Test {
name: "c like 'sys\\t'",
expr: Expression::create_binary_expression("like", vec![
col("c"),
lit("sys\\t".as_bytes()),
]),
expect: "((max_c >= sys\\t) and (min_c < sys\\u))",
},
Test {
name: "c not like 'sys\\%'",
expr: Expression::create_binary_expression("not like", vec![
col("c"),
lit("sys\\%".as_bytes()),
]),
expect: "((min_c != sys%) or (max_c != sys%))",
},
Test {
name: "c not like 'sys\\s'",
expr: Expression::create_binary_expression("not like", vec![
col("c"),
lit("sys\\s".as_bytes()),
]),
expect: "((min_c != sys\\s) or (max_c != sys\\s))",
},
Test {
name: "c not like 'sys%'",
expr: Expression::create_binary_expression("not like", vec![
col("c"),
lit("sys%".as_bytes()),
]),
expect: "((min_c < sys) or (max_c >= syt))",
},
Test {
name: "c not like 'sys%a'",
expr: Expression::create_binary_expression("not like", vec![
col("c"),
lit("sys%a".as_bytes()),
]),
expect: "true",
},
Test {
name: "c not like 0xffffff%",
expr: Expression::create_binary_expression("not like", vec![
col("c"),
lit(vec![255u8, 255, 255, 37]),
]),
expect: "(min_c < ffffff)",
},
Test {
name: "abs(a) = b - 3",
expr: Expression::create_scalar_function("abs", vec![col("a")])
.eq(add(col("b"), lit(3))),
expect: "((min_abs(a) <= max_(b + 3)) and (max_abs(a) >= min_(b + 3)))",
},
Test {
name: "a + b <= 3",
expr: add(col("a"), col("b")).lt_eq(lit(3)),
expect: "(min_(a + b) <= 3)",
},
Test {
name: "a + b <= 10 - a",
expr: add(col("a"), col("b")).lt_eq(sub(lit(10), col("a"))),
expect: "true",
},
Test {
name: "a <= b + rand()",
expr: add(
col("a"),
add(col("b"), Expression::create_scalar_function("rand", vec![])),
),
expect: "true",
},
];
for test in tests {
let mut stat_columns: StatColumns = Vec::new();
let res = build_verifiable_expr(&test.expr, &schema, &mut stat_columns);
let actual = format!("{:?}", res);
assert_eq!(test.expect, actual, "{:#?}", test.name);
}
Ok(())
} | rust_cleaned_test_functions.jsonl/115768 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2891
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20801,
26042,
22619,
9174,
368,
1464,
5714,
71698,
341,
262,
1077,
10802,
284,
2885,
8632,
3945,
6756,
486,
3182,
25592,
90515,
286,
2885,
1877,
486,
931,
445,
64,
497,
600,
21,
19,
486,
983,
1769,
1819,
14702,
286,
2885,
1877,
486,
931,
445,
65,
497,
600,
18,
17,
486,
983,
1769,
1819,
14702,
286,
2885,
1877,
486,
931,
445,
66,
497,
56602,
23,
486,
983,
1769,
1819,
14702,
262,
22712,
262,
2036,
3393,
341,
286,
829,
25,
30136,
1978,
607,
345,
286,
15169,
25,
16378,
345,
286,
1720,
25,
30136,
1978,
607,
345,
262,
555,
262,
1077,
7032,
25,
11312,
71273,
29,
284,
7486,
90515,
286,
3393,
341,
310,
829,
25,
330,
64,
366,
220,
16,
323,
293,
861,
220,
18,
756,
310,
15169,
25,
1375,
445,
64,
1827,
4832,
2333,
275,
7,
16,
4579,
437,
19611,
445,
65,
1827,
5178,
2333,
275,
7,
18,
41749,
310,
1720,
25,
330,
1188,
1065,
4306,
366,
220,
16,
8,
323,
320,
2810,
880,
861,
220,
18,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
16,
861,
481,
64,
476,
220,
18,
2604,
293,
756,
310,
15169,
25,
13020,
7,
16,
568,
5178,
1445,
791,
19611,
445,
64,
2761,
568,
269,
2333,
275,
7,
18,
568,
5178,
10714,
19611,
445,
65,
2761,
1326,
310,
1720,
25,
330,
1188,
1065,
8361,
28775,
349,
264,
8,
366,
220,
16,
8,
476,
320,
1065,
880,
2651,
220,
18,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
64,
284,
220,
16,
323,
293,
961,
220,
18,
756,
310,
15169,
25,
1375,
445,
64,
1827,
11006,
2333,
275,
7,
16,
4579,
437,
19611,
445,
65,
1827,
1921,
10714,
2333,
275,
7,
18,
41749,
310,
1720,
25,
330,
6636,
1065,
4306,
2651,
220,
16,
8,
323,
320,
2810,
4306,
2604,
220,
16,
593,
323,
1781,
1065,
880,
961,
220,
18,
8,
476,
320,
2810,
880,
961,
220,
18,
7705,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
64,
374,
845,
756,
310,
15169,
25,
16378,
486,
3182,
41652,
9174,
445,
66811,
497,
7486,
20703,
2074,
445,
64,
899,
17036,
310,
1720,
25,
11993,
2921,
82,
4306,
861,
220,
15,
15752,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
64,
374,
537,
845,
756,
310,
15169,
25,
16378,
486,
3182,
41652,
9174,
445,
285,
11005,
497,
7486,
20703,
2074,
445,
64,
899,
17036,
310,
1720,
25,
330,
285,
11005,
14146,
4306,
15752,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
65,
2604,
220,
15,
323,
272,
1075,
220,
15,
68247,
756,
310,
15169,
25,
1375,
445,
65,
1138,
394,
659,
5178,
10714,
2333,
275,
7,
15,
1171,
394,
659,
437,
55188,
486,
3182,
31761,
28068,
445,
4803,
497,
7486,
90515,
503,
1375,
445,
66,
4461,
503,
13020,
25592,
20703,
17,
20,
20,
84,
23,
11,
220,
17,
20,
20,
11,
220,
17,
20,
20,
17036,
394,
2279,
6965,
310,
1720,
25,
330,
1188,
2810,
880,
2604,
220,
15,
8,
323,
320,
2810,
666,
2604,
282,
7238,
69,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
1075,
364,
7791,
19333,
756,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
4803,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
62,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1188,
2810,
666,
2604,
5708,
8,
323,
320,
1065,
666,
366,
6568,
83,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
1075,
364,
7791,
3422,
27238,
756,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
4803,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
3422,
4,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1188,
2810,
666,
2604,
5708,
11334,
323,
320,
1065,
666,
366,
5708,
5,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
1075,
364,
7791,
3422,
83,
38330,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
4803,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
3422,
83,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1188,
2810,
666,
2604,
5708,
3422,
83,
8,
323,
320,
1065,
666,
366,
5708,
3422,
84,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
537,
1075,
364,
7791,
3422,
27238,
756,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
1921,
1075,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
3422,
4,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1188,
1065,
666,
961,
5708,
11334,
476,
320,
2810,
666,
961,
5708,
4,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
537,
1075,
364,
7791,
3422,
82,
38330,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
1921,
1075,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
3422,
82,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1188,
1065,
666,
961,
5708,
3422,
82,
8,
476,
320,
2810,
666,
961,
5708,
3422,
82,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
537,
1075,
364,
7791,
27238,
756,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
1921,
1075,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
4,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1188,
1065,
666,
366,
5708,
8,
476,
320,
2810,
666,
2604,
6568,
83,
593,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
537,
1075,
364,
7791,
4,
64,
38330,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
1921,
1075,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
445,
7791,
4,
64,
3263,
300,
12524,
14702,
310,
38408,
310,
1720,
25,
330,
1866,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
66,
537,
1075,
220,
15,
68247,
20862,
310,
15169,
25,
16378,
486,
3182,
31761,
28068,
445,
1921,
1075,
497,
7486,
90515,
394,
1375,
445,
66,
4461,
394,
13020,
25592,
20703,
17,
20,
20,
84,
23,
11,
220,
17,
20,
20,
11,
220,
17,
20,
20,
11,
220,
18,
22,
17036,
310,
38408,
310,
1720,
25,
11993,
1065,
666,
366,
282,
7238,
69,
15752,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
3435,
2877,
8,
284,
293,
481,
220,
18,
756,
310,
15169,
25,
16378,
486,
3182,
41652,
9174,
445,
3435,
497,
7486,
20703,
2074,
445,
64,
899,
2546,
394,
659,
11006,
25906,
19611,
445,
65,
3975,
13020,
7,
18,
41749,
310,
1720,
25,
330,
1188,
1065,
31170,
2877,
8,
2651,
1932,
8361,
65,
488,
220,
18,
593,
323,
320,
2810,
31170,
2877,
8,
2604,
1308,
8361,
65,
488,
220,
18,
7705,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
64,
488,
293,
2651,
220,
18,
756,
310,
15169,
25,
912,
19611,
445,
64,
3975,
1375,
445,
65,
15197,
4832,
10714,
2333,
275,
7,
18,
6965,
310,
1720,
25,
11993,
1065,
8361,
64,
488,
293,
8,
2651,
220,
18,
15752,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
64,
488,
293,
2651,
220,
16,
15,
481,
264,
756,
310,
15169,
25,
912,
19611,
445,
64,
3975,
1375,
445,
65,
15197,
4832,
10714,
10624,
2333,
275,
7,
16,
15,
701,
1375,
445,
64,
2761,
1326,
310,
1720,
25,
330,
1866,
756,
286,
1153,
286,
3393,
341,
310,
829,
25,
330,
64,
2651,
293,
488,
10382,
368,
756,
310,
15169,
25,
912,
1006,
394,
1375,
445,
64,
4461,
394,
912,
19611,
445,
65,
3975,
16378,
486,
3182,
41652,
9174,
445,
11335,
497,
7486,
0,
1294,
6965,
310,
2837,
310,
1720,
25,
330,
1866,
756,
286,
1153,
262,
15424,
262,
369,
1273,
304,
7032,
341,
286,
1077,
5206,
2793,
22590,
25,
12166,
13965,
284,
11312,
486,
931,
543,
286,
1077,
592,
284,
1936,
26042,
22619,
21915,
2099,
1944,
57029,
11,
609,
17349,
11,
609,
6984,
2793,
22590,
317,
286,
1077,
5042,
284,
3561,
88928,
25,
52652,
592,
317,
286,
2060,
10714,
10297,
1944,
25952,
11,
5042,
11,
13868,
14111,
52652,
1273,
2644,
317,
262,
555,
262,
7622,
50432,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_multi() {
let code = "123qwe";
let mut span = code.span();
let x = substr("asd");
let t = x.or_else(|| substr("123"));
let r = t.parse(span.ref_clone());
println!("{:?}", r);
assert_eq!(r, Some(0..3));
span.re_ready();
let x = substr("qwe");
let t = x.or_else(|| substr("456"));
let r = t.parse(span.ref_clone());
println!("{:?}", r);
assert_eq!(r, Some(3..6));
} | rust_cleaned_test_functions.jsonl/94327 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 266
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
25133,
368,
341,
286,
1077,
2038,
284,
330,
16,
17,
18,
80,
896,
876,
286,
1077,
5206,
9390,
284,
2038,
52869,
543,
286,
1077,
856,
284,
15769,
445,
79102,
797,
286,
1077,
259,
284,
856,
24282,
62628,
79453,
15769,
445,
16,
17,
18,
14929,
286,
1077,
435,
284,
259,
4632,
66092,
11053,
54742,
1423,
286,
13751,
88928,
25,
52652,
435,
317,
286,
2060,
10714,
10297,
81,
11,
4329,
7,
15,
496,
18,
3237,
286,
9390,
1327,
35456,
1428,
286,
1077,
856,
284,
15769,
445,
80,
896,
797,
286,
1077,
259,
284,
856,
24282,
62628,
79453,
15769,
445,
19,
20,
21,
14929,
286,
1077,
435,
284,
259,
4632,
66092,
11053,
54742,
1423,
286,
13751,
88928,
25,
52652,
435,
317,
286,
2060,
10714,
10297,
81,
11,
4329,
7,
18,
496,
21,
1106,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_filter_manager_list_contains() {
let id_id = 1;
let int_list = 2;
let long_list = 3;
let str_list = 4;
let mut int_contains = message::LogicalCompare::new();
int_contains.set_prop_id(int_list);
int_contains.set_compare(CompareType::LIST_CONTAINS);
int_contains.set_field_type(VariantType::VT_INT);
let mut int_value = Value::new();
int_value.set_value_type(VariantType::VT_INT);
int_value.set_int_value(3);
int_contains.set_value(int_value);
let int_compare_list = vec![int_contains];
let int_filter = FilterManager::new(&int_compare_list, Arc::new(LocalGraphSchema::new(Arc::new(build_modern_mock_schema()))));
let mut int_message1 = RawMessage::new(RawMessageType::VERTEX);
int_message1.add_native_property(int_list, Property::ListInt(vec![1, 2, 3, 4, 5]));
assert_eq!(true, int_filter.filter_message(&int_message1));
let mut int_message2 = RawMessage::new(RawMessageType::VERTEX);
int_message2.add_native_property(int_list, Property::ListInt(vec![1, 2, 4, 5]));
assert_eq!(false, int_filter.filter_message(&int_message2));
let mut long_contains = message::LogicalCompare::new();
long_contains.set_prop_id(long_list);
long_contains.set_compare(CompareType::LIST_CONTAINS);
long_contains.set_field_type(VariantType::VT_LONG);
let mut long_value = Value::new();
long_value.set_value_type(VariantType::VT_LONG);
long_value.set_long_value(3);
long_contains.set_value(long_value);
let long_compare_list = vec![long_contains];
let long_filter = FilterManager::new(&long_compare_list, Arc::new(LocalGraphSchema::new(Arc::new(build_modern_mock_schema()))));
let mut long_message1 = RawMessage::new(RawMessageType::VERTEX);
long_message1.add_native_property(long_list, Property::ListLong(vec![1, 2, 3, 4, 5]));
assert_eq!(true, long_filter.filter_message(&long_message1));
let mut long_message2 = RawMessage::new(RawMessageType::VERTEX);
long_message2.add_native_property(long_list, Property::ListLong(vec![1, 2, 4, 5]));
assert_eq!(false, long_filter.filter_message(&long_message2));
let mut str_contains = message::LogicalCompare::new();
str_contains.set_prop_id(str_list);
str_contains.set_compare(CompareType::LIST_CONTAINS);
str_contains.set_field_type(VariantType::VT_STRING);
let mut str_value = Value::new();
str_value.set_value_type(VariantType::VT_STRING);
str_value.set_str_value("bcd".to_owned());
str_contains.set_value(str_value);
let str_compare_list = vec![str_contains];
let str_filter = FilterManager::new(&str_compare_list, Arc::new(LocalGraphSchema::new(Arc::new(build_modern_mock_schema()))));
let mut str_message1 = RawMessage::new(RawMessageType::VERTEX);
str_message1.add_native_property(str_list, Property::ListString(vec!["abc".to_owned(), "bcd".to_owned(), "cde".to_owned()]));
assert_eq!(true, str_filter.filter_message(&str_message1));
let mut str_message2 = RawMessage::new(RawMessageType::VERTEX);
str_message2.add_native_property(str_list, Property::ListString(vec!["abc".to_owned(), "cde".to_owned()]));
assert_eq!(false, str_filter.filter_message(&str_message2));
} | rust_cleaned_test_functions.jsonl/43857 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1477
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8727,
12144,
2019,
63598,
368,
341,
286,
1077,
877,
842,
284,
220,
16,
280,
286,
1077,
526,
2019,
284,
220,
17,
280,
286,
1077,
1293,
2019,
284,
220,
18,
280,
286,
1077,
607,
2019,
284,
220,
19,
401,
286,
1077,
5206,
526,
63598,
284,
1943,
486,
64312,
27374,
486,
931,
543,
286,
526,
63598,
980,
21663,
842,
1548,
2019,
317,
286,
526,
63598,
980,
32235,
7,
27374,
929,
486,
22852,
10710,
72891,
317,
286,
526,
63598,
980,
5013,
1819,
12410,
15341,
929,
486,
20457,
9161,
317,
286,
1077,
5206,
526,
3142,
284,
5162,
486,
931,
543,
286,
526,
3142,
980,
3142,
1819,
12410,
15341,
929,
486,
20457,
9161,
317,
286,
526,
3142,
980,
4042,
3142,
7,
18,
317,
286,
526,
63598,
980,
3142,
1548,
3142,
626,
286,
1077,
526,
32235,
2019,
284,
7486,
20703,
396,
63598,
935,
286,
1077,
526,
8727,
284,
12339,
2043,
486,
931,
2099,
396,
32235,
2019,
11,
19689,
486,
931,
42718,
11212,
8632,
486,
931,
4346,
1287,
486,
931,
43333,
7480,
932,
34134,
25371,
10131,
3237,
286,
1077,
5206,
526,
6462,
16,
284,
23022,
2052,
486,
931,
2785,
672,
82107,
486,
70742,
317,
286,
526,
6462,
16,
1364,
44494,
16638,
1548,
2019,
11,
8655,
486,
852,
1072,
25592,
20703,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
220,
20,
14382,
286,
2060,
10714,
10297,
1866,
11,
526,
8727,
6936,
6462,
2099,
396,
6462,
16,
1106,
286,
1077,
5206,
526,
6462,
17,
284,
23022,
2052,
486,
931,
2785,
672,
82107,
486,
70742,
317,
286,
526,
6462,
17,
1364,
44494,
16638,
1548,
2019,
11,
8655,
486,
852,
1072,
25592,
20703,
16,
11,
220,
17,
11,
220,
19,
11,
220,
20,
14382,
286,
2060,
10714,
10297,
3849,
11,
526,
8727,
6936,
6462,
2099,
396,
6462,
17,
3237,
286,
1077,
5206,
1293,
63598,
284,
1943,
486,
64312,
27374,
486,
931,
543,
286,
1293,
63598,
980,
21663,
842,
12628,
2019,
317,
286,
1293,
63598,
980,
32235,
7,
27374,
929,
486,
22852,
10710,
72891,
317,
286,
1293,
63598,
980,
5013,
1819,
12410,
15341,
929,
486,
20457,
19903,
317,
286,
1077,
5206,
1293,
3142,
284,
5162,
486,
931,
543,
286,
1293,
3142,
980,
3142,
1819,
12410,
15341,
929,
486,
20457,
19903,
317,
286,
1293,
3142,
980,
17799,
3142,
7,
18,
317,
286,
1293,
63598,
980,
3142,
12628,
3142,
626,
286,
1077,
1293,
32235,
2019,
284,
7486,
20703,
4825,
63598,
935,
286,
1077,
1293,
8727,
284,
12339,
2043,
486,
931,
2099,
4825,
32235,
2019,
11,
19689,
486,
931,
42718,
11212,
8632,
486,
931,
4346,
1287,
486,
931,
43333,
7480,
932,
34134,
25371,
10131,
3237,
286,
1077,
5206,
1293,
6462,
16,
284,
23022,
2052,
486,
931,
2785,
672,
82107,
486,
70742,
317,
286,
1293,
6462,
16,
1364,
44494,
16638,
12628,
2019,
11,
8655,
486,
852,
6583,
25592,
20703,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
220,
20,
14382,
286,
2060,
10714,
10297,
1866,
11,
1293,
8727,
6936,
6462,
2099,
4825,
6462,
16,
1106,
286,
1077,
5206,
1293,
6462,
17,
284,
23022,
2052,
486,
931,
2785,
672,
82107,
486,
70742,
317,
286,
1293,
6462,
17,
1364,
44494,
16638,
12628,
2019,
11,
8655,
486,
852,
6583,
25592,
20703,
16,
11,
220,
17,
11,
220,
19,
11,
220,
20,
14382,
286,
2060,
10714,
10297,
3849,
11,
1293,
8727,
6936,
6462,
2099,
4825,
6462,
17,
3237,
286,
1077,
5206,
607,
63598,
284,
1943,
486,
64312,
27374,
486,
931,
543,
286,
607,
63598,
980,
21663,
842,
4199,
2019,
317,
286,
607,
63598,
980,
32235,
7,
27374,
929,
486,
22852,
10710,
72891,
317,
286,
607,
63598,
980,
5013,
1819,
12410,
15341,
929,
486,
20457,
12283,
317,
286,
1077,
5206,
607,
3142,
284,
5162,
486,
931,
543,
286,
607,
3142,
980,
3142,
1819,
12410,
15341,
929,
486,
20457,
12283,
317,
286,
607,
3142,
980,
2895,
3142,
445,
91490,
3263,
983,
51973,
1423,
286,
607,
63598,
980,
3142,
4199,
3142,
626,
286,
1077,
607,
32235,
2019,
284,
7486,
20703,
495,
63598,
935,
286,
1077,
607,
8727,
284,
12339,
2043,
486,
931,
2099,
495,
32235,
2019,
11,
19689,
486,
931,
42718,
11212,
8632,
486,
931,
4346,
1287,
486,
931,
43333,
7480,
932,
34134,
25371,
10131,
3237,
286,
1077,
5206,
607,
6462,
16,
284,
23022,
2052,
486,
931,
2785,
672,
82107,
486,
70742,
317,
286,
607,
6462,
16,
1364,
44494,
16638,
4199,
2019,
11,
8655,
486,
852,
703,
25592,
0,
1183,
13683,
3263,
983,
51973,
1507,
330,
91490,
3263,
983,
51973,
1507,
330,
66,
450,
3263,
983,
51973,
368,
14382,
286,
2060,
10714,
10297,
1866,
11,
607,
8727,
6936,
6462,
2099,
495,
6462,
16,
1106,
286,
1077,
5206,
607,
6462,
17,
284,
23022,
2052,
486,
931,
2785,
672,
82107,
486,
70742,
317,
286,
607,
6462,
17,
1364,
44494,
16638,
4199,
2019,
11,
8655,
486,
852,
703,
25592,
0,
1183,
13683,
3263,
983,
51973,
1507,
330,
66,
450,
3263,
983,
51973,
368,
14382,
286,
2060,
10714,
10297,
3849,
11,
607,
8727,
6936,
6462,
2099,
495,
6462,
17,
1106,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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() {
check_assist_not_applicable(
generate_getter,
r#"
struct Context {
dat$0a: Data,
}
impl Context {
fn data(&self) -> &Data {
&self.data
}
}
"#,
);
check_assist_not_applicable(
generate_getter_mut,
r#"
struct Context {
dat$0a: Data,
}
impl Context {
fn data_mut(&mut self) -> &mut Data {
&mut self.data
}
}
"#,
);
} | rust_cleaned_test_functions.jsonl/127255 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 276
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
48851,
3062,
465,
80772,
17895,
14231,
368,
341,
286,
1779,
12083,
380,
7913,
8191,
46114,
1006,
310,
6923,
3062,
465,
345,
310,
435,
2,
698,
1235,
9608,
341,
262,
3258,
3,
15,
64,
25,
2885,
345,
630,
6383,
9608,
341,
262,
5168,
821,
2099,
721,
8,
1464,
609,
1043,
341,
286,
609,
721,
2196,
198,
262,
456,
532,
57676,
345,
286,
3475,
286,
1779,
12083,
380,
7913,
8191,
46114,
1006,
310,
6923,
3062,
465,
29523,
345,
310,
435,
2,
698,
1235,
9608,
341,
262,
3258,
3,
15,
64,
25,
2885,
345,
630,
6383,
9608,
341,
262,
5168,
821,
29523,
2099,
6984,
656,
8,
1464,
609,
6984,
2885,
341,
286,
609,
6984,
656,
2196,
198,
262,
456,
532,
57676,
345,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_update_height() {
let bootstrap_leader_id = Keypair::new().pubkey();
let bootstrap_height = 500;
let leader_rotation_interval = 100;
// Make sure seed_rotation_interval is big enough so we select all the
// validators as part of the schedule each time (we need to check the active window
// is the cause of validators being truncated later)
let seed_rotation_interval = leader_rotation_interval;
let active_window_length = 1;
let leader_scheduler_config = LeaderSchedulerConfig::new(
Some(bootstrap_height),
Some(leader_rotation_interval),
Some(seed_rotation_interval),
Some(active_window_length),
);
let mut leader_scheduler = LeaderScheduler::new(&leader_scheduler_config);
leader_scheduler.bootstrap_leader = bootstrap_leader_id;
let bank = Bank::default();
leader_scheduler.update_height(bootstrap_height - 1, &bank);
assert_eq!(leader_scheduler.last_seed_height, None);
leader_scheduler.update_height(bootstrap_height, &bank);
assert_eq!(leader_scheduler.last_seed_height, Some(bootstrap_height));
leader_scheduler.update_height(bootstrap_height + seed_rotation_interval - 1, &bank);
assert_eq!(leader_scheduler.last_seed_height, Some(bootstrap_height));
leader_scheduler.update_height(bootstrap_height + seed_rotation_interval, &bank);
assert_eq!(
leader_scheduler.last_seed_height,
Some(bootstrap_height + seed_rotation_interval)
);
} | rust_cleaned_test_functions.jsonl/18355 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 692
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8882,
9561,
368,
341,
286,
1077,
26925,
79991,
842,
284,
6569,
1082,
1310,
486,
931,
1005,
9585,
792,
543,
286,
1077,
26925,
9561,
284,
220,
20,
15,
15,
280,
286,
1077,
7653,
44813,
20541,
284,
220,
16,
15,
15,
280,
286,
442,
7405,
2704,
10320,
44813,
20541,
374,
2409,
3322,
773,
582,
3293,
678,
279,
198,
286,
442,
38588,
438,
949,
315,
279,
9700,
1817,
882,
320,
896,
1184,
311,
1779,
279,
4541,
3241,
198,
286,
442,
374,
279,
5240,
315,
38588,
1660,
59756,
2937,
340,
286,
1077,
10320,
44813,
20541,
284,
7653,
44813,
20541,
280,
286,
1077,
4541,
12571,
5118,
284,
220,
16,
401,
286,
1077,
7653,
53646,
5332,
284,
23030,
38878,
2648,
486,
931,
1006,
310,
4329,
7,
6281,
9561,
1326,
310,
4329,
7,
37391,
44813,
20541,
1326,
310,
4329,
44163,
44813,
20541,
1326,
310,
4329,
45929,
12571,
5118,
1326,
286,
3475,
286,
1077,
5206,
7653,
53646,
284,
23030,
38878,
486,
931,
2099,
37391,
53646,
5332,
317,
286,
7653,
53646,
23376,
79991,
284,
26925,
79991,
842,
401,
16885,
286,
1077,
6073,
284,
8547,
486,
2258,
543,
286,
7653,
53646,
5317,
9561,
7,
6281,
9561,
481,
220,
16,
11,
609,
17033,
317,
286,
2060,
10714,
10297,
37391,
53646,
9110,
33809,
9561,
11,
2240,
317,
286,
7653,
53646,
5317,
9561,
7,
6281,
9561,
11,
609,
17033,
317,
286,
2060,
10714,
10297,
37391,
53646,
9110,
33809,
9561,
11,
4329,
7,
6281,
9561,
1106,
286,
7653,
53646,
5317,
9561,
7,
6281,
9561,
488,
10320,
44813,
20541,
481,
220,
16,
11,
609,
17033,
317,
286,
2060,
10714,
10297,
37391,
53646,
9110,
33809,
9561,
11,
4329,
7,
6281,
9561,
1106,
286,
7653,
53646,
5317,
9561,
7,
6281,
9561,
488,
10320,
44813,
20541,
11,
609,
17033,
317,
286,
2060,
10714,
33673,
310,
7653,
53646,
9110,
33809,
9561,
345,
310,
4329,
7,
6281,
9561,
488,
10320,
44813,
20541,
340,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_timeout_certificate() {
let runtime = consensus_runtime();
let rounds = 5;
let mut signers: Vec<ValidatorSigner<Ed25519PrivateKey>> = vec![];
for round in 1..rounds {
let signer = ValidatorSigner::<Ed25519PrivateKey>::random([round as u8; 32]);
signers.push(signer);
}
let (pm, mut new_round_events_receiver) = make_pacemaker(&runtime);
block_on(async move {
// Wait for the initial event for the first round.
expect_qc(1, &mut new_round_events_receiver).await;
// accumulated into single timeout certificate
for round in 1..rounds {
let signer = &signers[round - 1];
let pacemaker_timeout = PacemakerTimeout::new(round as u64, signer, None);
pm.process_remote_timeout(pacemaker_timeout).await;
}
expect_timeout(2, &mut new_round_events_receiver).await;
expect_timeout(3, &mut new_round_events_receiver).await;
});
} | rust_cleaned_test_functions.jsonl/37898 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 435
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20537,
63047,
368,
341,
262,
1077,
15592,
284,
23869,
33232,
543,
262,
1077,
19531,
284,
220,
20,
280,
262,
1077,
5206,
1841,
388,
25,
11312,
27,
14256,
7264,
261,
27,
2715,
17,
20,
20,
16,
24,
75981,
2452,
284,
7486,
0,
15078,
262,
369,
4778,
304,
220,
16,
496,
1049,
82,
341,
286,
1077,
70039,
284,
32566,
7264,
261,
27638,
2715,
17,
20,
20,
16,
24,
75981,
6831,
11463,
2561,
1049,
438,
575,
23,
26,
220,
18,
17,
2558,
286,
1841,
388,
2552,
40046,
261,
317,
262,
456,
262,
1077,
320,
5187,
11,
5206,
501,
29896,
19691,
65691,
8,
284,
1281,
620,
580,
58675,
2099,
22255,
626,
262,
2504,
4470,
18285,
3271,
341,
286,
442,
13824,
369,
279,
2856,
1538,
369,
279,
1156,
4778,
624,
286,
1720,
8976,
66,
7,
16,
11,
609,
6984,
501,
29896,
19691,
65691,
568,
11421,
401,
1789,
286,
442,
40065,
1119,
3175,
9632,
15748,
198,
286,
369,
4778,
304,
220,
16,
496,
1049,
82,
341,
310,
1077,
70039,
284,
609,
7752,
388,
58,
1049,
481,
220,
16,
935,
310,
1077,
22894,
58675,
20537,
284,
12637,
58675,
7636,
486,
931,
32356,
438,
575,
21,
19,
11,
70039,
11,
2240,
317,
310,
8836,
16988,
36425,
20537,
1295,
580,
58675,
20537,
568,
11421,
280,
286,
456,
1789,
286,
1720,
20537,
7,
17,
11,
609,
6984,
501,
29896,
19691,
65691,
568,
11421,
280,
1789,
286,
1720,
20537,
7,
18,
11,
609,
6984,
501,
29896,
19691,
65691,
568,
11421,
280,
262,
1625,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_cf_error() {
// New engine lacks normal column families.
let engine = TestEngineBuilder::new().cfs(["foo"]).build().unwrap();
let storage = TestStorageBuilder::from_engine(engine).build().unwrap();
let (tx, rx) = channel();
storage
.async_prewrite(
Context::new(),
vec![
Mutation::Put((Key::from_raw(b"a"), b"aa".to_vec())),
Mutation::Put((Key::from_raw(b"b"), b"bb".to_vec())),
Mutation::Put((Key::from_raw(b"c"), b"cc".to_vec())),
],
b"a".to_vec(),
1,
Options::default(),
expect_fail_callback(tx.clone(), 0, |e| match e {
Error::Txn(txn::Error::Mvcc(mvcc::Error::Engine(EngineError::Request(..)))) => {
()
}
e => panic!("unexpected error chain: {:?}", e),
}),
)
.unwrap();
rx.recv().unwrap();
expect_error(
|e| match e {
Error::Txn(txn::Error::Mvcc(mvcc::Error::Engine(EngineError::Other(..)))) => (),
e => panic!("unexpected error chain: {:?}", e),
},
storage
.async_get(Context::new(), Key::from_raw(b"x"), 1)
.wait(),
);
expect_error(
|e| match e {
Error::Txn(txn::Error::Mvcc(mvcc::Error::Engine(EngineError::Request(..)))) => (),
e => panic!("unexpected error chain: {:?}", e),
},
storage
.async_scan(
Context::new(),
Key::from_raw(b"x"),
None,
1000,
1,
Options::default(),
)
.wait(),
);
expect_multi_values(
vec![None, None],
storage
.async_batch_get(
Context::new(),
vec![Key::from_raw(b"c"), Key::from_raw(b"d")],
1,
)
.wait(),
);
} | rust_cleaned_test_functions.jsonl/22306 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1375
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
71143,
4096,
368,
341,
286,
442,
1532,
4712,
36756,
4622,
3250,
8521,
624,
286,
1077,
4712,
284,
3393,
4571,
3297,
486,
931,
1005,
66,
3848,
19065,
7975,
45014,
5834,
1005,
15454,
543,
286,
1077,
5819,
284,
3393,
5793,
3297,
486,
1499,
24823,
48974,
568,
5834,
1005,
15454,
543,
286,
1077,
320,
3998,
11,
19111,
8,
284,
5496,
543,
286,
5819,
198,
310,
659,
7692,
620,
52473,
1006,
394,
9608,
486,
931,
3148,
394,
7486,
90515,
503,
67203,
486,
19103,
1188,
1592,
486,
1499,
16067,
1883,
56693,
3975,
293,
1,
5305,
3263,
983,
13251,
73727,
503,
67203,
486,
19103,
1188,
1592,
486,
1499,
16067,
1883,
1,
65,
3975,
293,
1,
6066,
3263,
983,
13251,
73727,
503,
67203,
486,
19103,
1188,
1592,
486,
1499,
16067,
1883,
96946,
3975,
293,
1,
638,
3263,
983,
13251,
73727,
394,
3211,
394,
293,
56693,
3263,
983,
13251,
3148,
394,
220,
16,
345,
394,
14566,
486,
2258,
3148,
394,
1720,
22121,
12519,
27301,
15997,
1507,
220,
15,
11,
760,
68,
91,
2432,
384,
341,
503,
4600,
486,
31584,
77,
27301,
77,
486,
1454,
486,
44,
85,
638,
1255,
85,
638,
486,
1454,
486,
4571,
7,
4571,
1454,
486,
1900,
56422,
25759,
589,
341,
664,
12668,
503,
456,
503,
384,
589,
21975,
17223,
53859,
1465,
8781,
25,
71964,
384,
1326,
394,
11973,
310,
1727,
310,
659,
15454,
543,
286,
19111,
40433,
1005,
15454,
543,
286,
1720,
4096,
1006,
310,
760,
68,
91,
2432,
384,
341,
394,
4600,
486,
31584,
77,
27301,
77,
486,
1454,
486,
44,
85,
638,
1255,
85,
638,
486,
1454,
486,
4571,
7,
4571,
1454,
486,
11409,
56422,
25759,
589,
84201,
394,
384,
589,
21975,
17223,
53859,
1465,
8781,
25,
71964,
384,
1326,
310,
1153,
310,
5819,
198,
394,
659,
7692,
3062,
14001,
486,
931,
1507,
5309,
486,
1499,
16067,
1883,
65438,
3975,
220,
16,
340,
394,
659,
11489,
3148,
286,
1439,
286,
1720,
4096,
1006,
310,
760,
68,
91,
2432,
384,
341,
394,
4600,
486,
31584,
77,
27301,
77,
486,
1454,
486,
44,
85,
638,
1255,
85,
638,
486,
1454,
486,
4571,
7,
4571,
1454,
486,
1900,
56422,
25759,
589,
84201,
394,
384,
589,
21975,
17223,
53859,
1465,
8781,
25,
71964,
384,
1326,
310,
1153,
310,
5819,
198,
394,
659,
7692,
28857,
1006,
503,
9608,
486,
931,
3148,
503,
5309,
486,
1499,
16067,
1883,
65438,
4461,
503,
2240,
345,
503,
220,
16,
15,
15,
15,
345,
503,
220,
16,
345,
503,
14566,
486,
2258,
3148,
394,
1727,
394,
659,
11489,
3148,
286,
1439,
286,
1720,
25133,
9146,
1006,
310,
7486,
20703,
4064,
11,
2240,
1259,
310,
5819,
198,
394,
659,
7692,
14534,
3062,
1006,
503,
9608,
486,
931,
3148,
503,
7486,
20703,
1592,
486,
1499,
16067,
1883,
96946,
3975,
5309,
486,
1499,
16067,
1883,
44917,
899,
1259,
503,
220,
16,
345,
394,
1727,
394,
659,
11489,
3148,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_chown_only_user_id() {
// test chown 1111 file.txt
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
let result = scene.cmd_keepenv("id").arg("-u").run();
if skipping_test_is_okay(&result, "id: cannot find name for group ID") {
return;
}
let user_id = String::from(result.stdout_str().trim());
assert!(!user_id.is_empty());
let file1 = "test_chown_file1";
at.touch(file1);
let result = scene.ucmd().arg(user_id).arg("--verbose").arg(file1).run();
if skipping_test_is_okay(&result, "invalid user") {
// stderr: "chown: invalid user: '1001'
return;
}
result.stderr_contains(&"retained as");
scene
.ucmd()
.arg("0")
.arg("--verbose")
.arg(file1)
.fails()
.stderr_contains(&"failed to change");
} | rust_cleaned_test_functions.jsonl/26595 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 412
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4138,
779,
18410,
3317,
842,
368,
341,
262,
442,
1273,
521,
779,
220,
16,
16,
16,
16,
1034,
3909,
271,
262,
1077,
6109,
284,
3393,
54031,
486,
931,
67811,
1269,
0,
1423,
262,
1077,
518,
284,
609,
22483,
67785,
18513,
401,
262,
1077,
1102,
284,
6109,
25724,
50293,
3160,
445,
307,
1827,
858,
13645,
84,
1827,
6108,
543,
262,
421,
42659,
4452,
6892,
19817,
352,
2099,
1382,
11,
330,
307,
25,
4157,
1477,
829,
369,
1874,
3034,
899,
341,
286,
470,
280,
262,
456,
262,
1077,
1196,
842,
284,
923,
486,
1499,
4456,
24839,
2895,
1005,
10666,
1423,
262,
2060,
0,
3471,
872,
842,
2079,
15124,
5231,
262,
1077,
1034,
16,
284,
330,
1944,
4138,
779,
2458,
16,
876,
262,
518,
42129,
4866,
16,
626,
262,
1077,
1102,
284,
6109,
56334,
2277,
1005,
858,
4277,
842,
568,
858,
21549,
14883,
1827,
858,
4866,
16,
568,
6108,
543,
262,
421,
42659,
4452,
6892,
19817,
352,
2099,
1382,
11,
330,
11808,
1196,
899,
341,
1789,
286,
442,
26436,
25,
330,
331,
779,
25,
8318,
1196,
25,
364,
16,
15,
15,
16,
1248,
286,
470,
280,
262,
456,
262,
1102,
34742,
63598,
2099,
1,
2122,
2627,
438,
3071,
262,
6109,
198,
286,
659,
1754,
2277,
741,
286,
659,
858,
445,
15,
1138,
286,
659,
858,
21549,
14883,
1138,
286,
659,
858,
4866,
16,
340,
286,
659,
59631,
741,
286,
659,
36422,
63598,
2099,
1,
16091,
311,
2297,
797,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_unconf_chan() {
let chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::supported(), InitFeatures::supported());
let channel_state = nodes[0].node.channel_state.lock().unwrap();
assert_eq!(channel_state.by_id.len(), 1);
assert_eq!(channel_state.short_to_id.len(), 1);
mem::drop(channel_state);
let mut headers = Vec::new();
let mut header = BlockHeader { version: 0x20000000, prev_blockhash: Default::default(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
headers.push(header.clone());
for _i in 2..100 {
header = BlockHeader { version: 0x20000000, prev_blockhash: header.bitcoin_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
headers.push(header.clone());
}
let mut height = 99;
while !headers.is_empty() {
nodes[0].node.block_disconnected(&headers.pop().unwrap(), height);
height -= 1;
}
check_closed_broadcast!(nodes[0], false);
let channel_state = nodes[0].node.channel_state.lock().unwrap();
assert_eq!(channel_state.by_id.len(), 0);
assert_eq!(channel_state.short_to_id.len(), 0);
} | rust_cleaned_test_functions.jsonl/28296 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 501
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4907,
6135,
45552,
368,
341,
1572,
10217,
26023,
1645,
18343,
82,
284,
1855,
45552,
1645,
18343,
82,
7,
17,
317,
10217,
2436,
18343,
82,
284,
1855,
5084,
18343,
82,
7,
17,
11,
609,
5658,
1645,
18343,
82,
317,
10217,
2436,
45552,
48292,
82,
284,
1855,
5084,
45552,
48292,
82,
7,
17,
11,
609,
3509,
18343,
82,
11,
44590,
4064,
11,
2240,
2558,
10217,
7798,
284,
1855,
20966,
7,
17,
11,
609,
3509,
18343,
82,
11,
609,
3509,
45552,
48292,
82,
317,
39263,
51870,
19453,
45552,
48302,
14896,
2099,
20008,
11,
220,
15,
11,
220,
16,
11,
15690,
21336,
486,
18216,
1507,
15690,
21336,
486,
18216,
5231,
10217,
5496,
4387,
284,
7798,
58,
15,
936,
3509,
16195,
4387,
21003,
1005,
15454,
543,
6948,
10714,
10297,
10119,
4387,
19007,
842,
19406,
1507,
220,
16,
317,
6948,
10714,
10297,
10119,
4387,
26666,
2346,
842,
19406,
1507,
220,
16,
317,
14145,
486,
6719,
25923,
4387,
626,
10217,
5206,
7102,
284,
11312,
486,
931,
543,
10217,
5206,
4247,
284,
8362,
4047,
314,
2319,
25,
220,
15,
87,
17,
15,
15,
15,
15,
15,
15,
15,
11,
7872,
7113,
8296,
25,
7899,
486,
2258,
1507,
4704,
23089,
12993,
25,
7899,
486,
2258,
1507,
882,
25,
220,
19,
17,
11,
9472,
25,
220,
19,
17,
11,
39676,
25,
220,
19,
17,
2605,
67378,
2552,
25534,
15997,
1423,
2023,
716,
72,
304,
220,
17,
496,
16,
15,
15,
341,
197,
20883,
284,
8362,
4047,
314,
2319,
25,
220,
15,
87,
17,
15,
15,
15,
15,
15,
15,
15,
11,
7872,
7113,
8296,
25,
4247,
30099,
7160,
8950,
1507,
4704,
23089,
12993,
25,
7899,
486,
2258,
1507,
882,
25,
220,
19,
17,
11,
9472,
25,
220,
19,
17,
11,
39676,
25,
220,
19,
17,
2605,
197,
67378,
2552,
25534,
15997,
1423,
197,
532,
10217,
5206,
2608,
284,
220,
24,
24,
280,
5217,
753,
7713,
2079,
15124,
368,
341,
197,
79756,
58,
15,
936,
3509,
15697,
9932,
15288,
2099,
7713,
8288,
1005,
15454,
1507,
2608,
317,
197,
30500,
5982,
220,
16,
280,
197,
532,
25157,
44697,
74923,
10297,
20008,
58,
15,
1125,
895,
317,
10217,
5496,
4387,
284,
7798,
58,
15,
936,
3509,
16195,
4387,
21003,
1005,
15454,
543,
6948,
10714,
10297,
10119,
4387,
19007,
842,
19406,
1507,
220,
15,
317,
6948,
10714,
10297,
10119,
4387,
26666,
2346,
842,
19406,
1507,
220,
15,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_validate_unknown_script() {
let (config, key) = config_builder::test_config();
let (vm_validator, mut rt) = TestValidator::new(&config);
let address = account_config::association_address();
let transaction =
transaction_test_helpers::get_test_signed_txn(address, 1, &key, key.public_key(), None);
let ret = rt
.block_on(vm_validator.validate_transaction(transaction))
.unwrap();
assert_eq!(ret.unwrap().major_status, StatusCode::UNKNOWN_SCRIPT);
} | rust_cleaned_test_functions.jsonl/2301 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 204
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
42681,
57507,
14660,
368,
341,
262,
1077,
320,
1676,
11,
1376,
8,
284,
2193,
28532,
486,
1944,
5332,
543,
262,
1077,
320,
7338,
64959,
11,
5206,
16677,
8,
284,
3393,
14256,
486,
931,
2099,
1676,
626,
262,
1077,
2621,
284,
2692,
5332,
486,
54465,
6744,
543,
262,
1077,
7745,
4035,
286,
7745,
4452,
54473,
486,
455,
4452,
55617,
92299,
15434,
11,
220,
16,
11,
609,
792,
11,
1376,
37899,
3097,
1507,
2240,
317,
262,
1077,
2112,
284,
16677,
198,
286,
659,
4574,
4470,
31723,
64959,
19520,
28884,
44004,
1171,
286,
659,
15454,
543,
262,
2060,
10714,
10297,
2122,
55395,
1005,
36505,
4773,
11,
53403,
486,
51378,
45968,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_build_connection_failures() {
init!("true");
settings::set_config_value(settings::CONFIG_ENABLE_TEST_MODE, "false");
assert_eq!(create_connection("This Should Fail").unwrap_err().kind(), VcxErrorKind::InvalidWalletHandle);
assert!(create_connection_with_invite("This Should Fail", "BadDetailsFoobar").is_err());
} | rust_cleaned_test_functions.jsonl/34213 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 145
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20801,
15866,
22121,
1413,
368,
341,
286,
2930,
17223,
1866,
797,
286,
5003,
486,
746,
5332,
3142,
23369,
486,
24652,
14379,
11641,
8414,
11,
330,
3849,
797,
286,
2060,
10714,
10297,
3182,
15866,
445,
1986,
12260,
39645,
1827,
15454,
9266,
1005,
15314,
1507,
647,
25844,
1454,
10629,
486,
7928,
38259,
6999,
317,
286,
2060,
10297,
3182,
15866,
6615,
94910,
445,
1986,
12260,
39645,
497,
330,
17082,
7799,
91879,
31393,
1827,
285,
9266,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ndp_configs_dup_addr_detect_transmits() {
// Test that updating the DupAddrDetectTransmits parameter on an
// interface updates the number of DAD messages (NDP Neighbor
// Solicitations) sent before concluding that an address is not a
// duplicate.
let dummy_config = Ipv6::DUMMY_CONFIG;
let mut ctx = DummyEventDispatcherBuilder::default().build::<DummyEventDispatcher>();
let device = ctx
.state_mut()
.add_ethernet_device(dummy_config.local_mac, Ipv6::MINIMUM_LINK_MTU.into());
crate::device::initialize_device(&mut ctx, device);
assert_eq!(ctx.dispatcher().frames_sent().len(), 0);
assert_eq!(ctx.dispatcher().timer_events().count(), 0);
// Updating the IP should resolve immediately since DAD is turned off by
// `DummyEventDispatcherBuilder::build`.
add_ip_addr_subnet(
&mut ctx,
device,
AddrSubnet::new(dummy_config.local_ip.get(), 128).unwrap(),
)
.unwrap();
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&dummy_config.local_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Assigned
);
assert_eq!(ctx.dispatcher().frames_sent().len(), 0);
assert_eq!(ctx.dispatcher().timer_events().count(), 0);
// Enable DAD for the device.
let mut ndp_configs = crate::device::get_ndp_configurations(&ctx, device).clone();
ndp_configs.set_dup_addr_detect_transmits(NonZeroU8::new(3));
crate::device::set_ndp_configurations(&mut ctx, device, ndp_configs.clone());
// Updating the IP should start the DAD process.
add_ip_addr_subnet(
&mut ctx,
device,
AddrSubnet::new(dummy_config.remote_ip.get(), 128).unwrap(),
)
.unwrap();
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&dummy_config.local_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Assigned
);
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&dummy_config.remote_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Tentative
);
assert_eq!(ctx.dispatcher().frames_sent().len(), 1);
assert_eq!(ctx.dispatcher().timer_events().count(), 1);
// Disable DAD during DAD.
ndp_configs.set_dup_addr_detect_transmits(None);
crate::device::set_ndp_configurations(&mut ctx, device, ndp_configs.clone());
let expected_timer_id = NdpTimerId::new_dad_ns_transmission(
device.id().into(),
dummy_config.remote_ip.try_into().unwrap(),
)
.into();
assert_eq!(trigger_next_timer(&mut ctx).unwrap(), expected_timer_id);
assert_eq!(ctx.dispatcher().frames_sent().len(), 2);
assert_eq!(trigger_next_timer(&mut ctx).unwrap(), expected_timer_id);
assert_eq!(ctx.dispatcher().frames_sent().len(), 3);
assert_eq!(trigger_next_timer(&mut ctx).unwrap(), expected_timer_id);
assert_eq!(ctx.dispatcher().frames_sent().len(), 3);
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&dummy_config.remote_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Assigned
);
// Updating the IP should resolve immediately since DAD has just been
// turned off.
let new_ip = Ipv6::get_other_ip_address(3);
add_ip_addr_subnet(&mut ctx, device, AddrSubnet::new(new_ip.get(), 128).unwrap()).unwrap();
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&dummy_config.local_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Assigned
);
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&dummy_config.remote_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Assigned
);
assert_eq!(
NdpContext::<EthernetLinkDevice>::ipv6_addr_state(
&ctx,
device.id().into(),
&new_ip.try_into().unwrap()
)
.unwrap(),
AddressState::Assigned
);
} | rust_cleaned_test_functions.jsonl/82812 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2507
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
43544,
79,
59150,
51932,
7387,
56457,
7965,
44703,
368,
341,
286,
442,
3393,
429,
21010,
279,
50283,
13986,
57193,
3167,
44703,
5733,
389,
458,
198,
286,
442,
3749,
8837,
279,
1372,
315,
422,
1808,
6605,
320,
8065,
47,
97163,
198,
286,
442,
76194,
30667,
8,
3208,
1573,
71026,
429,
458,
2621,
374,
537,
264,
198,
286,
442,
22513,
382,
286,
1077,
17292,
5332,
284,
358,
30168,
21,
486,
35,
58673,
12568,
280,
286,
1077,
5206,
5635,
284,
50567,
1556,
21839,
3297,
486,
2258,
1005,
5834,
27638,
43344,
1556,
21839,
3913,
286,
1077,
3671,
284,
5635,
198,
310,
659,
2454,
29523,
741,
310,
659,
718,
57757,
13845,
9204,
83671,
5332,
11033,
22802,
11,
358,
30168,
21,
486,
16413,
40025,
26147,
49047,
52,
39860,
1423,
286,
17717,
486,
6111,
486,
21641,
9204,
2099,
6984,
5635,
11,
3671,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
23719,
24115,
1005,
2892,
1507,
220,
15,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
19278,
19691,
1005,
1830,
1507,
220,
15,
626,
286,
442,
78118,
279,
6790,
1265,
8830,
7069,
2474,
422,
1808,
374,
6519,
1007,
553,
198,
286,
442,
1565,
43344,
1556,
21839,
3297,
486,
5834,
18639,
286,
912,
10385,
7387,
95681,
1006,
310,
609,
6984,
5635,
345,
310,
3671,
345,
310,
72585,
3136,
4711,
486,
931,
83671,
5332,
11033,
10385,
670,
1507,
220,
16,
17,
23,
568,
15454,
3148,
286,
1727,
286,
659,
15454,
543,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
31390,
5332,
11033,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
94025,
198,
286,
1439,
286,
2060,
10714,
10297,
3773,
93508,
1005,
23719,
24115,
1005,
2892,
1507,
220,
15,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
19278,
19691,
1005,
1830,
1507,
220,
15,
626,
286,
442,
18567,
422,
1808,
369,
279,
3671,
624,
286,
1077,
5206,
15581,
79,
59150,
284,
17717,
486,
6111,
486,
455,
43544,
79,
5332,
21449,
2099,
3773,
11,
3671,
568,
19982,
543,
286,
15581,
79,
59150,
980,
51932,
7387,
56457,
7965,
44703,
7,
8121,
17999,
52,
23,
486,
931,
7,
18,
1106,
286,
17717,
486,
6111,
486,
746,
43544,
79,
5332,
21449,
2099,
6984,
5635,
11,
3671,
11,
15581,
79,
59150,
15997,
5231,
286,
442,
78118,
279,
6790,
1265,
1191,
279,
422,
1808,
1882,
624,
286,
912,
10385,
7387,
95681,
1006,
310,
609,
6984,
5635,
345,
310,
3671,
345,
310,
72585,
3136,
4711,
486,
931,
83671,
5332,
34093,
10385,
670,
1507,
220,
16,
17,
23,
568,
15454,
3148,
286,
1727,
286,
659,
15454,
543,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
31390,
5332,
11033,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
94025,
198,
286,
1439,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
31390,
5332,
34093,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
51,
306,
1388,
198,
286,
1439,
286,
2060,
10714,
10297,
3773,
93508,
1005,
23719,
24115,
1005,
2892,
1507,
220,
16,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
19278,
19691,
1005,
1830,
1507,
220,
16,
626,
286,
442,
28027,
422,
1808,
2337,
422,
1808,
624,
286,
15581,
79,
59150,
980,
51932,
7387,
56457,
7965,
44703,
26717,
317,
286,
17717,
486,
6111,
486,
746,
43544,
79,
5332,
21449,
2099,
6984,
5635,
11,
3671,
11,
15581,
79,
59150,
15997,
1423,
286,
1077,
3601,
16255,
842,
284,
451,
9796,
10105,
764,
486,
931,
814,
329,
34728,
7965,
2728,
1006,
310,
3671,
1764,
1005,
18122,
3148,
310,
17292,
5332,
34093,
10385,
48779,
45514,
1005,
15454,
3148,
286,
1727,
286,
659,
18122,
543,
1789,
286,
2060,
10714,
10297,
18468,
11257,
16255,
2099,
6984,
5635,
568,
15454,
1507,
3601,
16255,
842,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
23719,
24115,
1005,
2892,
1507,
220,
17,
317,
286,
2060,
10714,
10297,
18468,
11257,
16255,
2099,
6984,
5635,
568,
15454,
1507,
3601,
16255,
842,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
23719,
24115,
1005,
2892,
1507,
220,
18,
317,
286,
2060,
10714,
10297,
18468,
11257,
16255,
2099,
6984,
5635,
568,
15454,
1507,
3601,
16255,
842,
317,
286,
2060,
10714,
10297,
3773,
93508,
1005,
23719,
24115,
1005,
2892,
1507,
220,
18,
317,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
31390,
5332,
34093,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
94025,
198,
286,
3475,
286,
442,
78118,
279,
6790,
1265,
8830,
7069,
2474,
422,
1808,
702,
1101,
1012,
198,
286,
442,
6519,
1007,
624,
286,
1077,
501,
10385,
284,
358,
30168,
21,
486,
455,
30456,
10385,
6744,
7,
18,
317,
286,
912,
10385,
7387,
95681,
2099,
6984,
5635,
11,
3671,
11,
72585,
3136,
4711,
486,
931,
1755,
10385,
670,
1507,
220,
16,
17,
23,
568,
15454,
6011,
15454,
543,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
31390,
5332,
11033,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
94025,
198,
286,
1439,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
31390,
5332,
34093,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
94025,
198,
286,
1439,
286,
2060,
10714,
33673,
310,
451,
9796,
1972,
27638,
98006,
3939,
6985,
6831,
42676,
21,
7387,
4387,
1006,
394,
609,
3773,
345,
394,
3671,
1764,
1005,
18122,
3148,
394,
609,
931,
10385,
48779,
45514,
1005,
15454,
741,
310,
1727,
310,
659,
15454,
3148,
310,
9177,
1397,
486,
94025,
198,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_if_statement() {
assert_eq!(
parse_statement(&b"jika a == salah {\nmisal z = benar;\n}"[..]),
Ok((
&b""[..],
Statement::IfStatement(IfStatement {
test: Expression::BinaryExpression(Box::new(BinaryExpression {
left: Expression::Identifier(Identifier {
name: String::from("a")
}),
right: Expression::Literal(Literal::Boolean(false)),
operator: Operator::Equal
})),
consequent: BlockStatement {
body: Some(vec![Statement::VariableDeclaration(VariableDeclaration {
id: Identifier {
name: String::from("z")
},
value: Expression::Literal(Literal::Boolean(true))
})])
},
alternate: None
})
))
);
} | rust_cleaned_test_functions.jsonl/129438 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 685
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11119,
37404,
368,
341,
286,
2060,
10714,
33673,
310,
4715,
37404,
2099,
65,
1,
73,
11496,
264,
621,
77324,
28152,
19638,
285,
278,
1147,
284,
3318,
277,
17882,
77,
9863,
95874,
17036,
310,
7622,
94702,
394,
609,
65,
3014,
95874,
1259,
394,
21756,
486,
2679,
8636,
7,
2679,
8636,
341,
503,
1273,
25,
16378,
486,
21338,
9595,
67758,
486,
931,
77833,
9595,
341,
664,
2115,
25,
16378,
486,
8714,
7,
8714,
341,
999,
829,
25,
923,
486,
1499,
445,
64,
1138,
664,
11973,
664,
1290,
25,
16378,
486,
17350,
4957,
9953,
486,
6890,
3576,
6965,
664,
5675,
25,
28498,
486,
2993,
198,
503,
78384,
503,
12494,
306,
25,
8362,
8636,
341,
664,
2487,
25,
4329,
25592,
20703,
8636,
486,
7827,
24489,
7,
7827,
24489,
341,
999,
877,
25,
34621,
341,
1383,
829,
25,
923,
486,
1499,
445,
89,
1138,
999,
1153,
999,
897,
25,
16378,
486,
17350,
4957,
9953,
486,
6890,
3715,
1171,
664,
6413,
2546,
503,
1153,
503,
24609,
25,
2240,
198,
394,
2751,
310,
19245,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_read_no_attr_vmerge() {
let c = r#"<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:tc>
<w:tcPr>
<w:tcW w:w="6425" w:type="dxa"/>
<w:vMerge />
<w:shd w:fill="auto" w:val="clear"/>
</w:tcPr>
<w:p>
<w:r>
<w:rPr></w:rPr>
</w:r>
</w:p>
</w:tc>
</w:document>"#;
let mut parser = EventReader::new(c.as_bytes());
let cell = TableCell::read(&mut parser, &[]).unwrap();
assert_eq!(
cell,
TableCell::new()
.add_paragraph(Paragraph::new().add_run(Run::new()))
.width(6425, WidthType::DXA)
.vertical_merge(VMergeType::Continue),
);
} | rust_cleaned_test_functions.jsonl/117063 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 442
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
6536,
10422,
2273,
19052,
368,
341,
286,
1077,
272,
284,
435,
2,
22476,
86,
25,
6062,
24967,
52882,
428,
1254,
1110,
56543,
5826,
6455,
63482,
2659,
14,
1158,
20660,
1014,
14,
17,
15,
15,
21,
15351,
881,
15889,
25,
10413,
397,
262,
366,
86,
25,
10413,
3533,
397,
286,
366,
86,
25,
10413,
54,
289,
52882,
428,
21,
19,
17,
20,
1,
289,
46445,
428,
67,
9591,
4639,
286,
366,
86,
52649,
52096,
2597,
286,
366,
86,
25,
927,
67,
289,
25,
7559,
428,
3902,
1,
289,
25,
831,
428,
7422,
4639,
262,
690,
86,
25,
10413,
3533,
397,
262,
366,
86,
44389,
397,
286,
366,
86,
67359,
397,
310,
366,
86,
67359,
3533,
1472,
86,
67359,
3533,
397,
286,
690,
86,
67359,
397,
262,
690,
86,
44389,
397,
522,
86,
25,
10413,
397,
522,
86,
25,
6062,
9877,
2,
280,
286,
1077,
5206,
6729,
284,
3665,
5062,
486,
931,
1337,
5357,
12524,
1423,
286,
1077,
2779,
284,
84370,
486,
878,
2099,
6984,
6729,
11,
609,
1294,
568,
15454,
543,
286,
2060,
10714,
33673,
310,
2779,
345,
310,
84370,
486,
931,
741,
394,
659,
718,
96713,
7,
42165,
486,
931,
1005,
718,
14007,
2785,
359,
486,
931,
12145,
394,
659,
3098,
7,
21,
19,
17,
20,
11,
24627,
929,
486,
16591,
32,
340,
394,
659,
15292,
20888,
7,
11187,
10080,
929,
486,
23526,
1326,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_as_arr() {
let arr: [i32; 5] = as_arr(0b10011);
assert_eq!(arr, [1, 1, 0, 0, 1]);
} | rust_cleaned_test_functions.jsonl/35255 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 77
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11898,
11210,
368,
341,
286,
1077,
2890,
25,
508,
72,
18,
17,
26,
220,
20,
60,
284,
438,
11210,
7,
15,
65,
16,
15,
15,
16,
16,
317,
286,
2060,
10714,
10297,
1118,
11,
508,
16,
11,
220,
16,
11,
220,
15,
11,
220,
15,
11,
220,
16,
2558,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_broadcast_1() {
let mut a = Matrix::new([8., 9., 2., 5., 4., 9., 1., 6., 3.], 3, 3);
let mut b = Vector::new([1., 2., 3.]).to_matrix(); // 1x3 matrix
let c = broadcast_add(&a, &b);
assert_eq!(c, Matrix::new([9., 11., 5., 6., 6., 12., 2., 8., 6.], 3, 3));
let d = broadcast_mul(&a, &b);
assert_eq!(
d,
Matrix::new([8., 18., 6., 5., 8., 27., 1., 12., 9.], 3, 3)
);
b.t_mut(); // 3x1
let e = broadcast_sub(&b, &a);
assert_eq!(
e,
Matrix::new([-7., -8., -1., -3., -2., -7., 2., -3., 0.], 3, 3)
);
a.reshape_mut(1, -1); // flatten to 9x1
let f = broadcast_div(&a, &b);
assert_eq!(
f,
Matrix::new(
vec![
8.,
9.,
2.,
5.,
4.,
9.,
1.,
6.,
3.,
4.,
4.5,
1.,
2.5,
2.,
4.5,
0.5,
3.,
1.5,
2. + 2. / 3.,
3.,
2. / 3.,
1. + 2. / 3.,
1. + 1. / 3.,
3.,
1. / 3.,
2.,
1.
],
3,
9
)
);
} | rust_cleaned_test_functions.jsonl/55656 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1186
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
74923,
62,
16,
368,
341,
286,
1077,
5206,
264,
284,
11631,
486,
931,
2561,
23,
2572,
220,
24,
2572,
220,
17,
2572,
220,
20,
2572,
220,
19,
2572,
220,
24,
2572,
220,
16,
2572,
220,
21,
2572,
220,
18,
13,
1125,
220,
18,
11,
220,
18,
317,
286,
1077,
5206,
293,
284,
4196,
486,
931,
2561,
16,
2572,
220,
17,
2572,
220,
18,
13,
10697,
983,
10193,
2129,
442,
220,
16,
87,
18,
6172,
198,
286,
1077,
272,
284,
12899,
2891,
2099,
64,
11,
609,
65,
317,
286,
2060,
10714,
10297,
66,
11,
11631,
486,
931,
2561,
24,
2572,
220,
16,
16,
2572,
220,
20,
2572,
220,
21,
2572,
220,
21,
2572,
220,
16,
17,
2572,
220,
17,
2572,
220,
23,
2572,
220,
21,
13,
1125,
220,
18,
11,
220,
18,
1106,
286,
1077,
294,
284,
12899,
24944,
2099,
64,
11,
609,
65,
317,
286,
2060,
10714,
33673,
310,
294,
345,
310,
11631,
486,
931,
2561,
23,
2572,
220,
16,
23,
2572,
220,
21,
2572,
220,
20,
2572,
220,
23,
2572,
220,
17,
22,
2572,
220,
16,
2572,
220,
16,
17,
2572,
220,
24,
13,
1125,
220,
18,
11,
220,
18,
340,
286,
1439,
286,
293,
734,
29523,
2129,
442,
220,
18,
87,
16,
198,
286,
1077,
384,
284,
12899,
5228,
2099,
65,
11,
609,
64,
317,
286,
2060,
10714,
33673,
310,
384,
345,
310,
11631,
486,
931,
41197,
22,
2572,
481,
23,
2572,
481,
16,
2572,
481,
18,
2572,
481,
17,
2572,
481,
22,
2572,
220,
17,
2572,
481,
18,
2572,
220,
15,
13,
1125,
220,
18,
11,
220,
18,
340,
286,
1439,
286,
264,
23096,
29523,
7,
16,
11,
481,
16,
1215,
442,
45343,
311,
220,
24,
87,
16,
198,
286,
1077,
282,
284,
12899,
16237,
2099,
64,
11,
609,
65,
317,
286,
2060,
10714,
33673,
310,
282,
345,
310,
11631,
486,
931,
1006,
394,
7486,
90515,
503,
220,
23,
38088,
503,
220,
24,
38088,
503,
220,
17,
38088,
503,
220,
20,
38088,
503,
220,
19,
38088,
503,
220,
24,
38088,
503,
220,
16,
38088,
503,
220,
21,
38088,
503,
220,
18,
38088,
503,
220,
19,
38088,
503,
220,
19,
13,
20,
345,
503,
220,
16,
38088,
503,
220,
17,
13,
20,
345,
503,
220,
17,
38088,
503,
220,
19,
13,
20,
345,
503,
220,
15,
13,
20,
345,
503,
220,
18,
38088,
503,
220,
16,
13,
20,
345,
503,
220,
17,
13,
488,
220,
17,
13,
608,
220,
18,
38088,
503,
220,
18,
38088,
503,
220,
17,
13,
608,
220,
18,
38088,
503,
220,
16,
13,
488,
220,
17,
13,
608,
220,
18,
38088,
503,
220,
16,
13,
488,
220,
16,
13,
608,
220,
18,
38088,
503,
220,
18,
38088,
503,
220,
16,
13,
608,
220,
18,
38088,
503,
220,
17,
38088,
503,
220,
16,
624,
394,
3211,
394,
220,
18,
345,
394,
220,
24,
198,
310,
1727,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_config_always() {
let mut c = Config::with_none();
c.icons = Some(Icons {
when: Some(IconOption::Always),
theme: None,
separator: None,
});
assert_eq!(Some(IconOption::Always), IconOption::from_config(&c));
} | rust_cleaned_test_functions.jsonl/17359 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 153
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5673,
5332,
8418,
2284,
368,
341,
286,
1077,
5206,
272,
284,
5532,
486,
4197,
31488,
543,
286,
272,
78874,
284,
4329,
35066,
341,
310,
979,
25,
4329,
7,
4395,
5341,
486,
37095,
1326,
310,
6912,
25,
2240,
345,
310,
24792,
25,
2240,
345,
286,
1625,
286,
2060,
10714,
10297,
8373,
7,
4395,
5341,
486,
37095,
701,
11226,
5341,
486,
1499,
5332,
2099,
66,
1106,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_8xy2_assign_and() {
let mut machine = Machine::new(TestContext::new());
// Seed registers
machine.register_set(0xB, 0xA);
machine.register_set(0xC, 0xC);
machine.test_opcode(0x8BC2);
assert_eq!(machine.register_get(0xB), 8);
// Should not affect VY
assert_eq!(machine.register_get(0xC), 0xC);
// Should increment program counter by two
assert_eq!(machine.pc, PC_BEGIN + 2);
} | rust_cleaned_test_functions.jsonl/127958 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 193
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
23,
4130,
17,
20688,
8378,
368,
341,
262,
1077,
5206,
5662,
284,
12960,
486,
931,
31159,
1972,
486,
931,
1423,
262,
442,
35822,
24740,
198,
262,
5662,
9929,
2602,
7,
15,
14377,
11,
220,
15,
14673,
317,
262,
5662,
9929,
2602,
7,
15,
12125,
11,
220,
15,
12125,
317,
262,
5662,
5958,
71319,
7,
15,
87,
23,
4897,
17,
626,
1066,
262,
2060,
10714,
10297,
32056,
9929,
3062,
7,
15,
14377,
701,
220,
23,
317,
262,
442,
12260,
537,
7802,
647,
56,
198,
262,
2060,
10714,
10297,
32056,
9929,
3062,
7,
15,
12125,
701,
220,
15,
12125,
317,
262,
442,
12260,
16252,
2025,
5546,
553,
1378,
198,
262,
2060,
10714,
10297,
32056,
53335,
11,
6673,
26382,
488,
220,
17,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_transaction_from() {
let transaction = get_transaction_from("test_data/transactions.json", "from1").unwrap();
assert_eq!("from1", transaction.from);
let transaction = get_transaction_from("test_data/transactions.json", "from10");
assert_eq!(None, transaction);
let transaction = get_transaction_from("test_data/transactions.404.json", "from1");
assert_eq!(None, transaction);
} | rust_cleaned_test_functions.jsonl/11300 | {
"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,
3062,
28884,
5673,
368,
341,
286,
1077,
7745,
284,
633,
28884,
5673,
445,
1944,
1769,
14,
41844,
4323,
497,
330,
1499,
16,
1827,
15454,
543,
286,
2060,
10714,
17223,
1499,
16,
497,
7745,
6387,
626,
286,
1077,
7745,
284,
633,
28884,
5673,
445,
1944,
1769,
14,
41844,
4323,
497,
330,
1499,
16,
15,
797,
286,
2060,
10714,
10297,
4064,
11,
7745,
626,
286,
1077,
7745,
284,
633,
28884,
5673,
445,
1944,
1769,
14,
41844,
13,
19,
15,
19,
4323,
497,
330,
1499,
16,
797,
286,
2060,
10714,
10297,
4064,
11,
7745,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_error_response_internal_error_json_serialization() -> Result<()> {
let err = "NaN".parse::<u32>().unwrap_err();
let response = ErrorResponse::internal_error(Box::new(err));
let json = serde_json::to_string(&response)?;
let deserialized: Response = serde_json::from_str(&json)?;
assert_eq!(deserialized.status_code, 500);
assert_eq!(deserialized.message, "An internal error occurred");
Ok(())
} | rust_cleaned_test_functions.jsonl/5305 | {
"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,
4096,
9655,
23472,
4096,
9455,
25602,
2022,
368,
1464,
5714,
71698,
341,
286,
1077,
1848,
284,
330,
22831,
3263,
6400,
27638,
84,
18,
17,
10483,
15454,
9266,
543,
286,
1077,
2033,
284,
95724,
486,
10481,
4096,
67758,
486,
931,
3964,
1106,
286,
1077,
2951,
284,
61570,
9455,
486,
983,
3904,
2099,
2322,
40007,
286,
1077,
939,
67577,
25,
5949,
284,
61570,
9455,
486,
1499,
2895,
2099,
2236,
89720,
286,
2060,
10714,
10297,
5799,
67577,
4299,
4136,
11,
220,
20,
15,
15,
317,
286,
2060,
10714,
10297,
5799,
67577,
6698,
11,
330,
2082,
5306,
1465,
10017,
3071,
286,
7622,
50432,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_bump_penalty_txn_on_revoked_commitment() {
// we're able to claim outputs on revoked commitment transaction before timelocks expiration
let chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1000000, 59000000, InitFeatures::known(), InitFeatures::known());
let logger = test_utils::TestLogger::new();
let payment_preimage = route_payment(&nodes[0], &vec!(&nodes[1])[..], 3000000).0;
let net_graph_msg_handler = &nodes[1].net_graph_msg_handler;
let route = get_route(&nodes[1].node.get_our_node_id(), &net_graph_msg_handler.network_graph, &nodes[0].node.get_our_node_id(), Some(InvoiceFeatures::known()), None, &Vec::new(), 3000000, 30, &logger).unwrap();
send_along_route(&nodes[1], route, &vec!(&nodes[0])[..], 3000000);
let revoked_txn = get_local_commitment_txn!(nodes[0], chan.2);
assert_eq!(revoked_txn[0].output.len(), 4);
assert_eq!(revoked_txn[0].input.len(), 1);
assert_eq!(revoked_txn[0].input[0].previous_output.txid, chan.3.txid());
let revoked_txid = revoked_txn[0].txid();
let mut penalty_sum = 0;
for outp in revoked_txn[0].output.iter() {
if outp.script_pubkey.is_v0_p2wsh() {
penalty_sum += outp.value;
}
}
// Connect blocks to change height_timer range to see if we use right soonest_timelock
let header_114 = connect_blocks(&nodes[1], 14);
// Actually revoke tx by claiming a HTLC
claim_payment(&nodes[0], &vec!(&nodes[1])[..], payment_preimage);
let header = BlockHeader { version: 0x20000000, prev_blockhash: header_114, merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
connect_block(&nodes[1], &Block { header, txdata: vec![revoked_txn[0].clone()] });
check_added_monitors!(nodes[1], 1);
let penalty_1;
let feerate_1;
{
let mut node_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap();
assert_eq!(node_txn.len(), 2);
assert_eq!(node_txn[0].input.len(), 3);
assert_eq!(node_txn[0].output.len(), 1);
check_spends!(node_txn[0], revoked_txn[0]);
let fee_1 = penalty_sum - node_txn[0].output[0].value;
feerate_1 = fee_1 * 1000 / node_txn[0].get_weight() as u64;
penalty_1 = node_txn[0].txid();
node_txn.clear();
};
connect_blocks(&nodes[1], 15);
let mut penalty_2 = penalty_1;
let mut feerate_2 = 0;
{
let mut node_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap();
assert_eq!(node_txn.len(), 1);
if node_txn[0].input[0].previous_output.txid == revoked_txid {
assert_eq!(node_txn[0].input.len(), 3);
assert_eq!(node_txn[0].output.len(), 1);
check_spends!(node_txn[0], revoked_txn[0]);
penalty_2 = node_txn[0].txid();
assert_ne!(penalty_2, penalty_1);
let fee_2 = penalty_sum - node_txn[0].output[0].value;
feerate_2 = fee_2 * 1000 / node_txn[0].get_weight() as u64;
assert!(feerate_2 * 100 >= feerate_1 * 125);
node_txn.clear();
}
}
assert_ne!(feerate_2, 0);
connect_blocks(&nodes[1], 1);
let penalty_3;
let mut feerate_3 = 0;
{
let mut node_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap();
assert_eq!(node_txn.len(), 1);
if node_txn[0].input[0].previous_output.txid == revoked_txid {
assert_eq!(node_txn[0].input.len(), 3);
assert_eq!(node_txn[0].output.len(), 1);
check_spends!(node_txn[0], revoked_txn[0]);
penalty_3 = node_txn[0].txid();
assert_ne!(penalty_3, penalty_2);
let fee_3 = penalty_sum - node_txn[0].output[0].value;
feerate_3 = fee_3 * 1000 / node_txn[0].get_weight() as u64;
assert!(feerate_3 * 100 >= feerate_2 * 125);
node_txn.clear();
}
}
assert_ne!(feerate_3, 0);
nodes[1].node.get_and_clear_pending_events();
nodes[1].node.get_and_clear_pending_msg_events();
} | rust_cleaned_test_functions.jsonl/16945 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1696
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
1510,
82286,
92299,
4470,
38082,
10823,
36346,
478,
368,
341,
1572,
197,
322,
582,
2299,
2952,
311,
3717,
16275,
389,
64346,
15155,
7745,
1573,
6792,
301,
25183,
31692,
271,
10217,
26023,
1645,
18343,
82,
284,
1855,
45552,
1645,
18343,
82,
7,
17,
317,
10217,
2436,
18343,
82,
284,
1855,
5084,
18343,
82,
7,
17,
11,
609,
5658,
1645,
18343,
82,
317,
10217,
2436,
45552,
48292,
82,
284,
1855,
5084,
45552,
48292,
82,
7,
17,
11,
609,
3509,
18343,
82,
11,
44590,
4064,
11,
2240,
2558,
10217,
7798,
284,
1855,
20966,
7,
17,
11,
609,
3509,
18343,
82,
11,
609,
3509,
45552,
48292,
82,
626,
10217,
26023,
284,
1855,
51870,
19453,
45552,
48302,
14896,
6615,
3142,
2099,
20008,
11,
220,
15,
11,
220,
16,
11,
220,
16,
15,
15,
15,
15,
15,
15,
11,
220,
20,
24,
15,
15,
15,
15,
15,
15,
11,
15690,
21336,
486,
5278,
1507,
15690,
21336,
486,
5278,
1423,
10217,
5925,
284,
1273,
17309,
486,
2271,
7395,
486,
931,
1428,
10217,
8160,
10442,
1805,
284,
6021,
26696,
2099,
20008,
58,
15,
1125,
609,
4083,
0,
2099,
20008,
58,
16,
40005,
496,
1125,
220,
18,
15,
15,
15,
15,
15,
15,
568,
15,
280,
10217,
4179,
14738,
6483,
10183,
284,
609,
20008,
58,
16,
936,
4711,
14738,
6483,
10183,
280,
10217,
6021,
284,
633,
28109,
2099,
20008,
58,
16,
936,
3509,
670,
62,
413,
5084,
842,
1507,
609,
4711,
14738,
6483,
10183,
20573,
14738,
11,
609,
20008,
58,
15,
936,
3509,
670,
62,
413,
5084,
842,
1507,
4329,
7,
34674,
21336,
486,
5278,
11858,
2240,
11,
609,
10050,
486,
931,
1507,
220,
18,
15,
15,
15,
15,
15,
15,
11,
220,
18,
15,
11,
609,
9786,
568,
15454,
543,
32817,
8418,
644,
28109,
2099,
20008,
58,
16,
1125,
6021,
11,
609,
4083,
0,
2099,
20008,
58,
15,
40005,
496,
1125,
220,
18,
15,
15,
15,
15,
15,
15,
626,
10217,
64346,
92299,
284,
633,
13564,
36346,
478,
92299,
10297,
20008,
58,
15,
1125,
26023,
13,
17,
317,
1572,
6948,
10714,
10297,
7282,
10823,
92299,
58,
15,
936,
3006,
19406,
1507,
220,
19,
317,
6948,
10714,
10297,
7282,
10823,
92299,
58,
15,
936,
1355,
19406,
1507,
220,
16,
317,
6948,
10714,
10297,
7282,
10823,
92299,
58,
15,
936,
1355,
58,
15,
936,
19702,
7645,
33807,
307,
11,
26023,
13,
18,
33807,
307,
1423,
10217,
64346,
17805,
307,
284,
64346,
92299,
58,
15,
936,
3998,
307,
1428,
10217,
5206,
16346,
10160,
284,
220,
15,
280,
2023,
700,
79,
304,
64346,
92299,
58,
15,
936,
3006,
19471,
368,
341,
197,
743,
700,
79,
46713,
34014,
792,
2079,
2273,
15,
620,
17,
86,
927,
368,
341,
298,
197,
2752,
10026,
10160,
1421,
700,
79,
2824,
280,
197,
197,
532,
197,
630,
197,
322,
13015,
10010,
311,
2297,
2608,
16255,
2088,
311,
1490,
421,
582,
990,
1290,
5135,
477,
29087,
301,
1176,
198,
10217,
4247,
62,
16,
16,
19,
284,
4564,
25201,
2099,
20008,
58,
16,
1125,
220,
16,
19,
626,
197,
322,
33763,
72038,
9854,
553,
20409,
264,
5260,
8556,
198,
197,
7859,
26696,
2099,
20008,
58,
15,
1125,
609,
4083,
0,
2099,
20008,
58,
16,
40005,
496,
1125,
8160,
10442,
1805,
317,
10217,
4247,
284,
8362,
4047,
314,
2319,
25,
220,
15,
87,
17,
15,
15,
15,
15,
15,
15,
15,
11,
7872,
7113,
8296,
25,
4247,
62,
16,
16,
19,
11,
4704,
23089,
12993,
25,
7899,
486,
2258,
1507,
882,
25,
220,
19,
17,
11,
9472,
25,
220,
19,
17,
11,
39676,
25,
220,
19,
17,
2605,
56905,
7113,
2099,
20008,
58,
16,
1125,
609,
4713,
314,
4247,
11,
9854,
691,
25,
7486,
20703,
7282,
10823,
92299,
58,
15,
936,
19982,
26556,
1625,
25157,
37653,
20737,
11905,
10297,
20008,
58,
16,
1125,
220,
16,
626,
1572,
10217,
16346,
62,
16,
280,
10217,
1152,
58668,
62,
16,
280,
197,
515,
197,
10217,
5206,
2436,
92299,
284,
7798,
58,
16,
936,
3998,
880,
8546,
32020,
33807,
77,
74923,
291,
21003,
1005,
15454,
543,
197,
6948,
10714,
10297,
3509,
92299,
19406,
1507,
220,
17,
1215,
715,
197,
6948,
10714,
10297,
3509,
92299,
58,
15,
936,
1355,
19406,
1507,
220,
18,
1215,
715,
197,
6948,
10714,
10297,
3509,
92299,
58,
15,
936,
3006,
19406,
1507,
220,
16,
317,
197,
25157,
10123,
1412,
10297,
3509,
92299,
58,
15,
1125,
64346,
92299,
58,
15,
2558,
197,
10217,
11060,
62,
16,
284,
16346,
10160,
481,
2436,
92299,
58,
15,
936,
3006,
58,
15,
936,
957,
280,
197,
1166,
34756,
349,
62,
16,
284,
11060,
62,
16,
353,
220,
16,
15,
15,
15,
608,
2436,
92299,
58,
15,
936,
455,
15876,
368,
438,
575,
21,
19,
280,
197,
197,
2752,
10026,
62,
16,
284,
2436,
92299,
58,
15,
936,
3998,
307,
543,
197,
20831,
92299,
7426,
543,
197,
2315,
1572,
56905,
25201,
2099,
20008,
58,
16,
1125,
220,
16,
20,
317,
10217,
5206,
16346,
62,
17,
284,
16346,
62,
16,
280,
10217,
5206,
1152,
58668,
62,
17,
284,
220,
15,
280,
197,
515,
197,
10217,
5206,
2436,
92299,
284,
7798,
58,
16,
936,
3998,
880,
8546,
32020,
33807,
77,
74923,
291,
21003,
1005,
15454,
543,
197,
6948,
10714,
10297,
3509,
92299,
19406,
1507,
220,
16,
317,
197,
743,
2436,
92299,
58,
15,
936,
1355,
58,
15,
936,
19702,
7645,
33807,
307,
621,
64346,
17805,
307,
341,
298,
6948,
10714,
10297,
3509,
92299,
58,
15,
936,
1355,
19406,
1507,
220,
18,
1215,
715,
298,
6948,
10714,
10297,
3509,
92299,
58,
15,
936,
3006,
19406,
1507,
220,
16,
317,
298,
25157,
10123,
1412,
10297,
3509,
92299,
58,
15,
1125,
64346,
92299,
58,
15,
2558,
298,
197,
2752,
10026,
62,
17,
284,
2436,
92299,
58,
15,
936,
3998,
307,
543,
4557,
298,
6948,
13925,
10297,
2752,
10026,
62,
17,
11,
16346,
62,
16,
317,
298,
10217,
11060,
62,
17,
284,
16346,
10160,
481,
2436,
92299,
58,
15,
936,
3006,
58,
15,
936,
957,
280,
298,
1166,
34756,
349,
62,
17,
284,
11060,
62,
17,
353,
220,
16,
15,
15,
15,
608,
2436,
92299,
58,
15,
936,
455,
15876,
368,
438,
575,
21,
19,
280,
4557,
298,
6948,
10297,
1859,
58668,
62,
17,
353,
220,
16,
15,
15,
2604,
1152,
58668,
62,
16,
353,
220,
16,
17,
20,
317,
298,
20831,
92299,
7426,
543,
197,
197,
532,
197,
532,
6948,
13925,
10297,
1859,
58668,
62,
17,
11,
220,
15,
626,
1572,
56905,
25201,
2099,
20008,
58,
16,
1125,
220,
16,
317,
10217,
16346,
62,
18,
280,
10217,
5206,
1152,
58668,
62,
18,
284,
220,
15,
280,
197,
515,
197,
10217,
5206,
2436,
92299,
284,
7798,
58,
16,
936,
3998,
880,
8546,
32020,
33807,
77,
74923,
291,
21003,
1005,
15454,
543,
197,
6948,
10714,
10297,
3509,
92299,
19406,
1507,
220,
16,
317,
197,
743,
2436,
92299,
58,
15,
936,
1355,
58,
15,
936,
19702,
7645,
33807,
307,
621,
64346,
17805,
307,
341,
298,
6948,
10714,
10297,
3509,
92299,
58,
15,
936,
1355,
19406,
1507,
220,
18,
1215,
715,
298,
6948,
10714,
10297,
3509,
92299,
58,
15,
936,
3006,
19406,
1507,
220,
16,
317,
298,
25157,
10123,
1412,
10297,
3509,
92299,
58,
15,
1125,
64346,
92299,
58,
15,
2558,
298,
197,
2752,
10026,
62,
18,
284,
2436,
92299,
58,
15,
936,
3998,
307,
543,
4557,
298,
6948,
13925,
10297,
2752,
10026,
62,
18,
11,
16346,
62,
17,
317,
298,
10217,
11060,
62,
18,
284,
16346,
10160,
481,
2436,
92299,
58,
15,
936,
3006,
58,
15,
936,
957,
280,
298,
1166,
34756,
349,
62,
18,
284,
11060,
62,
18,
353,
220,
16,
15,
15,
15,
608,
2436,
92299,
58,
15,
936,
455,
15876,
368,
438,
575,
21,
19,
280,
4557,
298,
6948,
10297,
1859,
58668,
62,
18,
353,
220,
16,
15,
15,
2604,
1152,
58668,
62,
17,
353,
220,
16,
17,
20,
317,
298,
20831,
92299,
7426,
543,
197,
197,
532,
197,
532,
6948,
13925,
10297,
1859,
58668,
62,
18,
11,
220,
15,
626,
79756,
58,
16,
936,
3509,
670,
8378,
21811,
37861,
19691,
543,
79756,
58,
16,
936,
3509,
670,
8378,
21811,
37861,
6483,
19691,
543,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 5 |
#[test]
fn test_local_affine_ins2() {
let x = b"ACGTATCATAGATAGATAGGGTTGTGTAGATGATCCACAG";
let y = b"CGTATCATAGATAGATGTAGATGATCCACAGT";
let score = |a: u8, b: u8| if a == b { 1i32 } else { -1i32 };
let mut aligner = Aligner::with_capacity(x.len(), y.len(), -5, -1, score);
let alignment = aligner.local(x, y);
assert_eq!(alignment.xstart, 1);
assert_eq!(alignment.ystart, 0);
} | rust_cleaned_test_functions.jsonl/16835 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 232
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13564,
48914,
482,
34386,
17,
368,
341,
286,
1077,
856,
284,
293,
1,
1706,
25388,
828,
28196,
1890,
828,
1890,
828,
1890,
22254,
14903,
25388,
25388,
1890,
828,
38,
828,
3706,
1706,
1890,
876,
286,
1077,
379,
284,
293,
1,
8798,
51,
828,
28196,
1890,
828,
1890,
828,
25388,
1890,
828,
38,
828,
3706,
1706,
1890,
51,
876,
286,
1077,
5456,
284,
760,
64,
25,
575,
23,
11,
293,
25,
575,
23,
91,
421,
264,
621,
293,
314,
220,
16,
72,
18,
17,
335,
770,
314,
481,
16,
72,
18,
17,
2605,
286,
1077,
5206,
5285,
261,
284,
49472,
261,
486,
4197,
35603,
2075,
19406,
1507,
379,
19406,
1507,
481,
20,
11,
481,
16,
11,
5456,
317,
286,
1077,
17189,
284,
5285,
261,
11033,
2075,
11,
379,
317,
286,
2060,
10714,
10297,
44598,
1993,
2468,
11,
220,
16,
317,
286,
2060,
10714,
10297,
44598,
13,
597,
471,
11,
220,
15,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_decompose() {
let ref a = LpContinuous::new("a");
let ref b = LpContinuous::new("b");
let expr = (4 * (3 * a - b * 2 + a)) * 1 + b;
let decomposed = decompose_expression(expr);
let mut expected = VarList::default();
expected.add(a.clone(), 4. * 3. + 4.);
expected.add(b.clone(), 4. * (-2.) + 1.);
assert_eq!(decomposed, Ok(expected));
} | rust_cleaned_test_functions.jsonl/15847 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 169
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2259,
52706,
368,
341,
262,
1077,
2053,
264,
284,
444,
79,
94780,
486,
931,
445,
64,
797,
262,
1077,
2053,
293,
284,
444,
79,
94780,
486,
931,
445,
65,
797,
262,
1077,
15169,
284,
320,
19,
353,
320,
18,
353,
264,
481,
293,
353,
220,
17,
488,
264,
593,
353,
220,
16,
488,
293,
280,
262,
1077,
28502,
3865,
284,
28502,
2900,
28068,
34322,
317,
262,
1077,
5206,
3601,
284,
8735,
852,
486,
2258,
543,
262,
3601,
1364,
2877,
15997,
1507,
220,
19,
13,
353,
220,
18,
13,
488,
220,
19,
58957,
262,
3601,
1364,
1883,
15997,
1507,
220,
19,
13,
353,
10293,
17,
6138,
488,
220,
16,
58957,
262,
2060,
10714,
10297,
450,
92734,
11,
7622,
15253,
1106,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_connection_by_wrong_address() {
let pool = Pool::new("tcp://badaddr:9000");
let done = pool.get_handle().and_then(ClientHandle::ping).map(|_| ());
run(done).unwrap_err();
} | rust_cleaned_test_functions.jsonl/30927 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 86
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15866,
3710,
75198,
6744,
368,
341,
262,
1077,
7314,
284,
22728,
486,
931,
445,
27161,
1110,
13855,
6214,
25,
24,
15,
15,
15,
797,
262,
1077,
2814,
284,
7314,
670,
10630,
1005,
437,
68367,
46851,
6999,
486,
9989,
568,
2186,
22428,
35395,
89684,
262,
1598,
34232,
568,
15454,
9266,
543,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_parse_csi_special_key_code() {
assert_eq!(
parse_csi_special_key_code(b"\x1B[3~").unwrap(),
Some(InternalEvent::Event(Event::Key(KeyCode::Delete.into()))),
);
} | rust_cleaned_test_functions.jsonl/21328 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 121
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
666,
6321,
41629,
3097,
4136,
368,
341,
286,
2060,
10714,
33673,
310,
4715,
666,
6321,
41629,
3097,
4136,
1883,
11934,
87,
16,
33,
58,
18,
93,
1827,
15454,
3148,
310,
4329,
7,
11569,
1556,
486,
1556,
30469,
486,
1592,
41040,
486,
6435,
39860,
10131,
1326,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_axs() {
let code = vec![0x87, 0x01];
let mut nes = Cpu::new();
let mut memory = new_memory(code);
nes.X = 0x12;
nes.A = 0x46;
nes.next(&mut memory).unwrap();
assert_eq!(0x02, memory.get(0x01));
assert_eq!(0, nes.N);
assert_eq!(0, nes.Z);
} | rust_cleaned_test_functions.jsonl/38741 | {
"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,
42385,
82,
368,
341,
286,
1077,
2038,
284,
7486,
20703,
15,
87,
23,
22,
11,
220,
15,
87,
15,
16,
935,
286,
1077,
5206,
308,
288,
284,
356,
5584,
486,
931,
543,
286,
1077,
5206,
4938,
284,
501,
19195,
15842,
626,
286,
308,
288,
4338,
284,
220,
15,
87,
16,
17,
280,
286,
308,
288,
875,
284,
220,
15,
87,
19,
21,
280,
286,
308,
288,
4529,
2099,
6984,
4938,
568,
15454,
543,
286,
2060,
10714,
10297,
15,
87,
15,
17,
11,
4938,
670,
7,
15,
87,
15,
16,
1106,
286,
2060,
10714,
10297,
15,
11,
308,
288,
2067,
317,
286,
2060,
10714,
10297,
15,
11,
308,
288,
13476,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ipc_ser_der() {
use xi_trace::*;
let trace = Trace::enabled(Config::with_limit_count(10));
trace.instant("sample1", &["test", "chrome"]);
trace.instant_payload("sample2", &["test", "chrome"], to_payload("payload 2"));
trace.instant_payload("sample3", &["test", "chrome"], to_payload("payload 3"));
trace.closure_payload("sample4", &["test", "chrome"],|| (), to_payload("payload 4"));
let samples = trace.samples_cloned_unsorted();
let serialized = ipc::serialize_to_bytes(&samples).unwrap();
let deserialized = ipc::deserialize_from_bytes(&serialized).unwrap();
assert_eq!(deserialized.len(), samples.len());
for i in 0..deserialized.len() {
assert_eq!(deserialized[i], samples[i])
}
} | rust_cleaned_test_functions.jsonl/132309 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 360
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
83806,
75861,
35345,
368,
341,
286,
990,
37590,
23575,
79304,
286,
1077,
11655,
284,
27163,
486,
15868,
33687,
486,
4197,
14763,
3180,
7,
16,
15,
1106,
286,
11655,
89108,
445,
13611,
16,
497,
609,
1183,
1944,
497,
330,
31902,
15049,
286,
11655,
89108,
32813,
445,
13611,
17,
497,
609,
1183,
1944,
497,
330,
31902,
7914,
311,
32813,
445,
19427,
220,
17,
4010,
286,
11655,
89108,
32813,
445,
13611,
18,
497,
609,
1183,
1944,
497,
330,
31902,
7914,
311,
32813,
445,
19427,
220,
18,
4010,
286,
11655,
520,
11653,
32813,
445,
13611,
19,
497,
609,
1183,
1944,
497,
330,
31902,
7914,
8484,
38104,
311,
32813,
445,
19427,
220,
19,
14929,
286,
1077,
10469,
284,
11655,
62207,
6794,
19684,
4907,
28298,
1428,
286,
1077,
32916,
284,
60104,
486,
24166,
2346,
12524,
2099,
41118,
568,
15454,
543,
286,
1077,
939,
67577,
284,
60104,
486,
66777,
5673,
12524,
2099,
75277,
568,
15454,
1428,
286,
2060,
10714,
10297,
5799,
67577,
19406,
1507,
10469,
19406,
1423,
286,
369,
600,
304,
220,
15,
496,
5799,
67577,
19406,
368,
341,
310,
2060,
10714,
10297,
5799,
67577,
989,
1125,
10469,
989,
2546,
286,
456,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_msg() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin(BIN_NAME)?;
cmd.arg("--json").arg("decode")
.arg("msg").arg("tests/samples/wallet.boc")
.arg("--abi").arg("tests/samples/wallet.abi.json");
cmd.assert()
.success()
.stdout(predicate::str::contains("sendTransaction"))
.stdout(predicate::str::contains("dest"))
.stdout(predicate::str::contains("value"))
.stdout(predicate::str::contains("bounce"));
Ok(())
} | rust_cleaned_test_functions.jsonl/118328 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 242
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15227,
6483,
368,
1464,
5714,
68843,
8261,
92846,
1460,
486,
841,
486,
1454,
2452,
341,
262,
1077,
5206,
5439,
284,
7348,
486,
66715,
21816,
5349,
687,
4708,
40007,
262,
5439,
21186,
21549,
2236,
1827,
858,
445,
18196,
1138,
286,
659,
858,
445,
3236,
1827,
858,
445,
23841,
2687,
4023,
6324,
7464,
948,
509,
1138,
286,
659,
858,
21549,
25084,
1827,
858,
445,
23841,
2687,
4023,
6324,
7464,
22048,
72,
4323,
797,
262,
5439,
3713,
741,
286,
659,
5630,
741,
286,
659,
36358,
76172,
486,
495,
486,
13372,
445,
6681,
8070,
5455,
286,
659,
36358,
76172,
486,
495,
486,
13372,
445,
4979,
5455,
286,
659,
36358,
76172,
486,
495,
486,
13372,
445,
957,
5455,
286,
659,
36358,
76172,
486,
495,
486,
13372,
445,
64302,
14929,
262,
7622,
50432,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_const() {
ok("const foo: Int = 0;");
err(
"const foo: Int = 0; fun foo() {}",
pos(1, 21),
SemError::ShadowConst("foo".into()),
);
err(
"const foo: Int = 0; class foo {}",
pos(1, 21),
SemError::ShadowConst("foo".into()),
);
err(
"const foo: Int = 0; struct foo {}",
pos(1, 21),
SemError::ShadowConst("foo".into()),
);
} | rust_cleaned_test_functions.jsonl/24600 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 293
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13610,
368,
341,
286,
5394,
445,
1024,
15229,
25,
1333,
284,
220,
15,
34649,
286,
1848,
1006,
310,
330,
1024,
15229,
25,
1333,
284,
220,
15,
26,
2464,
15229,
368,
4687,
756,
310,
1133,
7,
16,
11,
220,
17,
16,
1326,
310,
14248,
1454,
486,
23667,
19167,
445,
7975,
3263,
18122,
14702,
286,
1439,
286,
1848,
1006,
310,
330,
1024,
15229,
25,
1333,
284,
220,
15,
26,
536,
15229,
4687,
756,
310,
1133,
7,
16,
11,
220,
17,
16,
1326,
310,
14248,
1454,
486,
23667,
19167,
445,
7975,
3263,
18122,
14702,
286,
1439,
286,
1848,
1006,
310,
330,
1024,
15229,
25,
1333,
284,
220,
15,
26,
2036,
15229,
4687,
756,
310,
1133,
7,
16,
11,
220,
17,
16,
1326,
310,
14248,
1454,
486,
23667,
19167,
445,
7975,
3263,
18122,
14702,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_types_url_1() {
let module_url = Url::parse("https://example.com/mod.js").unwrap();
let source_code = b"console.log(\"foo\");".to_owned();
let result = get_types_url(&module_url, &source_code, None);
assert_eq!(result, None);
} | rust_cleaned_test_functions.jsonl/81712 | {
"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,
3062,
9763,
2903,
62,
16,
368,
341,
262,
1077,
4688,
2903,
284,
22840,
486,
6400,
445,
2428,
1110,
8687,
905,
38479,
2857,
1827,
15454,
543,
262,
1077,
2530,
4136,
284,
293,
1,
5354,
1665,
36014,
7975,
59,
5038,
3263,
983,
51973,
543,
262,
1077,
1102,
284,
633,
9763,
2903,
2099,
4352,
2903,
11,
609,
2427,
4136,
11,
2240,
317,
262,
2060,
10714,
10297,
1382,
11,
2240,
317,
220,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_incompatible() -> anyhow::Result<()> {
let db_info = new_db_info();
let mut p = db_info.to_pb()?;
p.ver = 2;
p.min_compatible = 2;
let res = mt::DatabaseInfo::from_pb(p);
assert_eq!(
Incompatible {
reason: s("executable ver=1 is smaller than the message min compatible ver: 2")
},
res.unwrap_err()
);
let db_info = new_db_info();
let mut p = db_info.to_pb()?;
p.ver = 0;
p.min_compatible = 0;
let res = mt::DatabaseInfo::from_pb(p);
assert_eq!(
Incompatible {
reason: s("message ver=0 is smaller than executable min compatible ver: 1")
},
res.unwrap_err()
);
Ok(())
} | rust_cleaned_test_functions.jsonl/59621 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 341
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1243,
34842,
368,
1464,
88964,
486,
2077,
71698,
341,
262,
1077,
2927,
3109,
284,
501,
8685,
3109,
543,
262,
1077,
5206,
281,
284,
2927,
3109,
2389,
31409,
94136,
262,
281,
67667,
284,
220,
17,
280,
262,
281,
4358,
2965,
37079,
284,
220,
17,
401,
262,
1077,
592,
284,
11965,
486,
5988,
1731,
486,
1499,
31409,
1295,
317,
262,
2060,
10714,
33673,
286,
758,
34842,
341,
310,
2874,
25,
274,
445,
95924,
2739,
28,
16,
374,
9155,
1091,
279,
1943,
1308,
18146,
2739,
25,
220,
17,
1138,
286,
1153,
286,
592,
55395,
9266,
741,
262,
3475,
262,
1077,
2927,
3109,
284,
501,
8685,
3109,
543,
262,
1077,
5206,
281,
284,
2927,
3109,
2389,
31409,
94136,
262,
281,
67667,
284,
220,
15,
280,
262,
281,
4358,
2965,
37079,
284,
220,
15,
401,
262,
1077,
592,
284,
11965,
486,
5988,
1731,
486,
1499,
31409,
1295,
317,
262,
2060,
10714,
33673,
286,
758,
34842,
341,
310,
2874,
25,
274,
445,
1994,
2739,
28,
15,
374,
9155,
1091,
32156,
1308,
18146,
2739,
25,
220,
16,
1138,
286,
1153,
286,
592,
55395,
9266,
741,
262,
3475,
262,
7622,
50432,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_native_types_round_trip() {
assert_eq!(
42i32,
i32::from_native(i32::from_binary((42i32).to_native().to_binary()))
);
assert_eq!(
-42i32,
i32::from_native(i32::from_binary((-42i32).to_native().to_binary()))
);
use std::i64;
let xi64 = i64::MAX;
assert_eq!(
xi64,
i64::from_native(i64::from_binary((xi64).to_native().to_binary()))
);
let yi64 = i64::MIN;
assert_eq!(
yi64,
i64::from_native(i64::from_binary((yi64).to_native().to_binary()))
);
assert_eq!(
16.5f32,
f32::from_native(f32::from_binary((16.5f32).to_native().to_binary()))
);
assert_eq!(
-16.5f32,
f32::from_native(f32::from_binary((-16.5f32).to_native().to_binary()))
);
use std::f64;
let xf64: f64 = f64::MAX;
assert_eq!(
xf64,
f64::from_native(f64::from_binary((xf64).to_native().to_binary()))
);
let yf64: f64 = f64::MIN;
assert_eq!(
yf64,
f64::from_native(f64::from_binary((yf64).to_native().to_binary()))
);
} | rust_cleaned_test_functions.jsonl/109154 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 759
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
44494,
9763,
29896,
63883,
368,
341,
286,
2060,
10714,
33673,
310,
220,
19,
17,
72,
18,
17,
345,
310,
600,
18,
17,
486,
1499,
44494,
1956,
18,
17,
486,
1499,
31761,
1188,
19,
17,
72,
18,
17,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
3475,
286,
2060,
10714,
33673,
310,
481,
19,
17,
72,
18,
17,
345,
310,
600,
18,
17,
486,
1499,
44494,
1956,
18,
17,
486,
1499,
31761,
54934,
19,
17,
72,
18,
17,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
3475,
286,
990,
1460,
486,
72,
21,
19,
280,
286,
1077,
37590,
21,
19,
284,
600,
21,
19,
486,
10586,
280,
286,
2060,
10714,
33673,
310,
37590,
21,
19,
345,
310,
600,
21,
19,
486,
1499,
44494,
1956,
21,
19,
486,
1499,
31761,
1188,
11665,
21,
19,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
1439,
286,
1077,
61697,
21,
19,
284,
600,
21,
19,
486,
16413,
280,
286,
2060,
10714,
33673,
310,
61697,
21,
19,
345,
310,
600,
21,
19,
486,
1499,
44494,
1956,
21,
19,
486,
1499,
31761,
1188,
38072,
21,
19,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
3475,
286,
2060,
10714,
33673,
310,
220,
16,
21,
13,
20,
69,
18,
17,
345,
310,
282,
18,
17,
486,
1499,
44494,
955,
18,
17,
486,
1499,
31761,
1188,
16,
21,
13,
20,
69,
18,
17,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
3475,
286,
2060,
10714,
33673,
310,
481,
16,
21,
13,
20,
69,
18,
17,
345,
310,
282,
18,
17,
486,
1499,
44494,
955,
18,
17,
486,
1499,
31761,
54934,
16,
21,
13,
20,
69,
18,
17,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
3475,
286,
990,
1460,
486,
69,
21,
19,
280,
286,
1077,
59364,
21,
19,
25,
282,
21,
19,
284,
282,
21,
19,
486,
10586,
280,
286,
2060,
10714,
33673,
310,
59364,
21,
19,
345,
310,
282,
21,
19,
486,
1499,
44494,
955,
21,
19,
486,
1499,
31761,
1188,
5848,
21,
19,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
3475,
286,
1077,
379,
69,
21,
19,
25,
282,
21,
19,
284,
282,
21,
19,
486,
16413,
280,
286,
2060,
10714,
33673,
310,
379,
69,
21,
19,
345,
310,
282,
21,
19,
486,
1499,
44494,
955,
21,
19,
486,
1499,
31761,
1188,
88,
69,
21,
19,
568,
983,
44494,
1005,
983,
31761,
12145,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_rule_filtering_with_partials() -> TestResult {
let p = Polar::new();
p.load_str(
r#"f(x) if g(x.c);
g(y: B) if y.b > 0;
g(y: C{foo: 1, bar: 2}) if y.c > 0;
h(y: A{foo: 1}) if i(y.b);
i(y: C) if y.c > 0;
i(y: B{bar: 2}) if y.b > 0;
# traversing `in` is tough!
r(a: A) if b in a.b and t(b);
s(a: A) if b in a.b and b matches B and u(b.c);
# This is still incorrect
# this should be equivalent to `s`
s_bad(a: A) if b in a.b and u(b.c);
t(b: B) if b.foo = 1;
t(b: C) if b.foo = 2;
u(c: C) if c.bar = 1;
u(c: D) if c.bar = 2;
# the rebinding here sometimes trips up the simplifier
# PR: https://github.com/osohq/oso/pull/1289
a(x: A) if y = x.b and b(y);
b(b: B) if b.z = 1;
b(c: C) if c.z = 2;
"#,
)?;
#[track_caller]
fn next_binding(q: &mut Query) -> Bindings {
loop {
match q.next_event().unwrap() {
QueryEvent::Result { bindings, .. } => return bindings,
QueryEvent::ExternalIsSubclass { call_id, .. } => {
q.question_result(call_id, false).unwrap();
}
QueryEvent::ExternalIsaWithPath {
call_id,
path,
class_tag,
..
} => {
let last_segment = path.last().unwrap();
q.question_result(
call_id,
last_segment.value().as_string().unwrap().to_uppercase() == class_tag.0,
)
.unwrap();
}
QueryEvent::None => (),
e => panic!("not bindings: {:?}", e),
}
}
}
// Register `x` as a partial.
p.register_constant(
sym!("x"),
op!(
And,
op!(Isa, term!(sym!("x")), term!(pattern!(instance!("A")))).into()
)
.into(),
)?;
let mut q = p.new_query_from_term(term!(call!("f", [sym!("x")])), false);
assert_partial_expression!(
next_binding(&mut q),
"x",
"_this matches A{} and _this.c matches C{} and _this.c.foo = 1 and _this.c.bar = 2 and _this.c.c > 0"
);
assert_query_done!(q);
let mut q = p.new_query_from_term(term!(call!("h", [sym!("y")])), false);
assert_partial_expression!(
next_binding(&mut q),
"y",
"_this matches A{} and _this.foo = 1 and _this.b matches B{} and _this.b.bar = 2 and _this.b.b > 0"
);
assert_query_done!(q);
let mut q = p.new_query_from_term(term!(call!("a", [sym!("x")])), false);
assert_partial_expression!(
next_binding(&mut q),
"x",
"_this matches A{} and _this.b matches B{} and 1 = _this.b.z"
);
assert_query_done!(q);
let mut q = p.new_query_from_term(term!(call!("r", [sym!("x")])), false);
assert_partial_expression!(
next_binding(&mut q),
"x",
"_this matches A{} and _b_74 in _this.b and _b_74 matches B{} and 1 = _b_74.foo"
);
assert_query_done!(q);
let mut q = p.new_query_from_term(term!(call!("s", [sym!("x")])), false);
assert_partial_expression!(
next_binding(&mut q),
"x",
"_this matches A{} and _b_84 in _this.b and _b_84 matches B{} and _b_84.c matches C{} and 1 = _b_84.c.bar"
);
assert_query_done!(q);
let mut q = p.new_query_from_term(term!(call!("s_bad", [sym!("x")])), false);
assert_partial_expression!(
next_binding(&mut q),
"x",
"_this matches A{} and _b_104 in _this.b and _b_104.c matches C{} and 1 = _b_104.c.bar"
);
// that `_b_104` matches B{} by checking `a.b` first
assert_partial_expression!(
next_binding(&mut q),
"x",
"_this matches A{} and _b_104 in _this.b and _b_104.c matches D{} and 2 = _b_104.c.bar"
);
assert_query_done!(q);
Ok(())
} | rust_cleaned_test_functions.jsonl/63018 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2726
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21124,
8727,
287,
6615,
10495,
10309,
368,
1464,
3393,
2077,
341,
286,
1077,
281,
284,
55896,
486,
931,
543,
286,
281,
5104,
2895,
1006,
310,
435,
55543,
69,
2075,
8,
421,
342,
2075,
520,
317,
2290,
342,
7021,
25,
425,
8,
421,
379,
948,
861,
220,
15,
280,
2290,
342,
7021,
25,
356,
90,
7975,
25,
220,
16,
11,
3619,
25,
220,
17,
5410,
421,
379,
520,
861,
220,
15,
401,
2290,
305,
7021,
25,
362,
90,
7975,
25,
220,
16,
5410,
421,
600,
7021,
948,
317,
2290,
600,
7021,
25,
356,
8,
421,
379,
520,
861,
220,
15,
280,
2290,
600,
7021,
25,
425,
90,
2257,
25,
220,
17,
5410,
421,
379,
948,
861,
220,
15,
401,
2290,
671,
29417,
287,
1565,
258,
63,
374,
11045,
4894,
2290,
435,
2877,
25,
362,
8,
421,
293,
304,
264,
948,
323,
259,
1883,
317,
2290,
274,
2877,
25,
362,
8,
421,
293,
304,
264,
948,
323,
293,
9071,
425,
323,
575,
1883,
520,
317,
2290,
671,
1096,
374,
2058,
15114,
198,
2290,
671,
419,
1265,
387,
13578,
311,
1565,
82,
3989,
2290,
274,
34199,
2877,
25,
362,
8,
421,
293,
304,
264,
948,
323,
575,
1883,
520,
317,
2290,
259,
1883,
25,
425,
8,
421,
293,
58432,
284,
220,
16,
280,
2290,
259,
1883,
25,
356,
8,
421,
293,
58432,
284,
220,
17,
280,
2290,
575,
1337,
25,
356,
8,
421,
272,
22001,
284,
220,
16,
280,
2290,
575,
1337,
25,
422,
8,
421,
272,
22001,
284,
220,
17,
401,
2290,
671,
279,
12366,
3961,
1588,
7025,
22466,
705,
279,
15491,
3049,
198,
2290,
671,
8575,
25,
3703,
1110,
5204,
905,
57892,
2267,
80,
14,
27147,
4322,
617,
14,
16,
17,
23,
24,
198,
2290,
264,
2075,
25,
362,
8,
421,
379,
284,
856,
948,
323,
293,
7021,
317,
2290,
293,
1883,
25,
425,
8,
421,
293,
3938,
284,
220,
16,
280,
2290,
293,
1337,
25,
356,
8,
421,
272,
3938,
284,
220,
17,
280,
2290,
5869,
345,
286,
873,
69493,
286,
11506,
13131,
13429,
261,
921,
286,
5168,
1790,
60815,
10583,
25,
609,
6984,
11361,
8,
1464,
29189,
819,
341,
310,
6337,
341,
394,
2432,
2804,
4529,
6748,
1005,
15454,
368,
341,
503,
11361,
1556,
486,
2077,
314,
35700,
11,
5241,
335,
589,
470,
35700,
345,
503,
11361,
1556,
486,
25913,
3872,
3136,
1040,
314,
1618,
842,
11,
5241,
335,
589,
341,
664,
2804,
31746,
5287,
32691,
842,
11,
895,
568,
15454,
543,
503,
456,
503,
11361,
1556,
486,
25913,
3872,
64,
89534,
341,
664,
1618,
842,
345,
664,
1815,
345,
664,
536,
9372,
345,
664,
54538,
503,
335,
589,
341,
664,
1077,
1537,
28061,
284,
1815,
9110,
1005,
15454,
543,
664,
2804,
31746,
5287,
1006,
999,
1618,
842,
345,
999,
1537,
28061,
2824,
1005,
300,
3904,
1005,
15454,
1005,
983,
34445,
5638,
368,
621,
536,
9372,
13,
15,
345,
664,
1727,
664,
659,
15454,
543,
503,
456,
503,
11361,
1556,
486,
4064,
589,
84201,
503,
384,
589,
21975,
17223,
1921,
35700,
25,
71964,
384,
1326,
394,
456,
310,
456,
286,
555,
286,
442,
8451,
1565,
87,
63,
438,
264,
7130,
624,
286,
281,
9929,
34967,
1006,
310,
7886,
17223,
87,
4461,
310,
1179,
33673,
394,
1597,
345,
394,
1179,
10297,
3872,
64,
11,
4647,
10297,
23802,
17223,
87,
35674,
4647,
10297,
14339,
10297,
4851,
17223,
32,
2761,
4579,
18122,
741,
310,
1727,
310,
659,
18122,
3148,
286,
873,
69493,
286,
1077,
5206,
2804,
284,
281,
4618,
5738,
5673,
17464,
44654,
10297,
6659,
17223,
69,
497,
508,
23802,
17223,
87,
30917,
5731,
895,
317,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
87,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
574,
520,
9071,
356,
6257,
323,
716,
574,
520,
58432,
284,
220,
16,
323,
716,
574,
520,
22001,
284,
220,
17,
323,
716,
574,
520,
520,
861,
220,
15,
698,
286,
1439,
286,
2060,
5738,
24390,
10297,
80,
626,
286,
1077,
5206,
2804,
284,
281,
4618,
5738,
5673,
17464,
44654,
10297,
6659,
17223,
71,
497,
508,
23802,
17223,
88,
30917,
5731,
895,
317,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
88,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
574,
58432,
284,
220,
16,
323,
716,
574,
948,
9071,
425,
6257,
323,
716,
574,
948,
22001,
284,
220,
17,
323,
716,
574,
948,
948,
861,
220,
15,
698,
286,
1439,
286,
2060,
5738,
24390,
10297,
80,
626,
286,
1077,
5206,
2804,
284,
281,
4618,
5738,
5673,
17464,
44654,
10297,
6659,
17223,
64,
497,
508,
23802,
17223,
87,
30917,
5731,
895,
317,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
87,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
574,
948,
9071,
425,
6257,
323,
220,
16,
284,
716,
574,
948,
3938,
698,
286,
1439,
286,
2060,
5738,
24390,
10297,
80,
626,
286,
1077,
5206,
2804,
284,
281,
4618,
5738,
5673,
17464,
44654,
10297,
6659,
17223,
81,
497,
508,
23802,
17223,
87,
30917,
5731,
895,
317,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
87,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
65,
62,
22,
19,
304,
716,
574,
948,
323,
716,
65,
62,
22,
19,
9071,
425,
6257,
323,
220,
16,
284,
716,
65,
62,
22,
19,
58432,
698,
286,
1439,
286,
2060,
5738,
24390,
10297,
80,
626,
286,
1077,
5206,
2804,
284,
281,
4618,
5738,
5673,
17464,
44654,
10297,
6659,
17223,
82,
497,
508,
23802,
17223,
87,
30917,
5731,
895,
317,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
87,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
65,
62,
23,
19,
304,
716,
574,
948,
323,
716,
65,
62,
23,
19,
9071,
425,
6257,
323,
716,
65,
62,
23,
19,
520,
9071,
356,
6257,
323,
220,
16,
284,
716,
65,
62,
23,
19,
520,
22001,
698,
286,
1439,
286,
2060,
5738,
24390,
10297,
80,
626,
286,
1077,
5206,
2804,
284,
281,
4618,
5738,
5673,
17464,
44654,
10297,
6659,
17223,
82,
34199,
497,
508,
23802,
17223,
87,
30917,
5731,
895,
317,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
87,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
65,
62,
16,
15,
19,
304,
716,
574,
948,
323,
716,
65,
62,
16,
15,
19,
520,
9071,
356,
6257,
323,
220,
16,
284,
716,
65,
62,
16,
15,
19,
520,
22001,
698,
286,
1439,
1789,
286,
442,
429,
91621,
65,
62,
16,
15,
19,
63,
9071,
425,
6257,
553,
13295,
1565,
64,
948,
63,
1156,
8945,
286,
2060,
52068,
28068,
33673,
310,
1790,
60815,
2099,
6984,
2804,
1326,
310,
330,
87,
756,
310,
9000,
574,
9071,
362,
6257,
323,
716,
65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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_rhyme() {
let test_syl = test_syl();
assert_eq!(test_syl.rhyme(), vec![phon("ɑ"), phon("p")])
} | rust_cleaned_test_functions.jsonl/125893 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 79
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1710,
71,
30118,
368,
341,
286,
1077,
1273,
643,
3923,
284,
1273,
643,
3923,
543,
286,
2060,
10714,
10297,
1944,
643,
3923,
1746,
71,
30118,
1507,
7486,
20703,
51701,
445,
144528,
3975,
50823,
445,
79,
899,
2546,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ref_mut() {
let anyof: &mut AnyOf<MyTrait> = &mut AnyOf::new(MyStruct1(0i32));
anyof.set(1i32);
assert_eq!(anyof.get(), 1i32);
assert_eq!(anyof.downcast_ref::<MyStruct1>(), Some(&MyStruct1(1i32)));
assert_eq!(anyof.downcast_ref::<MyStruct2>(), None);
assert_eq!(anyof.downcast_mut::<MyStruct1>(), Some(&mut MyStruct1(1i32)));
assert_eq!(anyof.downcast_mut::<MyStruct2>(), None);
let anyof: &mut AnyOf<MyTrait> = &mut AnyOf::new(MyStruct2(0i32));
anyof.set(1i32);
assert_eq!(anyof.get(), 2i32);
assert_eq!(anyof.downcast_ref::<MyStruct1>(), None);
assert_eq!(anyof.downcast_ref::<MyStruct2>(), Some(&MyStruct2(1i32)));
assert_eq!(anyof.downcast_mut::<MyStruct1>(), None);
assert_eq!(anyof.downcast_mut::<MyStruct2>(), Some(&mut MyStruct2(1i32)));
} | rust_cleaned_test_functions.jsonl/66298 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 446
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7793,
29523,
368,
341,
286,
1077,
894,
1055,
25,
609,
6984,
5765,
2124,
79333,
49257,
29,
284,
609,
6984,
5765,
2124,
486,
931,
37485,
9422,
16,
7,
15,
72,
18,
17,
1106,
286,
894,
1055,
980,
7,
16,
72,
18,
17,
317,
286,
2060,
10714,
10297,
3767,
1055,
670,
1507,
220,
16,
72,
18,
17,
317,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
7793,
27638,
5050,
9422,
16,
39019,
4329,
2099,
5050,
9422,
16,
7,
16,
72,
18,
17,
4945,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
7793,
27638,
5050,
9422,
17,
39019,
2240,
317,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
29523,
27638,
5050,
9422,
16,
39019,
4329,
2099,
6984,
3017,
9422,
16,
7,
16,
72,
18,
17,
4945,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
29523,
27638,
5050,
9422,
17,
39019,
2240,
317,
286,
1077,
894,
1055,
25,
609,
6984,
5765,
2124,
79333,
49257,
29,
284,
609,
6984,
5765,
2124,
486,
931,
37485,
9422,
17,
7,
15,
72,
18,
17,
1106,
286,
894,
1055,
980,
7,
16,
72,
18,
17,
317,
286,
2060,
10714,
10297,
3767,
1055,
670,
1507,
220,
17,
72,
18,
17,
317,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
7793,
27638,
5050,
9422,
16,
39019,
2240,
317,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
7793,
27638,
5050,
9422,
17,
39019,
4329,
2099,
5050,
9422,
17,
7,
16,
72,
18,
17,
4945,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
29523,
27638,
5050,
9422,
16,
39019,
2240,
317,
286,
2060,
10714,
10297,
3767,
1055,
18148,
3829,
29523,
27638,
5050,
9422,
17,
39019,
4329,
2099,
6984,
3017,
9422,
17,
7,
16,
72,
18,
17,
4945,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_mandatoryprefix_try_from_usize() {
for value in MandatoryPrefix::values() {
let converted = <MandatoryPrefix as TryFrom<usize>>::try_from(value as usize).unwrap();
assert_eq!(converted, value);
}
assert!(<MandatoryPrefix as TryFrom<usize>>::try_from(IcedConstants::MANDATORY_PREFIX_ENUM_COUNT).is_err());
assert!(<MandatoryPrefix as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
} | rust_cleaned_test_functions.jsonl/5968 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 166
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
717,
62088,
11849,
53283,
5673,
11306,
551,
368,
341,
2023,
897,
304,
70782,
14335,
486,
3661,
368,
341,
197,
10217,
16099,
284,
366,
44,
62088,
14335,
438,
9735,
3830,
90244,
77595,
1539,
5673,
3679,
438,
22301,
568,
15454,
543,
197,
6948,
10714,
10297,
76204,
11,
897,
317,
197,
532,
6948,
10297,
27,
44,
62088,
14335,
438,
9735,
3830,
90244,
77595,
1539,
5673,
8972,
1998,
9386,
486,
24958,
87258,
18519,
31894,
14672,
568,
285,
9266,
1423,
6948,
10297,
27,
44,
62088,
14335,
438,
9735,
3830,
90244,
77595,
1539,
5673,
47867,
486,
51878,
486,
10586,
568,
285,
9266,
1423,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_for_array() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();
let script = r"
let sum1 = 0;
let sum2 = 0;
let inputs = [1, 2, 3, 4, 5];
for x in inputs {
sum1 += x;
}
for x in range(1, 6) {
sum2 += x;
}
for x in range(1, 6, 3) {
sum2 += x;
}
sum1 + sum2
";
assert_eq!(engine.eval::<INT>(script)?, 35);
Ok(())
} | rust_cleaned_test_functions.jsonl/16393 | {
"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,
5478,
3858,
368,
1464,
5714,
68843,
8261,
23835,
831,
26017,
2077,
2452,
341,
262,
1077,
4712,
284,
8200,
486,
931,
1428,
262,
1077,
5316,
284,
435,
698,
286,
1077,
2629,
16,
284,
220,
15,
280,
286,
1077,
2629,
17,
284,
220,
15,
280,
286,
1077,
11127,
284,
508,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
220,
20,
4821,
286,
369,
856,
304,
11127,
341,
310,
2629,
16,
1421,
856,
280,
286,
555,
286,
369,
856,
304,
2088,
7,
16,
11,
220,
21,
8,
341,
310,
2629,
17,
1421,
856,
280,
286,
555,
286,
369,
856,
304,
2088,
7,
16,
11,
220,
21,
11,
220,
18,
8,
341,
310,
2629,
17,
1421,
856,
280,
286,
555,
286,
2629,
16,
488,
2629,
17,
198,
262,
41620,
262,
2060,
10714,
10297,
8512,
31710,
27638,
3221,
2235,
2282,
11843,
11,
220,
18,
20,
626,
262,
7622,
50432,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_macro_expansion() {
compare(
r#"
grammar;
extern { enum Tok { "Id" => Id(..) } }
Two<X>: (X, X) = X X;
Ids = Two<"Id">;
"#,
vec![("Ids", "(Tok, Tok)"), (r#"Two<"Id">"#, "(Tok, Tok)")],
)
} | rust_cleaned_test_functions.jsonl/50467 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 143
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
58810,
14214,
10501,
368,
341,
262,
9429,
1006,
286,
435,
2,
698,
41094,
280,
262,
15637,
314,
7618,
21447,
314,
330,
764,
1,
589,
5223,
56422,
8,
335,
456,
262,
9043,
66758,
26818,
320,
55,
11,
1599,
8,
284,
1599,
1599,
280,
262,
5223,
82,
284,
9043,
98506,
764,
755,
280,
57676,
345,
286,
7486,
20703,
445,
12701,
497,
11993,
52854,
11,
21447,
8,
3975,
320,
81,
55543,
11613,
98506,
764,
755,
57676,
11,
11993,
52854,
11,
21447,
68191,
1259,
262,
1727,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_double() {
match Variant::VInteger(31).minus(Variant::VDouble(13.0)).unwrap() {
Variant::VDouble(result) => assert_eq!(result, 18.0),
_ => panic!("assertion failed"),
}
} | rust_cleaned_test_functions.jsonl/84569 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 155
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24598,
368,
341,
394,
2432,
39292,
486,
53,
3486,
7,
18,
16,
568,
38365,
12410,
15341,
486,
53,
7378,
7,
16,
18,
13,
15,
4579,
15454,
368,
341,
503,
39292,
486,
53,
7378,
4456,
8,
589,
2060,
10714,
10297,
1382,
11,
220,
16,
23,
13,
15,
1326,
503,
716,
589,
21975,
17223,
2207,
290,
4641,
4461,
394,
456,
310,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_cursor_next_entry() {
let info_buf = &entries_cursor_tests_debug_info_buf();
let debug_info = DebugInfo::new(info_buf, LittleEndian);
let unit = debug_info
.units()
.next()
.expect("should have a unit result")
.expect("and it should be ok");
let abbrevs_buf = &entries_cursor_tests_abbrev_buf();
let debug_abbrev = DebugAbbrev::new(abbrevs_buf, LittleEndian);
let abbrevs = unit
.abbreviations(&debug_abbrev)
.expect("Should parse abbreviations");
let mut cursor = unit.entries(&abbrevs);
assert_next_entry(&mut cursor, "001");
assert_next_entry(&mut cursor, "002");
assert_next_entry(&mut cursor, "003");
assert_next_entry_null(&mut cursor);
assert_next_entry_null(&mut cursor);
assert_next_entry(&mut cursor, "004");
assert_next_entry(&mut cursor, "005");
assert_next_entry_null(&mut cursor);
assert_next_entry(&mut cursor, "006");
assert_next_entry_null(&mut cursor);
assert_next_entry_null(&mut cursor);
assert_next_entry(&mut cursor, "007");
assert_next_entry(&mut cursor, "008");
assert_next_entry(&mut cursor, "009");
assert_next_entry_null(&mut cursor);
assert_next_entry_null(&mut cursor);
assert_next_entry_null(&mut cursor);
assert_next_entry(&mut cursor, "010");
assert_next_entry_null(&mut cursor);
assert_next_entry_null(&mut cursor);
assert!(cursor
.next_entry()
.expect("Should parse next entry")
.is_none());
assert!(cursor.current().is_none());
} | rust_cleaned_test_functions.jsonl/102066 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 787
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
28601,
11257,
9078,
368,
341,
286,
1077,
3546,
10363,
284,
609,
12940,
28601,
32509,
15446,
3109,
10363,
543,
286,
1077,
7390,
3109,
284,
11091,
1731,
486,
931,
14208,
10363,
11,
14671,
43231,
626,
286,
1077,
4982,
284,
7390,
3109,
198,
310,
659,
25643,
741,
310,
659,
3600,
741,
310,
659,
17119,
445,
5445,
614,
264,
4982,
1102,
1138,
310,
659,
17119,
445,
437,
432,
1265,
387,
5394,
3071,
286,
1077,
39515,
82,
10363,
284,
609,
12940,
28601,
32509,
62,
44272,
10363,
543,
286,
1077,
7390,
62,
44272,
284,
11091,
80219,
7282,
486,
931,
7,
44272,
82,
10363,
11,
14671,
43231,
626,
286,
1077,
39515,
82,
284,
4982,
198,
310,
659,
44272,
17144,
2099,
8349,
62,
44272,
340,
310,
659,
17119,
445,
14996,
4715,
39515,
17144,
3071,
286,
1077,
5206,
8128,
284,
4982,
35754,
2099,
44272,
82,
626,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
16,
797,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
17,
797,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
18,
797,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
19,
797,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
20,
797,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
21,
797,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
22,
797,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
23,
797,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
15,
24,
797,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
2099,
6984,
8128,
11,
330,
15,
16,
15,
797,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
317,
286,
2060,
11257,
9078,
15162,
2099,
6984,
8128,
626,
286,
2060,
10297,
17437,
198,
310,
659,
3600,
9078,
741,
310,
659,
17119,
445,
14996,
4715,
1790,
4343,
1138,
310,
659,
285,
31488,
1423,
286,
2060,
10297,
17437,
4952,
1005,
285,
31488,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_parse_with_multiple_hd() {
let s = "\
@HD\tVN:1.6\tSO:coordinate
@HD\tVN:1.6\tSO:coordinate
";
assert_eq!(parse(s), Err(ParseError::UnexpectedHeader));
} | rust_cleaned_test_functions.jsonl/8725 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 103
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
6615,
45233,
60111,
368,
341,
286,
1077,
274,
284,
93317,
31,
19147,
4955,
71961,
25,
16,
13,
21,
4955,
13880,
25,
62526,
198,
31,
19147,
4955,
71961,
25,
16,
13,
21,
4955,
13880,
25,
62526,
198,
3302,
286,
2060,
10714,
10297,
6400,
1141,
701,
15495,
71812,
1454,
486,
29430,
4047,
1106,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_parse() {
assert_eq!(
parse(
r"10 ORE => 1 A
9 ORE => 2 B"
),
vec![
("A", Reaction::new(1, vec![(10, "ORE")])),
("B", Reaction::new(2, vec![(9, "ORE")])),
]
.into_iter()
.collect()
);
} | rust_cleaned_test_functions.jsonl/96881 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 235
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
368,
341,
286,
2060,
10714,
33673,
310,
4715,
1006,
394,
435,
1,
16,
15,
506,
787,
589,
220,
16,
362,
198,
24,
506,
787,
589,
220,
17,
425,
698,
310,
2837,
310,
7486,
90515,
394,
3489,
32,
497,
66841,
486,
931,
7,
16,
11,
7486,
0,
9697,
16,
15,
11,
330,
5881,
30917,
6965,
394,
3489,
33,
497,
66841,
486,
931,
7,
17,
11,
7486,
0,
9697,
24,
11,
330,
5881,
30917,
6965,
310,
5133,
310,
659,
18122,
11723,
741,
310,
659,
17384,
741,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_delayed_write_rate() {
let path = tempdir_with_prefix("_rust_rocksdb_test_set_delayed_write_rate");
let mut opts = DBOptions::new();
opts.create_if_missing(true);
opts.set_delayed_write_rate(2 * 1024 * 1024);
let db = DB::open(opts, path.path().to_str().unwrap()).unwrap();
drop(db);
} | rust_cleaned_test_functions.jsonl/34087 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 147
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
22198,
291,
9165,
9246,
368,
341,
262,
1077,
1815,
284,
2730,
3741,
6615,
13974,
16975,
35788,
26608,
14553,
1999,
4452,
2602,
22198,
291,
9165,
9246,
797,
262,
1077,
5206,
12185,
284,
5952,
3798,
486,
931,
543,
262,
12185,
2520,
11119,
40447,
3715,
317,
262,
12185,
980,
22198,
291,
9165,
9246,
7,
17,
353,
220,
16,
15,
17,
19,
353,
220,
16,
15,
17,
19,
317,
262,
1077,
2927,
284,
5952,
486,
2508,
30885,
11,
1815,
3875,
1005,
983,
2895,
1005,
15454,
6011,
15454,
543,
262,
5943,
9791,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_witness() {
let mut t = RbTree::<Vec<u8>, Vec<u8>>::new();
for i in 0u64..10 {
let key = (1 + 2 * i).to_be_bytes();
let val = (1 + 2 * i).to_le_bytes();
insert(&mut t, key, val);
assert_eq!(t.get(&key[..]).map(|v| &v[..]), Some(&val[..]));
}
for i in 0u64..10 {
let key = (1 + 2 * i).to_be_bytes();
let ht = t.witness(&key[..]);
assert_eq!(
ht.reconstruct(),
t.root_hash(),
"key: {}, witness {:?}",
hex::encode(key),
ht
);
let ht = t.keys_with_prefix(&key[..]);
assert_eq!(
ht.reconstruct(),
t.root_hash(),
"key: {}, left neighbor: {:?}, right neighbor: {:?}, witness {:?}",
hex::encode(key),
t.left_neighbor(&key[..]).map(hex::encode),
t.right_prefix_neighbor(&key[..]).map(hex::encode),
ht
);
}
for i in 0u64..10 {
for j in i..10 {
let start = (2 * i).to_be_bytes();
let end = (2 * j).to_be_bytes();
let ht = t.key_range(&start[..], &end[..]);
assert_eq!(
ht.reconstruct(),
t.root_hash(),
"key range: [{}, {}], witness {:?}",
hex::encode(&start[..]),
hex::encode(&end[..]),
ht
);
}
}
for i in 0u64..11 {
let key = (2 * i).to_be_bytes();
let ht = t.witness(&key[..]);
assert_eq!(
ht.reconstruct(),
t.root_hash(),
"key: {}, witness {:?}",
hex::encode(&key[..]),
ht
);
}
for i in 0u64..10 {
let key = (1 + 2 * i).to_be_bytes();
let val = (1 + 2 * i).to_le_bytes();
assert_eq!(t.get(&key[..]).map(|v| &v[..]), Some(&val[..]));
t.delete(&key[..]);
for j in 0u64..10 {
let witness_key = (1 + 2 * j).to_be_bytes();
let ht = t.witness(&witness_key[..]);
assert_eq!(
ht.reconstruct(),
t.root_hash(),
"key: {}, witness {:?}",
hex::encode(&key[..]),
ht
);
}
assert_eq!(t.get(&key[..]), None);
}
} | rust_cleaned_test_functions.jsonl/57901 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1400
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1670,
8091,
368,
341,
262,
1077,
5206,
259,
284,
431,
65,
6533,
27638,
10050,
34837,
23,
8066,
11312,
34837,
23,
77595,
931,
543,
262,
369,
600,
304,
220,
15,
84,
21,
19,
496,
16,
15,
341,
286,
1077,
1376,
284,
320,
16,
488,
220,
17,
353,
600,
568,
983,
21263,
12524,
543,
286,
1077,
1044,
284,
320,
16,
488,
220,
17,
353,
600,
568,
983,
11751,
12524,
543,
286,
5656,
2099,
6984,
259,
11,
1376,
11,
1044,
317,
286,
2060,
10714,
10297,
83,
670,
2099,
792,
95874,
10697,
2186,
22428,
85,
91,
609,
85,
95874,
9719,
4329,
2099,
831,
95874,
14382,
262,
555,
262,
369,
600,
304,
220,
15,
84,
21,
19,
496,
16,
15,
341,
286,
1077,
1376,
284,
320,
16,
488,
220,
17,
353,
600,
568,
983,
21263,
12524,
543,
286,
1077,
34323,
284,
259,
1418,
8091,
2099,
792,
95874,
2558,
286,
2060,
10714,
33673,
310,
34323,
1327,
7596,
3148,
310,
259,
12576,
8950,
3148,
310,
330,
792,
25,
16452,
11298,
22069,
30,
24375,
310,
12371,
486,
6180,
4857,
1326,
310,
34323,
198,
286,
3475,
286,
1077,
34323,
284,
259,
9123,
6615,
13974,
2099,
792,
95874,
2558,
286,
2060,
10714,
33673,
310,
34323,
1327,
7596,
3148,
310,
259,
12576,
8950,
3148,
310,
330,
792,
25,
16452,
2115,
9565,
25,
22069,
30,
2137,
1290,
9565,
25,
22069,
30,
2137,
11298,
22069,
30,
24375,
310,
12371,
486,
6180,
4857,
1326,
310,
259,
8272,
71888,
2099,
792,
95874,
10697,
2186,
44660,
486,
6180,
1326,
310,
259,
9517,
13974,
71888,
2099,
792,
95874,
10697,
2186,
44660,
486,
6180,
1326,
310,
34323,
198,
286,
1439,
262,
555,
262,
369,
600,
304,
220,
15,
84,
21,
19,
496,
16,
15,
341,
286,
369,
502,
304,
600,
496,
16,
15,
341,
310,
1077,
1191,
284,
320,
17,
353,
600,
568,
983,
21263,
12524,
543,
310,
1077,
835,
284,
320,
17,
353,
502,
568,
983,
21263,
12524,
543,
310,
1077,
34323,
284,
259,
4735,
9698,
2099,
2468,
95874,
1125,
609,
408,
95874,
2558,
310,
2060,
10714,
33673,
394,
34323,
1327,
7596,
3148,
394,
259,
12576,
8950,
3148,
394,
330,
792,
2088,
25,
18466,
2137,
4687,
1125,
11298,
22069,
30,
24375,
394,
12371,
486,
6180,
2099,
2468,
95874,
17036,
394,
12371,
486,
6180,
2099,
408,
95874,
17036,
394,
34323,
198,
310,
1439,
286,
456,
262,
555,
262,
369,
600,
304,
220,
15,
84,
21,
19,
496,
16,
16,
341,
286,
1077,
1376,
284,
320,
17,
353,
600,
568,
983,
21263,
12524,
543,
286,
1077,
34323,
284,
259,
1418,
8091,
2099,
792,
95874,
2558,
286,
2060,
10714,
33673,
310,
34323,
1327,
7596,
3148,
310,
259,
12576,
8950,
3148,
310,
330,
792,
25,
16452,
11298,
22069,
30,
24375,
310,
12371,
486,
6180,
2099,
792,
95874,
17036,
310,
34323,
198,
286,
1439,
262,
555,
262,
369,
600,
304,
220,
15,
84,
21,
19,
496,
16,
15,
341,
286,
1077,
1376,
284,
320,
16,
488,
220,
17,
353,
600,
568,
983,
21263,
12524,
543,
286,
1077,
1044,
284,
320,
16,
488,
220,
17,
353,
600,
568,
983,
11751,
12524,
1428,
286,
2060,
10714,
10297,
83,
670,
2099,
792,
95874,
10697,
2186,
22428,
85,
91,
609,
85,
95874,
9719,
4329,
2099,
831,
95874,
58157,
286,
259,
7440,
2099,
792,
95874,
2558,
286,
369,
502,
304,
220,
15,
84,
21,
19,
496,
16,
15,
341,
310,
1077,
11298,
3097,
284,
320,
16,
488,
220,
17,
353,
502,
568,
983,
21263,
12524,
543,
310,
1077,
34323,
284,
259,
1418,
8091,
2099,
86,
8091,
3097,
95874,
2558,
310,
2060,
10714,
33673,
394,
34323,
1327,
7596,
3148,
394,
259,
12576,
8950,
3148,
394,
330,
792,
25,
16452,
11298,
22069,
30,
24375,
394,
12371,
486,
6180,
2099,
792,
95874,
17036,
394,
34323,
198,
310,
1439,
286,
456,
286,
2060,
10714,
10297,
83,
670,
2099,
792,
95874,
9719,
2240,
317,
262,
456,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_consistent_round_results() {
let tcs = vec![
("oA==", RoundResults::default()),
("oWhtZXNzYWdlc4GiZGNvZGUBZm1vZHVsZWR0ZXN0", RoundResults {
messages: vec![MessageEvent{module: "test".to_owned(), code: 1, index: 0}],
..Default::default()
}),
("omhtZXNzYWdlc4GjZGNvZGUYKmVpbmRleAFmbW9kdWxlZHRlc3R1Z29vZF9jb21wdXRlX2VudGl0aWVzg1ggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg==",
RoundResults {
messages: vec![MessageEvent{module: "test".to_owned(), code: 42, index: 1}],
good_compute_entities: vec![
"0000000000000000000000000000000000000000000000000000000000000000".into(),
"0000000000000000000000000000000000000000000000000000000000000001".into(),
"0000000000000000000000000000000000000000000000000000000000000002".into(),
],
..Default::default()
}),
("o2htZXNzYWdlc4GjZGNvZGUYKmVpbmRleAFmbW9kdWxlZHRlc3R0YmFkX2NvbXB1dGVfZW50aXRpZXOBWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXVnb29kX2NvbXB1dGVfZW50aXRpZXOCWCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFggAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI=",
RoundResults {
messages: vec![MessageEvent{module: "test".to_owned(), code: 42, index: 1}],
good_compute_entities: vec![
"0000000000000000000000000000000000000000000000000000000000000000".into(),
"0000000000000000000000000000000000000000000000000000000000000002".into(),
],
bad_compute_entities: vec![
"0000000000000000000000000000000000000000000000000000000000000001".into(),
],
}),
];
for (encoded_base64, rr) in tcs {
let dec: RoundResults = cbor::from_slice(&base64::decode(encoded_base64).unwrap())
.expect("round results should deserialize correctly");
assert_eq!(dec, rr, "decoded results should match the expected value");
}
} | rust_cleaned_test_functions.jsonl/90824 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1109
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31971,
18128,
29896,
13576,
368,
341,
286,
1077,
259,
4837,
284,
7486,
90515,
310,
3489,
78,
32,
418,
497,
17097,
9801,
486,
2258,
14702,
310,
3489,
78,
54,
426,
80723,
45,
89,
98117,
8736,
66,
19,
46841,
57,
25167,
85,
57,
38,
4493,
57,
76,
16,
85,
95911,
51737,
57,
17925,
15,
80723,
45,
15,
497,
17097,
9801,
341,
394,
6605,
25,
7486,
20703,
2052,
1556,
90,
4352,
25,
330,
1944,
3263,
983,
51973,
1507,
2038,
25,
220,
16,
11,
1922,
25,
220,
15,
64054,
394,
5241,
3675,
486,
2258,
741,
310,
11973,
310,
3489,
316,
426,
80723,
45,
89,
98117,
8736,
66,
19,
38,
73,
57,
25167,
85,
57,
38,
31301,
42,
76,
53,
16650,
76,
49,
273,
8276,
3096,
54,
24,
37744,
54,
24310,
57,
17088,
17257,
18,
49,
16,
57,
17,
24,
85,
90814,
24,
38978,
17,
16,
6377,
52821,
75,
55,
17,
53,
661,
31541,
15,
64,
54,
53,
89,
70,
16,
14398,
57905,
57905,
57905,
57905,
57905,
32,
1867,
56,
5863,
57905,
57905,
57905,
57905,
57905,
1867,
54,
5049,
57905,
57905,
57905,
57905,
57905,
6029,
70,
418,
756,
394,
17097,
9801,
341,
503,
6605,
25,
7486,
20703,
2052,
1556,
90,
4352,
25,
330,
1944,
3263,
983,
51973,
1507,
2038,
25,
220,
19,
17,
11,
1922,
25,
220,
16,
64054,
503,
1661,
57028,
47377,
25,
7486,
90515,
664,
330,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
3263,
18122,
3148,
664,
330,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
16,
3263,
18122,
3148,
664,
330,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
17,
3263,
18122,
3148,
503,
3211,
503,
5241,
3675,
486,
2258,
741,
394,
11973,
310,
3489,
78,
17,
426,
80723,
45,
89,
98117,
8736,
66,
19,
38,
73,
57,
25167,
85,
57,
38,
31301,
42,
76,
53,
16650,
76,
49,
273,
8276,
3096,
54,
24,
37744,
54,
24310,
57,
17088,
17257,
18,
49,
15,
56,
76,
37,
74,
55,
17,
45,
42405,
59272,
16,
67,
39718,
69,
81756,
20,
15,
64,
52821,
79,
80723,
20608,
54,
5049,
57905,
57905,
57905,
57905,
57905,
32,
2954,
53,
18080,
17,
24,
74,
55,
17,
45,
42405,
59272,
16,
67,
39718,
69,
81756,
20,
15,
64,
52821,
79,
80723,
7612,
54,
5049,
57905,
57905,
57905,
57905,
57905,
71038,
14398,
57905,
57905,
57905,
57905,
57905,
6029,
40,
428,
345,
394,
17097,
9801,
341,
503,
6605,
25,
7486,
20703,
2052,
1556,
90,
4352,
25,
330,
1944,
3263,
983,
51973,
1507,
2038,
25,
220,
19,
17,
11,
1922,
25,
220,
16,
64054,
503,
1661,
57028,
47377,
25,
7486,
90515,
664,
330,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
3263,
18122,
3148,
664,
330,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
17,
3263,
18122,
3148,
503,
3211,
503,
3873,
57028,
47377,
25,
7486,
90515,
664,
330,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
16,
3263,
18122,
3148,
503,
3211,
394,
11973,
286,
9747,
286,
369,
320,
19329,
7651,
21,
19,
11,
34393,
8,
304,
259,
4837,
341,
310,
1077,
1622,
25,
17097,
9801,
284,
272,
9368,
486,
1499,
26488,
2099,
3152,
21,
19,
486,
18196,
76270,
7651,
21,
19,
568,
15454,
2398,
394,
659,
17119,
445,
1049,
3059,
1265,
35240,
12440,
797,
310,
2060,
10714,
10297,
8169,
11,
34393,
11,
330,
62913,
3059,
1265,
2432,
279,
3601,
897,
797,
286,
456,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_chacha_true_bytes() {
let seed = [0u8; 32];
let mut rng = ChaChaRng::from_seed(seed);
let mut results = [0u8; 32];
rng.fill_bytes(&mut results);
let expected = [118, 184, 224, 173, 160, 241, 61, 144,
64, 93, 106, 229, 83, 134, 189, 40,
189, 210, 25, 184, 160, 141, 237, 26,
168, 54, 239, 204, 139, 119, 13, 199];
assert_eq!(results, expected);
} | rust_cleaned_test_functions.jsonl/113003 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 272
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4138,
51576,
16082,
12524,
368,
341,
286,
1077,
10320,
284,
508,
15,
84,
23,
26,
220,
18,
17,
935,
286,
1077,
5206,
28422,
284,
27721,
95971,
49,
968,
486,
1499,
33809,
44163,
317,
286,
1077,
5206,
3059,
284,
508,
15,
84,
23,
26,
220,
18,
17,
935,
286,
28422,
12467,
12524,
2099,
6984,
3059,
317,
286,
1077,
3601,
284,
508,
16,
16,
23,
11,
220,
16,
23,
19,
11,
220,
17,
17,
19,
11,
220,
16,
22,
18,
11,
220,
16,
21,
15,
11,
220,
17,
19,
16,
11,
220,
21,
16,
11,
220,
16,
19,
19,
345,
664,
220,
21,
19,
11,
220,
24,
18,
11,
220,
16,
15,
21,
11,
220,
17,
17,
24,
11,
220,
23,
18,
11,
220,
16,
18,
19,
11,
220,
16,
23,
24,
11,
220,
19,
15,
345,
664,
220,
16,
23,
24,
11,
220,
17,
16,
15,
11,
220,
17,
20,
11,
220,
16,
23,
19,
11,
220,
16,
21,
15,
11,
220,
16,
19,
16,
11,
220,
17,
18,
22,
11,
220,
17,
21,
345,
664,
220,
16,
21,
23,
11,
220,
20,
19,
11,
220,
17,
18,
24,
11,
220,
17,
15,
19,
11,
220,
16,
18,
24,
11,
220,
16,
16,
24,
11,
220,
16,
18,
11,
220,
16,
24,
24,
935,
286,
2060,
10714,
10297,
8074,
11,
3601,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_cast_range_int_min() {
assert_eq!(int::MIN.to_int(), Some(int::MIN as int));
assert_eq!(int::MIN.to_i8(), None);
assert_eq!(int::MIN.to_i16(), None);
assert_eq!(int::MIN.to_i64(), Some(int::MIN as i64));
assert_eq!(int::MIN.to_uint(), None);
assert_eq!(int::MIN.to_u8(), None);
assert_eq!(int::MIN.to_u16(), None);
assert_eq!(int::MIN.to_u32(), None);
assert_eq!(int::MIN.to_u64(), None);
#[cfg(target_word_size = "32")]
fn check_word_size() {
assert_eq!(int::MIN.to_i32(), Some(int::MIN as i32));
}
#[cfg(target_word_size = "64")]
fn check_word_size() {
assert_eq!(int::MIN.to_i32(), None);
}
check_word_size();
} | rust_cleaned_test_functions.jsonl/23643 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 445
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5303,
9698,
4042,
7260,
368,
341,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
4042,
1507,
220,
4329,
1548,
486,
16413,
438,
526,
1106,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
5318,
23,
1507,
256,
2240,
317,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
5318,
16,
21,
1507,
220,
2240,
317,
1789,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
5318,
21,
19,
1507,
220,
4329,
1548,
486,
16413,
438,
600,
21,
19,
1106,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
15807,
1507,
2240,
317,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
7300,
23,
1507,
256,
2240,
317,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
7300,
16,
21,
1507,
220,
2240,
317,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
7300,
18,
17,
1507,
220,
2240,
317,
286,
2060,
10714,
10297,
396,
486,
16413,
2389,
7300,
21,
19,
1507,
220,
2240,
626,
286,
11506,
14072,
8637,
13533,
2368,
284,
330,
18,
17,
5422,
286,
5168,
1779,
13533,
2368,
368,
341,
310,
2060,
10714,
10297,
396,
486,
16413,
2389,
5318,
18,
17,
1507,
4329,
1548,
486,
16413,
438,
600,
18,
17,
1106,
286,
555,
286,
11506,
14072,
8637,
13533,
2368,
284,
330,
21,
19,
5422,
286,
5168,
1779,
13533,
2368,
368,
341,
310,
2060,
10714,
10297,
396,
486,
16413,
2389,
5318,
18,
17,
1507,
2240,
317,
286,
555,
286,
1779,
13533,
2368,
543,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_confirmation_status_to_db_data() {
// The None case has to be threaten though.
let h = 21;
assert_eq!(
ConfirmationStatus::ConfirmedIn(h).to_db_data(),
Some((h, true))
);
assert_eq!(
ConfirmationStatus::InMempoolSince(h).to_db_data(),
Some((h, false))
);
assert_eq!(ConfirmationStatus::Rejected(0).to_db_data(), None);
assert_eq!(ConfirmationStatus::ReorgedOut.to_db_data(), None);
} | rust_cleaned_test_functions.jsonl/55471 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 268
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
37681,
4773,
2346,
8685,
1769,
368,
341,
1789,
286,
442,
576,
2240,
1142,
702,
311,
387,
39150,
3498,
624,
286,
1077,
305,
284,
220,
17,
16,
401,
286,
2060,
10714,
33673,
310,
68309,
2522,
486,
47948,
641,
3203,
568,
983,
8685,
1769,
3148,
310,
4329,
1188,
71,
11,
830,
1171,
286,
1439,
286,
2060,
10714,
33673,
310,
68309,
2522,
486,
641,
44,
3262,
1749,
12549,
3203,
568,
983,
8685,
1769,
3148,
310,
4329,
1188,
71,
11,
895,
1171,
286,
1439,
286,
2060,
10714,
10297,
53540,
2522,
486,
77693,
7,
15,
568,
983,
8685,
1769,
1507,
2240,
317,
286,
2060,
10714,
10297,
53540,
2522,
486,
693,
1775,
291,
2662,
2389,
8685,
1769,
1507,
2240,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_switched_vlan_by_device_id() {
let mut test_config = create_test_config_no_paths();
test_config.device_config = Some(build_full_config());
assert_eq!(
test_config.device_id_is_a_switched_vlan("/dev/foo/whatever/switched_vlan/test"),
true
);
} | rust_cleaned_test_functions.jsonl/83821 | {
"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,
3062,
27652,
291,
71296,
3710,
9204,
842,
368,
341,
286,
1077,
5206,
1273,
5332,
284,
1855,
4452,
5332,
6536,
24152,
543,
286,
1273,
5332,
18355,
5332,
284,
4329,
43333,
16372,
5332,
1423,
286,
2060,
10714,
33673,
310,
1273,
5332,
18355,
842,
6892,
4306,
27652,
291,
71296,
4283,
3583,
60555,
14,
68286,
14,
17338,
291,
71296,
12697,
4461,
310,
830,
198,
286,
1439,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_deserialize_receipt() {
let receipt_str = "{\"blockHash\":\"0x83eaba432089a0bfe99e9fc9022d1cfcb78f95f407821be81737c84ae0b439c5\",\"blockNumber\":\"0x38\",\"contractAddress\":\"0x03d8c4566478a6e1bf75650248accce16a98509f\",\"from\":\"0x407d73d8a49eeb85d32cf465507dd71d507100c1\",\"to\":\"0x853f43d8a49eeb85d32cf465507dd71d507100c1\",\"cumulativeGasUsed\":\"0x927c0\",\"gasUsed\":\"0x927c0\",\"logs\":[],\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"root\":null,\"transactionHash\":\"0x422fb0d5953c0c48cbb42fb58e1c30f5e150441c68374d70ca7d4f191fd56f26\",\"transactionIndex\":\"0x0\",\"effectiveGasPrice\": \"0x100\"}";
let _receipt: Receipt = serde_json::from_str(receipt_str).unwrap();
} | rust_cleaned_test_functions.jsonl/68219 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 370
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15768,
9050,
77974,
368,
341,
286,
1077,
22567,
2895,
284,
54734,
4574,
6370,
23488,
15,
87,
23,
18,
68,
12004,
19,
18,
17,
15,
23,
24,
64,
15,
65,
1859,
24,
24,
68,
24,
8316,
24,
15,
17,
17,
67,
16,
9792,
7221,
22,
23,
69,
24,
20,
69,
19,
15,
22,
23,
17,
16,
1371,
23,
16,
22,
18,
22,
66,
23,
19,
5918,
15,
65,
19,
18,
24,
66,
20,
34333,
4574,
2833,
23488,
15,
87,
18,
23,
34333,
20257,
4286,
23488,
15,
87,
15,
18,
67,
23,
66,
19,
20,
21,
21,
19,
22,
23,
64,
21,
68,
16,
13233,
22,
20,
21,
20,
15,
17,
19,
23,
4475,
346,
16,
21,
64,
24,
23,
20,
15,
24,
69,
34333,
1499,
23488,
15,
87,
19,
15,
22,
67,
22,
18,
67,
23,
64,
19,
24,
2127,
65,
23,
20,
67,
18,
17,
9792,
19,
21,
20,
20,
15,
22,
631,
22,
16,
67,
20,
15,
22,
16,
15,
15,
66,
16,
34333,
983,
23488,
15,
87,
23,
20,
18,
69,
19,
18,
67,
23,
64,
19,
24,
2127,
65,
23,
20,
67,
18,
17,
9792,
19,
21,
20,
20,
15,
22,
631,
22,
16,
67,
20,
15,
22,
16,
15,
15,
66,
16,
34333,
59253,
22160,
58728,
22743,
23488,
15,
87,
24,
17,
22,
66,
15,
34333,
39525,
22743,
23488,
15,
87,
24,
17,
22,
66,
15,
34333,
22081,
59,
8899,
1125,
2105,
22081,
33,
18474,
23488,
15,
87,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
15,
34333,
2888,
11693,
2921,
52318,
13528,
6370,
23488,
15,
87,
19,
17,
17,
10798,
15,
67,
20,
24,
20,
18,
66,
15,
66,
19,
23,
66,
6066,
19,
17,
10798,
20,
23,
68,
16,
66,
18,
15,
69,
20,
68,
16,
20,
15,
19,
19,
16,
66,
21,
23,
18,
22,
19,
67,
22,
15,
924,
22,
67,
19,
69,
16,
24,
16,
6902,
20,
21,
69,
17,
21,
34333,
13528,
1552,
23488,
15,
87,
15,
34333,
77895,
58728,
6972,
11693,
7245,
15,
87,
16,
15,
15,
2105,
71612,
286,
1077,
716,
62623,
25,
72896,
284,
61570,
9455,
486,
1499,
2895,
5801,
24130,
2895,
568,
15454,
543,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_good_address_values() {
// Take the lock so changing the environment doesn't cause races.
let _env_lock = ENV_LOCK.lock().unwrap();
env::set_var(CONFIG_ENV, "dev");
check_config!(RocketConfig::parse(r#"
[development]
address = "localhost"
"#.to_string(), TEST_CONFIG_FILENAME), {
default_config(Development).address("localhost")
});
check_config!(RocketConfig::parse(r#"
[development]
address = "127.0.0.1"
"#.to_string(), TEST_CONFIG_FILENAME), {
default_config(Development).address("127.0.0.1")
});
check_config!(RocketConfig::parse(r#"
[development]
address = "::"
"#.to_string(), TEST_CONFIG_FILENAME), {
default_config(Development).address("::")
});
check_config!(RocketConfig::parse(r#"
[dev]
address = "2001:db8::370:7334"
"#.to_string(), TEST_CONFIG_FILENAME), {
default_config(Development).address("2001:db8::370:7334")
});
check_config!(RocketConfig::parse(r#"
[dev]
address = "0.0.0.0"
"#.to_string(), TEST_CONFIG_FILENAME), {
default_config(Development).address("0.0.0.0")
});
} | rust_cleaned_test_functions.jsonl/35238 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1025
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
44781,
6744,
9146,
368,
341,
286,
442,
11778,
279,
5296,
773,
10018,
279,
4573,
3171,
944,
5240,
20588,
624,
286,
1077,
716,
3160,
9818,
284,
32791,
27661,
21003,
1005,
15454,
543,
286,
6105,
486,
746,
4612,
38958,
22027,
11,
330,
3583,
3071,
286,
1779,
5332,
10297,
80017,
2648,
486,
6400,
2601,
2,
698,
3502,
508,
29571,
921,
3502,
2621,
284,
330,
8301,
698,
2549,
5869,
13,
983,
3904,
1507,
13602,
12568,
45005,
701,
341,
3502,
1638,
5332,
7,
39419,
568,
4995,
445,
8301,
1138,
2549,
3011,
286,
1779,
5332,
10297,
80017,
2648,
486,
6400,
2601,
2,
698,
3502,
508,
29571,
921,
3502,
2621,
284,
330,
16,
17,
22,
13,
15,
13,
15,
13,
16,
698,
2549,
5869,
13,
983,
3904,
1507,
13602,
12568,
45005,
701,
341,
3502,
1638,
5332,
7,
39419,
568,
4995,
445,
16,
17,
22,
13,
15,
13,
15,
13,
16,
1138,
2549,
3011,
286,
1779,
5332,
10297,
80017,
2648,
486,
6400,
2601,
2,
698,
3502,
508,
29571,
921,
3502,
2621,
284,
70154,
698,
2549,
5869,
13,
983,
3904,
1507,
13602,
12568,
45005,
701,
341,
3502,
1638,
5332,
7,
39419,
568,
4995,
445,
486,
1138,
2549,
3011,
286,
1779,
5332,
10297,
80017,
2648,
486,
6400,
2601,
2,
698,
3502,
508,
3583,
921,
3502,
2621,
284,
330,
17,
15,
15,
16,
25,
1999,
23,
486,
18,
22,
15,
25,
22,
18,
18,
19,
698,
2549,
5869,
13,
983,
3904,
1507,
13602,
12568,
45005,
701,
341,
3502,
1638,
5332,
7,
39419,
568,
4995,
445,
17,
15,
15,
16,
25,
1999,
23,
486,
18,
22,
15,
25,
22,
18,
18,
19,
1138,
2549,
3011,
286,
1779,
5332,
10297,
80017,
2648,
486,
6400,
2601,
2,
698,
3502,
508,
3583,
921,
3502,
2621,
284,
330,
15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
1,
1,
1,
1,
1,
1,
1,
1,
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_ingest_sst() {
let (_cluster, ctx, tikv, import) = new_cluster_and_tikv_import_client();
let temp_dir = Builder::new().prefix("test_ingest_sst").tempdir().unwrap();
let sst_path = temp_dir.path().join("test.sst");
let sst_range = (0, 100);
let (mut meta, data) = gen_sst_file(sst_path, sst_range);
// No region id and epoch.
send_upload_sst(&import, &meta, &data).unwrap();
let mut ingest = IngestRequest::default();
ingest.set_context(ctx.clone());
ingest.set_sst(meta.clone());
let resp = import.ingest(&ingest).unwrap();
assert!(resp.has_error());
// Set region id and epoch.
meta.set_region_id(ctx.get_region_id());
meta.set_region_epoch(ctx.get_region_epoch().clone());
send_upload_sst(&import, &meta, &data).unwrap();
// Cann't upload the same file again.
assert!(send_upload_sst(&import, &meta, &data).is_err());
ingest.set_sst(meta.clone());
let resp = import.ingest(&ingest).unwrap();
assert!(!resp.has_error());
// Check ingested kvs
for i in sst_range.0..sst_range.1 {
let mut m = RawGetRequest::default();
m.set_context(ctx.clone());
m.set_key(vec![i]);
let resp = tikv.raw_get(&m).unwrap();
assert!(resp.get_error().is_empty());
assert!(!resp.has_region_error());
assert_eq!(resp.get_value(), &[i]);
}
// Upload the same file again to check if the ingested file has been deleted.
send_upload_sst(&import, &meta, &data).unwrap();
} | rust_cleaned_test_functions.jsonl/14483 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 643
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
59112,
477,
643,
267,
368,
341,
262,
1077,
5453,
18855,
11,
5635,
11,
86172,
85,
11,
1159,
8,
284,
501,
28441,
8378,
528,
1579,
85,
18434,
8179,
1428,
262,
1077,
2730,
4334,
284,
20626,
486,
931,
1005,
11849,
445,
1944,
59112,
477,
643,
267,
1827,
3888,
3741,
1005,
15454,
1428,
262,
1077,
274,
267,
2638,
284,
2730,
4334,
3875,
1005,
5987,
445,
1944,
514,
267,
797,
262,
1077,
274,
267,
9698,
284,
320,
15,
11,
220,
16,
15,
15,
317,
262,
1077,
320,
6984,
8823,
11,
821,
8,
284,
4081,
643,
267,
2458,
1141,
267,
2638,
11,
274,
267,
9698,
626,
262,
442,
2308,
5537,
877,
323,
16342,
624,
262,
3624,
21691,
643,
267,
2099,
474,
11,
609,
5490,
11,
609,
691,
568,
15454,
1428,
262,
1077,
5206,
88272,
284,
758,
6969,
1900,
486,
2258,
543,
262,
88272,
980,
8467,
7502,
15997,
1423,
262,
88272,
980,
643,
267,
45119,
15997,
1423,
262,
1077,
9039,
284,
1159,
13,
287,
477,
2099,
287,
477,
568,
15454,
543,
262,
2060,
10297,
18243,
6858,
4096,
5231,
262,
442,
2573,
5537,
877,
323,
16342,
624,
262,
8823,
980,
20627,
842,
7502,
670,
20627,
842,
1423,
262,
8823,
980,
20627,
20682,
7502,
670,
20627,
20682,
1005,
19982,
1423,
262,
3624,
21691,
643,
267,
2099,
474,
11,
609,
5490,
11,
609,
691,
568,
15454,
543,
262,
442,
29468,
944,
8135,
279,
1852,
1034,
1549,
624,
262,
2060,
10297,
6681,
21691,
643,
267,
2099,
474,
11,
609,
5490,
11,
609,
691,
568,
285,
9266,
5231,
262,
88272,
980,
643,
267,
45119,
15997,
1423,
262,
1077,
9039,
284,
1159,
13,
287,
477,
2099,
287,
477,
568,
15454,
543,
262,
2060,
0,
3471,
18243,
6858,
4096,
5231,
262,
442,
4248,
6749,
9980,
595,
11562,
198,
262,
369,
600,
304,
274,
267,
9698,
13,
15,
496,
50900,
9698,
13,
16,
341,
286,
1077,
5206,
296,
284,
23022,
1949,
1900,
486,
2258,
543,
286,
296,
980,
8467,
7502,
15997,
1423,
286,
296,
980,
3097,
25592,
20703,
72,
2558,
286,
1077,
9039,
284,
86172,
85,
18152,
3062,
2099,
76,
568,
15454,
543,
286,
2060,
10297,
18243,
670,
4096,
1005,
285,
15124,
1423,
286,
2060,
0,
3471,
18243,
6858,
20627,
4096,
1423,
286,
2060,
10714,
10297,
18243,
670,
3142,
1507,
44590,
72,
2558,
262,
555,
262,
442,
24996,
279,
1852,
1034,
1549,
311,
1779,
421,
279,
6749,
9980,
1034,
702,
1012,
11062,
624,
262,
3624,
21691,
643,
267,
2099,
474,
11,
609,
5490,
11,
609,
691,
568,
15454,
543,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_persist_server_dictated_poll_interval() {
block_on(async {
// TODO: update this test to have a mocked http response with server dictated poll
// interval when out code support parsing it from the response.
let config = config_generator();
let mut state_machine = StateMachine::new_stub(&config, make_test_app_set()).await;
state_machine.start_update_check(CheckOptions::default()).await;
let storage = state_machine.storage_ref.lock().await;
assert!(storage.get_int(SERVER_DICTATED_POLL_INTERVAL).await.is_none());
assert!(storage.committed());
});
} | rust_cleaned_test_functions.jsonl/94230 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 290
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
620,
4975,
12015,
5243,
657,
40002,
20541,
368,
341,
286,
2504,
4470,
18285,
341,
310,
442,
5343,
25,
2647,
419,
1273,
311,
614,
264,
46149,
1758,
2033,
448,
3538,
80398,
7085,
198,
310,
442,
9873,
979,
700,
2038,
1824,
22314,
432,
504,
279,
2033,
624,
310,
1077,
2193,
284,
2193,
25813,
543,
310,
1077,
5206,
1584,
38695,
284,
3234,
21605,
486,
931,
62781,
2099,
1676,
11,
1281,
4452,
8191,
2602,
6011,
11421,
280,
310,
1584,
38695,
4962,
8882,
7200,
3025,
1227,
3798,
486,
2258,
6011,
11421,
401,
310,
1077,
5819,
284,
1584,
38695,
22403,
7793,
21003,
1005,
11421,
280,
310,
2060,
10297,
16172,
670,
4042,
3759,
8417,
54047,
9005,
76820,
37353,
568,
11421,
2079,
31488,
1423,
310,
2060,
10297,
16172,
905,
5483,
1423,
286,
1625,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_rw_lock_write_guard() {
let rw_lock = RwLock::new(());
let ptr = &rw_lock.write().unwrap() as &dyn AliasableDeref<Target = ()>;
assert_eq!(ptr.deref(), &());
} | rust_cleaned_test_functions.jsonl/72898 | {
"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,
49566,
9818,
9165,
36796,
368,
341,
286,
1077,
25991,
9818,
284,
55294,
11989,
486,
931,
7,
1423,
286,
1077,
10087,
284,
609,
31768,
9818,
3836,
1005,
15454,
368,
438,
609,
43085,
58040,
480,
35,
43970,
3125,
1284,
284,
1719,
10133,
286,
2060,
10714,
10297,
3505,
950,
43970,
1507,
609,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_level() {
assert!(Level::normal("sport").is_normal());
assert!(Level::metadata("$SYS").is_metadata());
assert_eq!(Level::normal("sport").value(), Some("sport"));
assert_eq!(Level::metadata("$SYS").value(), Some("$SYS"));
assert_eq!(Level::normal("sport"), "sport".parse().unwrap());
assert_eq!(Level::metadata("$SYS"), "$SYS".parse().unwrap());
assert!(Level::Normal(String::from("sport")).is_valid());
assert!(Level::Metadata(String::from("$SYS")).is_valid());
assert!(!Level::Normal(String::from("$sport")).is_valid());
assert!(!Level::Metadata(String::from("SYS")).is_valid());
assert!(!Level::Normal(String::from("sport#")).is_valid());
assert!(!Level::Metadata(String::from("SYS+")).is_valid());
} | rust_cleaned_test_functions.jsonl/77007 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 357
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8274,
368,
341,
286,
2060,
10297,
4449,
486,
8252,
445,
60901,
1827,
285,
13973,
1423,
286,
2060,
10297,
4449,
486,
17637,
20912,
37931,
1827,
285,
22220,
5231,
286,
2060,
10714,
10297,
4449,
486,
8252,
445,
60901,
1827,
957,
1507,
4329,
445,
60901,
4010,
286,
2060,
10714,
10297,
4449,
486,
17637,
20912,
37931,
1827,
957,
1507,
4329,
20912,
37931,
14929,
286,
2060,
10714,
10297,
4449,
486,
8252,
445,
60901,
3975,
330,
60901,
3263,
6400,
1005,
15454,
1423,
286,
2060,
10714,
10297,
4449,
486,
17637,
20912,
37931,
3975,
5201,
37931,
3263,
6400,
1005,
15454,
5231,
286,
2060,
10297,
4449,
486,
12206,
2242,
486,
1499,
445,
60901,
15197,
285,
8337,
1423,
286,
2060,
10297,
4449,
486,
14610,
2242,
486,
1499,
20912,
37931,
15197,
285,
8337,
5231,
286,
2060,
0,
3471,
4449,
486,
12206,
2242,
486,
1499,
20912,
60901,
15197,
285,
8337,
1423,
286,
2060,
0,
3471,
4449,
486,
14610,
2242,
486,
1499,
445,
37931,
15197,
285,
8337,
5231,
286,
2060,
0,
3471,
4449,
486,
12206,
2242,
486,
1499,
445,
60901,
2,
15197,
285,
8337,
1423,
286,
2060,
0,
3471,
4449,
486,
14610,
2242,
486,
1499,
445,
37931,
10,
15197,
285,
8337,
1423,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_roundtrip_stream_dict_of_fixed_size_list_of_dict() {
let values = StringArray::from(vec![Some("a"), None, Some("c"), None]);
let keys = Int8Array::from_iter_values([0, 0, 1, 2, 0, 1, 3, 1, 2]);
let dict_array = DictionaryArray::<Int8Type>::try_new(&keys, &values).unwrap();
let dict_data = dict_array.data();
let list_data_type = DataType::FixedSizeList(
Box::new(Field::new_dict(
"item",
DataType::Dictionary(Box::new(DataType::Int8), Box::new(DataType::Utf8)),
true,
1,
false,
)),
3,
);
let list_data = ArrayData::builder(list_data_type)
.len(3)
.add_child_data(dict_data.clone())
.build()
.unwrap();
let list_array = FixedSizeListArray::from(list_data);
let keys_for_dict = Int8Array::from_iter_values([0, 1, 0, 1, 1, 2, 0, 1, 2]);
let dict_dict_array =
DictionaryArray::<Int8Type>::try_new(&keys_for_dict, &list_array).unwrap();
let schema = Arc::new(Schema::new(vec![Field::new(
"f1",
dict_dict_array.data_type().clone(),
false,
)]));
let input_batch =
RecordBatch::try_new(schema, vec![Arc::new(dict_dict_array)]).unwrap();
let output_batch = roundtrip_ipc_stream(&input_batch);
assert_eq!(input_batch, output_batch);
} | rust_cleaned_test_functions.jsonl/74071 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 768
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
29896,
32981,
12673,
5243,
3575,
37839,
2368,
2019,
3575,
5243,
368,
341,
286,
1077,
2750,
284,
923,
1857,
486,
1499,
25592,
20703,
8373,
445,
64,
3975,
2240,
11,
4329,
445,
66,
3975,
2240,
2558,
286,
1077,
6894,
284,
1333,
23,
1857,
486,
1499,
11723,
9146,
2561,
15,
11,
220,
15,
11,
220,
16,
11,
220,
17,
11,
220,
15,
11,
220,
16,
11,
220,
18,
11,
220,
16,
11,
220,
17,
2558,
286,
1077,
6451,
3858,
284,
10466,
1857,
27638,
1072,
23,
929,
6831,
1539,
5921,
2099,
10563,
11,
609,
3661,
568,
15454,
543,
286,
1077,
6451,
1769,
284,
6451,
3858,
2196,
1428,
286,
1077,
1140,
1769,
1819,
284,
33172,
486,
73174,
852,
1006,
310,
8261,
486,
931,
57788,
486,
931,
5243,
1006,
394,
330,
1203,
756,
394,
33172,
486,
8517,
67758,
486,
931,
63941,
486,
1072,
23,
701,
8261,
486,
931,
63941,
486,
38980,
23,
6965,
394,
830,
345,
394,
220,
16,
345,
394,
895,
345,
310,
39290,
310,
220,
18,
345,
286,
1439,
286,
1077,
1140,
1769,
284,
2910,
1043,
486,
17850,
7307,
1769,
1819,
340,
310,
659,
2892,
7,
18,
340,
310,
659,
718,
17268,
1769,
31278,
1769,
15997,
2398,
310,
659,
5834,
741,
310,
659,
15454,
543,
286,
1077,
1140,
3858,
284,
20149,
1695,
852,
1857,
486,
1499,
7307,
1769,
626,
286,
1077,
6894,
5478,
5243,
284,
1333,
23,
1857,
486,
1499,
11723,
9146,
2561,
15,
11,
220,
16,
11,
220,
15,
11,
220,
16,
11,
220,
16,
11,
220,
17,
11,
220,
15,
11,
220,
16,
11,
220,
17,
2558,
286,
1077,
6451,
5243,
3858,
4035,
310,
10466,
1857,
27638,
1072,
23,
929,
6831,
1539,
5921,
2099,
10563,
5478,
5243,
11,
609,
1607,
3858,
568,
15454,
1428,
286,
1077,
10802,
284,
19689,
486,
931,
3759,
3416,
486,
931,
25592,
20703,
1877,
486,
931,
1006,
310,
330,
69,
16,
756,
310,
6451,
5243,
3858,
2196,
1819,
1005,
19982,
3148,
310,
895,
345,
286,
873,
14382,
286,
1077,
1946,
14534,
4035,
310,
13583,
21074,
486,
1539,
5921,
42735,
11,
7486,
20703,
36809,
486,
931,
31278,
5243,
3858,
7252,
568,
15454,
543,
286,
1077,
2550,
14534,
284,
4778,
32981,
83806,
12673,
2099,
1355,
14534,
317,
286,
2060,
10714,
10297,
1355,
14534,
11,
2550,
14534,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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
let mut board = vec_vec_char![
['5', '3', '.', '.', '7', '.', '.', '.', '.'],
['6', '.', '.', '1', '9', '5', '.', '.', '.'],
['.', '9', '8', '.', '.', '.', '.', '6', '.'],
['8', '.', '.', '.', '6', '.', '.', '.', '3'],
['4', '.', '.', '8', '.', '3', '.', '.', '1'],
['7', '.', '.', '.', '2', '.', '.', '.', '6'],
['.', '6', '.', '.', '.', '.', '2', '8', '.'],
['.', '.', '.', '4', '1', '9', '.', '.', '5'],
['.', '.', '.', '.', '8', '.', '.', '7', '9']
];
Solution::solve_sudoku(&mut board);
assert_eq!(
board,
vec_vec_char![
['5', '3', '4', '6', '7', '8', '9', '1', '2'],
['6', '7', '2', '1', '9', '5', '3', '4', '8'],
['1', '9', '8', '3', '4', '2', '5', '6', '7'],
['8', '5', '9', '7', '6', '1', '4', '2', '3'],
['4', '2', '6', '8', '5', '3', '7', '9', '1'],
['7', '1', '3', '9', '2', '4', '8', '5', '6'],
['9', '6', '1', '5', '3', '7', '2', '8', '4'],
['2', '8', '7', '4', '1', '9', '6', '3', '5'],
['3', '4', '5', '2', '8', '6', '1', '7', '9']
]
);
} | rust_cleaned_test_functions.jsonl/28490 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 893
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
86246,
643,
68302,
368,
341,
286,
1077,
5206,
4479,
284,
7486,
13251,
9232,
90515,
310,
2509,
20,
516,
364,
18,
516,
45669,
45669,
364,
22,
516,
45669,
45669,
45669,
6256,
4380,
310,
2509,
21,
516,
45669,
45669,
364,
16,
516,
364,
24,
516,
364,
20,
516,
45669,
45669,
6256,
4380,
310,
2509,
15670,
364,
24,
516,
364,
23,
516,
45669,
45669,
45669,
45669,
364,
21,
516,
6256,
4380,
310,
2509,
23,
516,
45669,
45669,
45669,
364,
21,
516,
45669,
45669,
45669,
364,
18,
4380,
310,
2509,
19,
516,
45669,
45669,
364,
23,
516,
45669,
364,
18,
516,
45669,
45669,
364,
16,
4380,
310,
2509,
22,
516,
45669,
45669,
45669,
364,
17,
516,
45669,
45669,
45669,
364,
21,
4380,
310,
2509,
15670,
364,
21,
516,
45669,
45669,
45669,
45669,
364,
17,
516,
364,
23,
516,
6256,
4380,
310,
2509,
15670,
45669,
45669,
364,
19,
516,
364,
16,
516,
364,
24,
516,
45669,
45669,
364,
20,
4380,
310,
2509,
15670,
45669,
45669,
45669,
364,
23,
516,
45669,
45669,
364,
22,
516,
364,
24,
4432,
286,
9747,
286,
12478,
486,
59419,
643,
68302,
2099,
6984,
4479,
317,
286,
2060,
10714,
33673,
310,
4479,
345,
310,
7486,
13251,
9232,
90515,
394,
2509,
20,
516,
364,
18,
516,
364,
19,
516,
364,
21,
516,
364,
22,
516,
364,
23,
516,
364,
24,
516,
364,
16,
516,
364,
17,
4380,
394,
2509,
21,
516,
364,
22,
516,
364,
17,
516,
364,
16,
516,
364,
24,
516,
364,
20,
516,
364,
18,
516,
364,
19,
516,
364,
23,
4380,
394,
2509,
16,
516,
364,
24,
516,
364,
23,
516,
364,
18,
516,
364,
19,
516,
364,
17,
516,
364,
20,
516,
364,
21,
516,
364,
22,
4380,
394,
2509,
23,
516,
364,
20,
516,
364,
24,
516,
364,
22,
516,
364,
21,
516,
364,
16,
516,
364,
19,
516,
364,
17,
516,
364,
18,
4380,
394,
2509,
19,
516,
364,
17,
516,
364,
21,
516,
364,
23,
516,
364,
20,
516,
364,
18,
516,
364,
22,
516,
364,
24,
516,
364,
16,
4380,
394,
2509,
22,
516,
364,
16,
516,
364,
18,
516,
364,
24,
516,
364,
17,
516,
364,
19,
516,
364,
23,
516,
364,
20,
516,
364,
21,
4380,
394,
2509,
24,
516,
364,
21,
516,
364,
16,
516,
364,
20,
516,
364,
18,
516,
364,
22,
516,
364,
17,
516,
364,
23,
516,
364,
19,
4380,
394,
2509,
17,
516,
364,
23,
516,
364,
22,
516,
364,
19,
516,
364,
16,
516,
364,
24,
516,
364,
21,
516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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_conjugate() {
assert_eq!(expression("2`"), Ok(conj!(int!(2))));
assert_eq!(expression("2` * 3"), Ok(multiply!(conj!(int!(2)), int!(3))));
assert_eq!(expression("2 * 3`"), Ok(multiply!(int!(2), conj!(int!(3)))));
} | rust_cleaned_test_functions.jsonl/111887 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 122
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3382,
47702,
349,
368,
341,
262,
2060,
10714,
10297,
28099,
445,
17,
63,
3975,
7622,
17868,
73,
10297,
396,
10297,
17,
38776,
262,
2060,
10714,
10297,
28099,
445,
17,
63,
353,
220,
18,
3975,
7622,
1255,
21352,
10297,
92440,
10297,
396,
10297,
17,
5731,
526,
10297,
18,
38776,
262,
2060,
10714,
10297,
28099,
445,
17,
353,
220,
18,
63,
3975,
7622,
1255,
21352,
10297,
396,
10297,
17,
701,
16491,
10297,
396,
10297,
18,
26579,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_component_defaults() {
let data = Component::from_str(r#"{"workloadType": "test"}"#);
assert!(data.is_ok());
let component = data.unwrap();
assert_eq!(None, component.os_type);
assert_eq!(None, component.arch);
assert_eq!("test", component.workload_type);
assert_eq!(0, component.parameters.len());
assert_eq!(0, component.workload_settings.len());
assert_eq!(0, component.containers.len());
} | rust_cleaned_test_functions.jsonl/98680 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 180
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
23406,
42290,
368,
341,
262,
1077,
821,
284,
5578,
486,
1499,
2895,
2601,
55543,
4913,
1778,
1078,
929,
788,
330,
1944,
9207,
57676,
626,
262,
2060,
10297,
691,
2079,
19817,
1423,
262,
1077,
3692,
284,
821,
55395,
543,
262,
2060,
10714,
10297,
4064,
11,
3692,
9291,
1819,
317,
262,
2060,
10714,
10297,
4064,
11,
3692,
38091,
317,
262,
2060,
10714,
17223,
1944,
497,
3692,
18282,
1078,
1819,
317,
262,
2060,
10714,
10297,
15,
11,
3692,
27327,
19406,
1423,
262,
2060,
10714,
10297,
15,
11,
3692,
18282,
1078,
10853,
19406,
1423,
262,
2060,
10714,
10297,
15,
11,
3692,
5345,
20568,
19406,
1423,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_variance() {
let variance = |x: FisherSnedecor| x.variance().unwrap();
test_almost(0.1, 10.0, 42.1875, 1e-14, variance);
test_case(1.0, 10.0, 4.6875, variance);
test_case(10.0, 10.0, 0.9375, variance);
} | rust_cleaned_test_functions.jsonl/42682 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 137
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
77450,
368,
341,
286,
1077,
32273,
284,
760,
87,
25,
35504,
50,
18694,
757,
269,
91,
856,
19526,
5284,
1005,
15454,
543,
286,
1273,
94418,
7,
15,
13,
16,
11,
220,
16,
15,
13,
15,
11,
220,
19,
17,
13,
16,
23,
22,
20,
11,
220,
16,
68,
12,
16,
19,
11,
32273,
317,
286,
1273,
19096,
7,
16,
13,
15,
11,
220,
16,
15,
13,
15,
11,
220,
19,
13,
21,
23,
22,
20,
11,
32273,
317,
286,
1273,
19096,
7,
16,
15,
13,
15,
11,
220,
16,
15,
13,
15,
11,
220,
15,
13,
24,
18,
22,
20,
11,
32273,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_insert_dup_key() {
let mut cache = Cache::with_capacity(100);
let dbs1 = Box::new(DivBufShared::from(vec![0u8; 6]));
let dbs2 = Box::new(DivBufShared::from(vec![0u8; 11]));
let key = Key::Rid(RID(0));
cache.insert(key, dbs1);
cache.insert(key, dbs2);
} | rust_cleaned_test_functions.jsonl/90046 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 147
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17678,
51932,
3097,
368,
341,
262,
1077,
5206,
6500,
284,
19479,
486,
4197,
35603,
7,
16,
15,
15,
317,
262,
1077,
84581,
16,
284,
8261,
486,
931,
5432,
344,
15064,
16997,
486,
1499,
25592,
20703,
15,
84,
23,
26,
220,
21,
14382,
262,
1077,
84581,
17,
284,
8261,
486,
931,
5432,
344,
15064,
16997,
486,
1499,
25592,
20703,
15,
84,
23,
26,
220,
16,
16,
14382,
262,
1077,
1376,
284,
5309,
486,
49,
307,
2785,
915,
7,
15,
1106,
262,
6500,
7030,
4857,
11,
84581,
16,
317,
262,
6500,
7030,
4857,
11,
84581,
17,
317,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_negation() {
let tmp = -&LARGEST;
assert_eq!(tmp, Scalar([1, 0, 0, 0]));
let tmp = -&Scalar::zero();
assert_eq!(tmp, Scalar::zero());
let tmp = -&Scalar([1, 0, 0, 0]);
assert_eq!(tmp, LARGEST);
} | rust_cleaned_test_functions.jsonl/5579 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 135
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
28209,
367,
368,
972,
262,
1077,
4174,
284,
481,
5,
43,
7581,
5177,
1926,
262,
2060,
10714,
10297,
5173,
11,
35176,
2561,
16,
11,
220,
15,
11,
220,
15,
11,
220,
15,
9365,
1926,
262,
1077,
4174,
284,
481,
5,
20639,
486,
14154,
1647,
262,
2060,
10714,
10297,
5173,
11,
35176,
486,
14154,
6201,
262,
1077,
4174,
284,
481,
5,
20639,
2561,
16,
11,
220,
15,
11,
220,
15,
11,
220,
15,
12006,
262,
2060,
10714,
10297,
5173,
11,
444,
7581,
5177,
736,
92
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_incircle() {
let from = Point2::new(-1f64, -1.0);
let to = Point2::new(1f64, 1.0);
let p_left = Point2::new(-::std::f64::MIN_POSITIVE, ::std::f64::MIN_POSITIVE);
let p_right = Point2::new(::std::f64::MIN_POSITIVE, -::std::f64::MIN_POSITIVE);
let p_query = Point2::new(2.0, 2.0);
assert!(incircle(&from, &p_left, &to, &p_query) > 0.0);
assert!(incircle(&from, &to, &p_right, &p_query) > 0.0);
} | rust_cleaned_test_functions.jsonl/15944 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 254
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1243,
25857,
368,
341,
286,
1077,
504,
284,
5126,
17,
486,
931,
4080,
16,
69,
21,
19,
11,
481,
16,
13,
15,
317,
286,
1077,
311,
284,
5126,
17,
486,
931,
7,
16,
69,
21,
19,
11,
220,
16,
13,
15,
317,
286,
1077,
281,
9579,
284,
5126,
17,
486,
931,
4080,
486,
1834,
486,
69,
21,
19,
486,
16413,
18313,
44350,
11,
3504,
1834,
486,
69,
21,
19,
486,
16413,
18313,
44350,
317,
286,
1077,
281,
10539,
284,
5126,
17,
486,
931,
38732,
1834,
486,
69,
21,
19,
486,
16413,
18313,
44350,
11,
481,
486,
1834,
486,
69,
21,
19,
486,
16413,
18313,
44350,
317,
286,
1077,
281,
5738,
284,
5126,
17,
486,
931,
7,
17,
13,
15,
11,
220,
17,
13,
15,
626,
286,
2060,
10297,
2840,
7074,
2099,
1499,
11,
609,
79,
9579,
11,
609,
983,
11,
609,
79,
5738,
8,
861,
220,
15,
13,
15,
317,
286,
2060,
10297,
2840,
7074,
2099,
1499,
11,
609,
983,
11,
609,
79,
10539,
11,
609,
79,
5738,
8,
861,
220,
15,
13,
15,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_mutability_access() {
let tuple = (false, true, false, true);
let mut bit_tuple = Bit::from(tuple);
assert_eq!(bit!(bit_tuple).extract(), tuple);
bit!(mut bit_tuple.0).insert(true);
bit!(mut bit_tuple.2).insert(true);
assert_eq!(bit!(bit_tuple).extract(), (true, true, true, true));
let mut tuple = (false, true, false, [false; 61]);
let mut bit_tuple = Bit::from(tuple);
tuple.3[32] = true;
bit!(mut bit_tuple.3[32]).insert(true);
assert_eq!(bit!(bit_tuple.3[32]).extract(), true);
assert_eq!(bit!(bit_tuple).extract(), tuple);
} | rust_cleaned_test_functions.jsonl/44785 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 316
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
29523,
2897,
12759,
368,
341,
286,
1077,
14405,
284,
320,
3849,
11,
830,
11,
895,
11,
830,
317,
286,
1077,
5206,
2699,
21773,
284,
6495,
486,
1499,
58602,
626,
286,
2060,
10714,
10297,
4489,
10297,
4489,
21773,
568,
23493,
1507,
14405,
626,
286,
2699,
10297,
6984,
2699,
21773,
13,
15,
568,
4208,
3715,
317,
286,
2699,
10297,
6984,
2699,
21773,
13,
17,
568,
4208,
3715,
626,
286,
2060,
10714,
10297,
4489,
10297,
4489,
21773,
568,
23493,
1507,
320,
1866,
11,
830,
11,
830,
11,
830,
3237,
286,
1077,
5206,
14405,
284,
320,
3849,
11,
830,
11,
895,
11,
508,
3849,
26,
220,
21,
16,
2558,
286,
1077,
5206,
2699,
21773,
284,
6495,
486,
1499,
58602,
626,
286,
14405,
13,
18,
58,
18,
17,
60,
284,
830,
280,
286,
2699,
10297,
6984,
2699,
21773,
13,
18,
58,
18,
17,
10697,
4208,
3715,
626,
286,
2060,
10714,
10297,
4489,
10297,
4489,
21773,
13,
18,
58,
18,
17,
10697,
23493,
1507,
830,
626,
286,
2060,
10714,
10297,
4489,
10297,
4489,
21773,
568,
23493,
1507,
14405,
317,
262,
335
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.