text
stringlengths
93
16.4k
id
stringlengths
20
40
metadata
dict
input_ids
listlengths
45
2.05k
attention_mask
listlengths
45
2.05k
complexity
int64
1
9
#[test] fn test_push_should_work_with_multiple_rules() { let mut lsys: LSystem = LSystem::new("A".to_string()); let mut rule: HashMap<char, String> = HashMap::new(); rule.insert('A', "AB".to_string()); rule.insert('B', "A".to_string()); lsys.push(rule); assert_eq!(*lsys.get('B'), "A"); assert_eq!(*lsys.get('A'), "AB"); }
rust_cleaned_test_functions.jsonl/101651
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 187 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 14218, 43378, 11498, 6615, 45233, 21407, 368, 341, 286, 1077, 5206, 326, 7791, 25, 444, 2320, 284, 444, 2320, 486, 931, 445, 32, 3263, 983, 3904, 1423, 286, 1077, 5206, 5912, 25, 10528, 21919, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_no_stdout_fail() { let res = CmdResult { bin_path: "".into(), util_name: None, tmpd: None, code: None, success: true, stdout: "asdfsadfa".into(), stderr: "".into(), }; res.no_stdout(); }
rust_cleaned_test_functions.jsonl/12793
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 197 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6536, 67416, 22121, 368, 341, 286, 1077, 592, 284, 40210, 2077, 341, 310, 9544, 2638, 25, 44907, 18122, 3148, 310, 4094, 1269, 25, 2240, 345, 310, 4174, 67, 25, 2240, 345, 310, 2038, 25, 2240, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_zwstr() { const S: &str = "𝄞music"; let z: Zstr<'static> = zstr!(S); assert_eq!(S.as_bytes().len(), z.bytes().count()); assert_eq!( S.chars().collect::<Vec<char>>(), z.chars().collect::<Vec<char>>(), ); }
rust_cleaned_test_functions.jsonl/82338
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 120 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6415, 86, 495, 368, 341, 220, 733, 328, 25, 609, 495, 284, 330, 124596, 252, 31161, 876, 220, 1077, 1147, 25, 1863, 495, 18291, 1978, 29, 284, 1147, 495, 10297, 50, 626, 220, 2060, 10714, 1029...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_divide_by_zero_natural() { let n = Complex::new(2, 3); let d = Complex::new(0, 0); let _x = n / d; }
rust_cleaned_test_functions.jsonl/105656
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 83 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16237, 577, 3710, 19359, 1089, 4585, 368, 341, 286, 1077, 308, 284, 22096, 486, 931, 7, 17, 11, 220, 18, 317, 286, 1077, 294, 284, 22096, 486, 931, 7, 15, 11, 220, 15, 317, 286, 1077, 716, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_frexp() { let f1 = 2.0f32.powi(-123); let f2 = 2.0f32.powi(-111); let f3 = 1.75 * 2.0f32.powi(-123); let (x1, exp1) = f1.frexp(); let (x2, exp2) = f2.frexp(); let (x3, exp3) = f3.frexp(); assert_eq!((x1, exp1), (0.5f32, -122)); assert_eq!((x2, exp2), (0.5f32, -110)); assert_eq!((x3, exp3), (0.875f32, -122)); assert_eq!(f32::ldexp(x1, exp1), f1); assert_eq!(f32::ldexp(x2, exp2), f2); assert_eq!(f32::ldexp(x3, exp3), f3); assert_eq!(0f32.frexp(), (0f32, 0)); assert_eq!((-0f32).frexp(), (-0f32, 0)); }
rust_cleaned_test_functions.jsonl/64205
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 394 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 74179, 35725, 368, 341, 286, 1077, 282, 16, 284, 220, 17, 13, 15, 69, 18, 17, 25290, 72, 4080, 16, 17, 18, 317, 286, 1077, 282, 17, 284, 220, 17, 13, 15, 69, 18, 17, 25290, 72, 4080, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_assert_fail() { let mut test = Cursor::new(BAD_TEST_CONTENTS); let err = test.read_le::<TestFile>() .expect_err("Offset assertion should have failed"); let custom_err = err.custom_err::<BadDifferenceError>().expect("Error type was lost"); assert_eq!(custom_err.0, 0xBAAD - 0x20, "Unexpected failure value"); }
rust_cleaned_test_functions.jsonl/58473
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 141 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16553, 22121, 368, 341, 262, 1077, 5206, 1273, 284, 28067, 486, 931, 5349, 1808, 11641, 25560, 50, 317, 262, 1077, 1848, 284, 1273, 4125, 11751, 27638, 2271, 1703, 18949, 286, 659, 17119, 9266, 44...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_uuid_upperhex() { use super::fmt::Write; let mut buffer = String::new(); let uuid = test_util::new(); check!(buffer, "{:X}", uuid, 36, |c| c.is_uppercase() || c.is_digit(10) || c == '-'); }
rust_cleaned_test_functions.jsonl/17529
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 149 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 25540, 34445, 17308, 368, 341, 286, 990, 2256, 486, 12501, 486, 7985, 401, 286, 1077, 5206, 4147, 284, 923, 486, 931, 543, 286, 1077, 16040, 284, 1273, 18974, 486, 931, 1428, 286, 1779, 10297, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_reqopt_missing() { let args = vec!["blah".to_string()]; match Options::new() .reqopt("t", "test", "testing", "TEST") .parse(&args) { Err(OptionMissing(_)) => {} _ => panic!(), } }
rust_cleaned_test_functions.jsonl/52355
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 125 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17644, 2912, 40447, 368, 341, 262, 1077, 2827, 284, 7486, 0, 1183, 70614, 3263, 983, 3904, 33800, 262, 2432, 14566, 486, 931, 741, 286, 659, 2958, 2912, 445, 83, 497, 330, 1944, 497, 330, 8840, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_movss_load() { assert_emit!(0xf3, 0x0f, 0x10, 0x44, 0x88, 1; movss_load(XMM0, Mem::Index(RAX, RCX, 4, 1))); assert_emit!(0xf2, 0x0f, 0x10, 0x48, 1; movsd_load(XMM1, Mem::Base(RAX, 1))); assert_emit!(0xf3, 0x44, 0x0f, 0x10, 0xbc, 0x88, 0, 1, 0, 0; movss_load(XMM15, Mem::Index(RAX, RCX, 4, 256))); assert_emit!(0xf3, 0x41, 0x0f, 0x10, 0x4c, 0x8f, 1; movss_load(XMM1, Mem::Index(R15, RCX, 4, 1))); assert_emit!(0xf2, 0x43, 0x0f, 0x10, 0x4c, 0xbf, 2; movsd_load(XMM1, Mem::Index(R15, R15, 4, 2))); assert_emit!(0xf3, 0x0f, 0x10, 0x05, 0xec, 0xff, 0xff, 0xff; movss_load(XMM0, Mem::Base(RIP, -20))); }
rust_cleaned_test_functions.jsonl/85505
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 490 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 55798, 778, 12411, 368, 341, 286, 2060, 69082, 10297, 15, 5848, 18, 11, 220, 15, 87, 15, 69, 11, 220, 15, 87, 16, 15, 11, 220, 15, 87, 19, 19, 11, 220, 15, 87, 23, 23, 11, 220, 16, 26,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_options_can_be_set_in_git_config() { // In general the values here are not the default values. However there are some exceptions let git_config_contents = b" [delta] color-only = false commit-decoration-style = black black commit-style = black black dark = false default-language = rs diff-highlight = true diff-so-fancy = true features = xxxyyyzzz file-added-label = xxxyyyzzz file-decoration-style = black black file-modified-label = xxxyyyzzz file-removed-label = xxxyyyzzz file-renamed-label = xxxyyyzzz file-transformation = s/foo/bar/ right-arrow = xxxyyyzzz file-style = black black hunk-header-decoration-style = black black hunk-header-style = black black keep-plus-minus-markers = true light = true line-numbers = true line-numbers-left-format = xxxyyyzzz line-numbers-left-style = black black line-numbers-minus-style = black black line-numbers-plus-style = black black line-numbers-right-format = xxxyyyzzz line-numbers-right-style = black black line-numbers-zero-style = black black max-line-distance = 77 max-line-length = 77 minus-emph-style = black black minus-empty-line-marker-style = black black minus-non-emph-style = black black minus-style = black black navigate = true navigate-regex = xxxyyyzzz paging = never plus-emph-style = black black plus-empty-line-marker-style = black black plus-non-emph-style = black black plus-style = black black raw = true side-by-side = true syntax-theme = xxxyyyzzz tabs = 77 true-color = never whitespace-error-style = black black width = 77 word-diff-regex = xxxyyyzzz zero-style = black black # no-gitconfig "; let git_config_path = "delta__test_options_can_be_set_in_git_config.gitconfig"; let opt = integration_test_utils::make_options_from_args_and_git_config( &[], Some(git_config_contents), Some(git_config_path), ); assert_eq!(opt.true_color, "never"); assert_eq!(opt.color_only, false); assert_eq!(opt.commit_decoration_style, "black black"); assert_eq!(opt.commit_style, "black black"); assert_eq!(opt.dark, false); assert_eq!(opt.default_language, Some("rs".to_owned())); // TODO: should set_options not be called on any feature flags? assert!(opt .features .unwrap() .split_whitespace() .any(|s| s == "xxxyyyzzz")); assert_eq!(opt.file_added_label, "xxxyyyzzz"); assert_eq!(opt.file_decoration_style, "black black"); assert_eq!(opt.file_modified_label, "xxxyyyzzz"); assert_eq!(opt.file_removed_label, "xxxyyyzzz"); assert_eq!(opt.file_renamed_label, "xxxyyyzzz"); assert_eq!(opt.right_arrow, "xxxyyyzzz"); assert_eq!(opt.file_style, "black black"); assert_eq!(opt.file_regex_replacement, Some("s/foo/bar/".to_string())); assert_eq!(opt.hunk_header_decoration_style, "black black"); assert_eq!(opt.hunk_header_style, "black black"); assert_eq!(opt.keep_plus_minus_markers, true); assert_eq!(opt.light, true); assert_eq!(opt.line_numbers, true); assert_eq!(opt.line_numbers_left_format, "xxxyyyzzz"); assert_eq!(opt.line_numbers_left_style, "black black"); assert_eq!(opt.line_numbers_minus_style, "black black"); assert_eq!(opt.line_numbers_plus_style, "black black"); assert_eq!(opt.line_numbers_right_format, "xxxyyyzzz"); assert_eq!(opt.line_numbers_right_style, "black black"); assert_eq!(opt.line_numbers_zero_style, "black black"); assert_eq!(opt.max_line_distance, 77 as f64); assert_eq!(opt.max_line_length, 77); assert_eq!(opt.minus_emph_style, "black black"); assert_eq!(opt.minus_empty_line_marker_style, "black black"); assert_eq!(opt.minus_non_emph_style, "black black"); assert_eq!(opt.minus_style, "black black"); assert_eq!(opt.navigate, true); assert_eq!(opt.navigate_regex, Some("xxxyyyzzz".to_string())); assert_eq!(opt.paging_mode, "never"); assert_eq!(opt.plus_emph_style, "black black"); assert_eq!(opt.plus_empty_line_marker_style, "black black"); assert_eq!(opt.plus_non_emph_style, "black black"); assert_eq!(opt.plus_style, "black black"); assert_eq!(opt.raw, true); assert_eq!(opt.side_by_side, true); assert_eq!(opt.syntax_theme, Some("xxxyyyzzz".to_string())); assert_eq!(opt.tab_width, 77); assert_eq!(opt.true_color, "never"); assert_eq!(opt.whitespace_error_style, "black black"); assert_eq!(opt.width, Some("77".to_string())); assert_eq!(opt.tokenization_regex, "xxxyyyzzz"); assert_eq!(opt.zero_style, "black black"); assert_eq!(opt.computed.paging_mode, PagingMode::Never); remove_file(git_config_path).unwrap(); }
rust_cleaned_test_functions.jsonl/38121
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2298 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8743, 27421, 21263, 2602, 1243, 68801, 5332, 368, 341, 286, 442, 758, 4586, 279, 2750, 1588, 525, 537, 279, 1638, 2750, 13, 4354, 1052, 525, 1045, 19585, 8945, 286, 1077, 16345, 5332, 16682, 284, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_hwbreakpoints_dr7() { let br = HWBreakpoints([ HWBreakpoint { addr: 0, is_local: false, is_global: true, trigger: BreakTrigger::W, size: BreakSize::B8, }, HWBreakpoint { addr: 0, is_local: false, is_global: true, trigger: BreakTrigger::RW, size: BreakSize::B4, }, HWBreakpoint { addr: 0, is_local: true, is_global: true, trigger: BreakTrigger::Ex, size: BreakSize::B1, }, HWBreakpoint { addr: 0, is_local: true, is_global: false, trigger: BreakTrigger::W, size: BreakSize::B2, }, ]); assert_eq!( br.get_dr7(), 0b_0101_0000_1011_1101_00000111_01_11_10_10, "dr7 wrong: {:#034b}", br.get_dr7() ); }
rust_cleaned_test_functions.jsonl/120515
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 361 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28792, 8960, 7706, 26680, 22, 368, 341, 10217, 1411, 284, 26670, 22524, 7706, 8956, 197, 13292, 54, 22524, 2768, 341, 298, 53183, 25, 220, 15, 345, 298, 19907, 13564, 25, 895, 345, 298, 19907, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_consistent_after_optimize() { let (mut shapes, mut bvh) = build_some_bh::<BVH>(); shapes[0].pos = Vec3::new(10.0, 1.0, 2.0); shapes[1].pos = Vec3::new(-10.0, -10.0, 10.0); shapes[2].pos = Vec3::new(-10.0, 10.0, 10.0); shapes[3].pos = Vec3::new(-10.0, 10.0, -10.0); shapes[4].pos = Vec3::new(11.0, 1.0, 2.0); shapes[5].pos = Vec3::new(11.0, 2.0, 2.0); let refit_shape_indices = (0..6).collect(); bvh.optimize(&refit_shape_indices, &shapes); bvh.assert_consistent(&shapes); }
rust_cleaned_test_functions.jsonl/90322
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 318 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31971, 18128, 19844, 15032, 11853, 368, 341, 286, 1077, 320, 6984, 20816, 11, 5206, 293, 29919, 8, 284, 1936, 61855, 90581, 27638, 59343, 39, 3913, 286, 20816, 58, 15, 936, 966, 284, 11312, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_is_prime() { assert!(!is_prime(0)); assert!(!is_prime(1)); assert!(is_prime(2)); assert!(is_prime(3)); assert!(!is_prime(4)); assert!(is_prime(5)); // 49 is the smallest composite number not divisble by any number that // gets special treatment in is_prime assert!(!is_prime(49)); // Greatest prime that fits in u8 assert!(is_prime(251)); }
rust_cleaned_test_functions.jsonl/73113
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 219 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6892, 38217, 368, 341, 286, 2060, 0, 3471, 285, 38217, 7, 15, 1106, 286, 2060, 0, 3471, 285, 38217, 7, 16, 1106, 286, 2060, 10297, 285, 38217, 7, 17, 1106, 286, 2060, 10297, 285, 38217, 7, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_minimal() { let value = MessageReference { channel_id: Some(Id::new(1)), guild_id: None, message_id: None, fail_if_not_exists: None, }; serde_test::assert_tokens( &value, &[ Token::Struct { name: "MessageReference", len: 1, }, Token::Str("channel_id"), Token::Some, Token::NewtypeStruct { name: "Id" }, Token::Str("1"), Token::StructEnd, ], ); }
rust_cleaned_test_functions.jsonl/109290
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 401 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7260, 2861, 368, 341, 286, 1077, 897, 284, 4856, 8856, 341, 310, 5496, 842, 25, 4329, 55924, 486, 931, 7, 16, 6965, 310, 26411, 842, 25, 2240, 345, 310, 1943, 842, 25, 2240, 345, 310, 3690, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_ignore_separate_parameters() { assert_eq!( parse_format_flags_str(&["od", "-I", "-A", "x"]).unwrap(), vec![FORMAT_ITEM_DEC64S] ); }
rust_cleaned_test_functions.jsonl/78693
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 92 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 58493, 3453, 67598, 18263, 368, 341, 262, 2060, 10714, 33673, 286, 4715, 8955, 14130, 2895, 2099, 1183, 347, 497, 6523, 40, 497, 6523, 32, 497, 330, 87, 45014, 15454, 3148, 286, 7486, 20703, 46559...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bitfields_seventh() { let mut large: bindings::bitfields::Seventh = unsafe { mem::zeroed() }; assert!(unsafe { large.assert(false, 0, 0, 0, 0, false, 0) }); large.set_first_one_bit(true); large.set_second_thirty_bits(375028802); large.set_third_two_bits(2); large.set_fourth_thirty_bits(643472885); large.set_fifth_two_bits(3); large.set_sixth_one_bit(true); large.set_seventh_thirty_bits(1061657575); assert!(unsafe { large.assert(true, 375028802, 2, 643472885, 3, true, 1061657575) }); assert_eq!(large.first_one_bit(), true); assert_eq!(large.second_thirty_bits(), 375028802); assert_eq!(large.third_two_bits(), 2); assert_eq!(large.fourth_thirty_bits(), 643472885); assert_eq!(large.fifth_two_bits(), 3); assert_eq!(large.sixth_one_bit(), true); assert_eq!(large.seventh_thirty_bits(), 1061657575); }
rust_cleaned_test_functions.jsonl/28004
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 399 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13996, 9007, 3453, 44607, 368, 341, 262, 1077, 5206, 3460, 25, 35700, 486, 4489, 9007, 486, 1514, 44607, 284, 19860, 314, 1833, 486, 14154, 291, 368, 3634, 262, 2060, 10297, 38157, 314, 3460, 3713...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_run_script() { let dir = TempDir::new("repo_version.rs").expect("create temp dir for repo_version.rs test"); let sub_dir = dir.path().join("subdir"); fs::create_dir(&sub_dir).expect("create subdir"); let script_file = sub_dir.join("version.sh"); { let mut file = fs::File::create(&script_file).expect("create file"); file.write_all(b"echo 1.2.3.4").expect("write file"); } assert_eq!("1.2.3.4", run_script("bash version.sh", &sub_dir).unwrap()); }
rust_cleaned_test_functions.jsonl/580
{ "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, 14007, 14660, 368, 341, 286, 1077, 5419, 284, 19944, 6184, 486, 931, 445, 23476, 9438, 25638, 1827, 17119, 445, 3182, 2730, 5419, 369, 15867, 9438, 25638, 1273, 3071, 286, 1077, 1186, 4334, 284, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_date_universal() { let (_, mut ucmd) = at_and_ucmd!(); let result = ucmd.arg("--universal").run(); assert!(result.success); }
rust_cleaned_test_functions.jsonl/25492
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 69 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4164, 4907, 33952, 368, 341, 262, 1077, 39464, 5206, 575, 8710, 8, 284, 518, 8378, 68887, 2277, 0, 543, 262, 1077, 1102, 284, 575, 8710, 21186, 21549, 95300, 1827, 6108, 543, 262, 2060, 10297, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_font_matching_lang() -> Result<(), Error> { let collection = make_fake_typeface_collection(vec![ make_fake_typeface_with_languages(&["a"]), make_fake_typeface_with_languages(&["b-C"]), make_fake_typeface_with_languages(&["b-D", "b-E"]), make_fake_typeface_with_languages(&["fooo"]), make_fake_typeface_with_languages(&["foo-BAR"]), ]); // Exact matches. assert_eq!(request_lang(&collection, &["a"])?.asset_id, AssetId(0)); assert_eq!(request_lang(&collection, &["b-C"])?.asset_id, AssetId(1)); assert_eq!(request_lang(&collection, &["b-E"])?.asset_id, AssetId(2)); // Verify that request language order is respected. assert_eq!(request_lang(&collection, &["b-C", "a"])?.asset_id, AssetId(1)); // Partial match: the first matching font is returned first. assert_eq!(request_lang(&collection, &["b"])?.asset_id, AssetId(1)); // Exact match overrides preceding partial match. assert_eq!(request_lang(&collection, &["b", "a"])?.asset_id, AssetId(0)); // Partial match should match a whole BCP47 segment. assert_eq!(request_lang(&collection, &["foo"])?.asset_id, AssetId(4)); Ok(()) }
rust_cleaned_test_functions.jsonl/63334
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 575 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17451, 70763, 17876, 368, 1464, 5714, 68843, 4600, 29, 341, 286, 1077, 4426, 284, 1281, 56881, 1819, 1564, 25019, 25592, 90515, 310, 1281, 56881, 1819, 1564, 6615, 77576, 2099, 1183, 64, 46442, 310,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
8
#[test] fn test_primitive_array_lt_scalar_nulls() { cmp_i64_scalar_options!( lt_scalar, &[None, Some(1), Some(2), Some(3), None, Some(1), Some(2), Some(3), Some(2), None], 2, vec![None, Some(true), Some(false), Some(false), None, Some(true), Some(false), Some(false), Some(false), None] ); }
rust_cleaned_test_functions.jsonl/38872
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 194 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 84087, 3858, 39164, 41652, 15162, 82, 368, 341, 286, 26089, 5318, 21, 19, 41652, 8743, 33673, 310, 25175, 41652, 345, 310, 44590, 4064, 11, 4329, 7, 16, 701, 4329, 7, 17, 701, 4329, 7, 18, 701...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_comprehensive() { #[rpn_fn] fn fn_a(v1: &Option<Real>, v2: &Option<Real>, v3: &Option<Real>) -> Result<Option<Real>> { Ok(Some(v1.unwrap() * v2.unwrap() - v3.unwrap())) } #[rpn_fn] fn fn_b() -> Result<Option<Real>> { Ok(Real::new(42.0).ok()) } #[rpn_fn] fn fn_c(v1: &Option<i64>, v2: &Option<i64>) -> Result<Option<Real>> { Ok(Real::new((v2.unwrap() - v1.unwrap()) as f64).ok()) } #[rpn_fn] fn fn_d(v1: &Option<i64>, v2: &Option<i64>) -> Result<Option<i64>> { Ok(Some(v1.unwrap() + v2.unwrap() * 2)) } let mut columns = LazyBatchColumnVec::from(vec![ { let mut col = LazyBatchColumn::decoded_with_capacity_and_tp(3, EvalType::Real); col.mut_decoded().push_real(Real::new(0.5).ok()); col.mut_decoded().push_real(Real::new(-0.1).ok()); col.mut_decoded().push_real(Real::new(3.5).ok()); col }, { let mut col = LazyBatchColumn::decoded_with_capacity_and_tp(3, EvalType::Int); col.mut_decoded().push_int(Some(1)); col.mut_decoded().push_int(Some(5)); col.mut_decoded().push_int(Some(-4)); col }, ]); let schema = &[FieldTypeTp::Double.into(), FieldTypeTp::LongLong.into()]; let exp = RpnExpressionBuilder::new() .push_column_ref(0) .push_fn_call(fn_b_fn_meta(), 0, FieldTypeTp::Double) .push_column_ref(1) .push_constant(7i64) .push_fn_call(fn_d_fn_meta(), 2, FieldTypeTp::LongLong) .push_constant(11i64) .push_fn_call(fn_c_fn_meta(), 2, FieldTypeTp::Double) .push_fn_call(fn_a_fn_meta(), 3, FieldTypeTp::Double) .build(); // fn_a( // fn_c( let mut ctx = EvalContext::default(); let result = exp.eval(&mut ctx, schema, &mut columns, &[2, 0], 2); let val = result.unwrap(); assert!(val.is_vector()); assert_eq!( val.vector_value().unwrap().as_ref().as_real_slice(), [Real::new(146.0).ok(), Real::new(25.0).ok(),] ); assert_eq!(val.vector_value().unwrap().logical_rows(), &[0, 1]); assert_eq!(val.field_type().tp(), FieldTypeTp::Double); }
rust_cleaned_test_functions.jsonl/65661
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1485 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21296, 2965, 52899, 368, 341, 394, 11506, 81, 19958, 15246, 921, 286, 5168, 5168, 4306, 3747, 16, 25, 609, 5341, 64829, 8066, 348, 17, 25, 609, 5341, 64829, 8066, 348, 18, 25, 609, 5341, 64829, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_invalid_extension() { let config = create_test_config(); let categorizer = FileCategorizer::from_config(&config); assert_eq!( categorizer.categorize(&PathBuf::from("src/js/a.cpp")), Err(Cow::Borrowed( "File categorizer encounter a file with unsupported extension." )) ); }
rust_cleaned_test_functions.jsonl/118301
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 182 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31433, 31035, 368, 341, 286, 1077, 2193, 284, 1855, 4452, 5332, 543, 286, 1077, 22049, 3135, 284, 2887, 34, 7593, 3135, 486, 1499, 5332, 2099, 1676, 317, 286, 2060, 10714, 33673, 310, 22049, 3135,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_next_request() { let _guard = MUTEX.lock().unwrap(); async fn task(usb_in: UsbIn) -> UsbOut { assert_eq!(&usb_in, &[1, 2, 3]); let next_req = next_request([4, 5, 6, 7].to_vec()).await; assert_eq!(&next_req, &[8, 9, 10]); let next_req = next_request([11, 12].to_vec()).await; assert_eq!(&next_req, &[13, 14]); [15, 16, 17].to_vec() } let mut response = [0; 100]; spawn(task, &[1, 2, 3]); spin(); // Intermediate response. assert_eq!(Ok(4), copy_response(&mut response)); assert_eq!(&response[..4], &[4, 5, 6, 7]); // Send follow-up request. assert!(waiting_for_next_request()); on_next_request(&[8, 9, 10]); spin(); // Intermediate response. assert_eq!(Ok(2), copy_response(&mut response)); assert_eq!(&response[..2], &[11, 12]); // Send follow-up request. assert!(waiting_for_next_request()); on_next_request(&[13, 14]); spin(); // Final response. assert_eq!(Ok(3), copy_response(&mut response)); assert_eq!(&response[..3], &[15, 16, 17]); }
rust_cleaned_test_functions.jsonl/97883
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 620 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11257, 7893, 368, 341, 286, 1077, 716, 26098, 284, 87420, 3257, 21003, 1005, 15454, 1428, 286, 3312, 5168, 3383, 7, 24343, 1243, 25, 3985, 65, 641, 8, 1464, 3985, 65, 2662, 341, 310, 2060, 10714...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_req_parse_err() { let mut sys = actix_rt::System::new("test"); let _ = sys.block_on(lazy(|| { let buf = TestBuffer::new("GET /test HTTP/1\r\n\r\n"); let mut h1 = Dispatcher::<_, _, _, _, UpgradeHandler<TestBuffer>>::new( buf, ServiceConfig::default(), CloneableService::new( (|_| ok::<_, Error>(Response::Ok().finish())).into_service(), ), CloneableService::new(ExpectHandler), None, None, ); assert!(h1.poll().is_err()); if let DispatcherState::Normal(ref inner) = h1.inner { assert!(inner.flags.contains(Flags::READ_DISCONNECT)); assert_eq!(&inner.io.write_buf[..26], b"HTTP/1.1 400 Bad Request\r\n"); } ok::<_, ()>(()) })); }
rust_cleaned_test_functions.jsonl/59660
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 519 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17644, 21039, 9266, 368, 341, 286, 1077, 5206, 5708, 284, 1160, 941, 40169, 486, 2320, 486, 931, 445, 1944, 797, 286, 1077, 716, 284, 5708, 15697, 4470, 2333, 13619, 79453, 341, 310, 1077, 6607, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_router_detect13() { let router = Router::new() .path("user/<id:/[0-9a-z]{8}(-[0-9a-z]{4}){3}-[0-9a-z]{12}/>") .get(fake_handler); let mut req: Request = hyper::Request::builder() .uri("http://local.host/user/726d694c-7af0-4bb0-9d22-706f7e38641e") .body(hyper::Body::empty()) .unwrap() .into(); let mut path_state = PathState::new(req.uri().path()); let matched = router.detect(&mut req, &mut path_state); assert!(matched.is_some()); let mut req: Request = hyper::Request::builder() .uri("http://local.host/user/726d694c-7af0-4bb0-9d22-706f7e386e") .body(hyper::Body::empty()) .unwrap() .into(); let mut path_state = PathState::new(req.uri().path()); let matched = router.detect(&mut req, &mut path_state); assert!(matched.is_none()); }
rust_cleaned_test_functions.jsonl/3305
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 495 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 55587, 56457, 16, 18, 368, 341, 286, 1077, 9273, 284, 10554, 486, 931, 741, 310, 659, 2343, 445, 872, 23012, 307, 14375, 58, 15, 12, 24, 64, 9141, 15370, 23, 92, 4080, 58, 15, 12, 24, 64, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_from_guid() { let guid = guiddef::GUID { Data1: 0x4a35229d, Data2: 0x5527, Data3: 0x4f30, Data4: [0x86, 0x47, 0x9d, 0xc5, 0x4e, 0x1e, 0xe1, 0xe8], }; let uuid = Uuid::from_guid(guid).unwrap(); assert_eq!( "9d22354a-2755-304f-8647-9dc54e1ee1e8", uuid.to_hyphenated().to_string() ); }
rust_cleaned_test_functions.jsonl/119195
{ "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, 5673, 43756, 368, 341, 286, 1077, 9643, 284, 9643, 750, 486, 41778, 341, 310, 2885, 16, 25, 220, 15, 87, 19, 64, 18, 20, 17, 17, 24, 67, 345, 310, 2885, 17, 25, 220, 15, 87, 20, 20, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_list_empty() -> IonResult<()> { let mut cursor = ion_cursor_for(&[0xB0]); assert_eq!(cursor.next()?, Some(Value(IonType::List, false))); cursor.step_in()?; assert_eq!(cursor.next()?, None); cursor.step_out()?; Ok(()) }
rust_cleaned_test_functions.jsonl/82749
{ "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, 6443, 2019, 15124, 368, 1464, 44805, 2077, 71698, 341, 286, 1077, 5206, 8128, 284, 27672, 28601, 5478, 2099, 58, 15, 14377, 15, 2558, 286, 2060, 10714, 10297, 17437, 4529, 368, 12622, 4329, 25346, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_get_metadata() { let (mock_db, client, mut runtime) = create_database_client_and_runtime(1); let (actual_version, actual_timestamp) = mock_db.get_latest_commit_metadata().unwrap(); let mut batch = JsonRpcBatch::default(); batch.add_get_metadata_request(); let result = execute_batch_and_get_first_response(&client, &mut runtime, batch); let result_view = BlockMetadata::from_response(result).unwrap(); assert_eq!(result_view.version, actual_version); assert_eq!(result_view.timestamp, actual_timestamp); }
rust_cleaned_test_functions.jsonl/72853
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 201 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 22220, 368, 341, 262, 1077, 320, 16712, 8685, 11, 2943, 11, 5206, 15592, 8, 284, 1855, 27341, 8179, 8378, 33232, 7, 16, 626, 262, 1077, 320, 11944, 9438, 11, 5042, 23073, 8, 284, 7860, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_request_with_duration_bucket() { let threshold = Duration::from_secs(3); let mut metrics = Metrics { requests_duration_buckets: Some(vec![RequestDurationBucket::new(threshold)]), ..Metrics::default() }; let requests_below_threshold = RequestResult { duration: Duration::from_secs(1), call_status: CallStatus::Success, }; let request_above_threshold = RequestResult { duration: Duration::from_secs(4), call_status: CallStatus::Success, }; let bucket = metrics.find_request_duration_bucket(threshold).unwrap(); assert_eq!(bucket.requests_count_above_threshold(), 0); assert_eq!(bucket.requests_count_below_threshold(), 0); // Act 1 metrics.process_request(requests_below_threshold); let bucket = metrics.find_request_duration_bucket(threshold).unwrap(); assert_eq!(bucket.requests_count_above_threshold(), 0); assert_eq!(bucket.requests_count_below_threshold(), 1); assert_eq!(bucket.requests_ratio_above_threshold(), 0.0); assert_eq!(bucket.requests_ratio_below_threshold(), 1.0); // Act 2 metrics.process_request(request_above_threshold); let bucket = metrics.find_request_duration_bucket(threshold).unwrap(); assert_eq!(bucket.requests_count_above_threshold(), 1); assert_eq!(bucket.requests_count_below_threshold(), 1); assert_eq!(bucket.requests_ratio_above_threshold(), 0.5); assert_eq!(bucket.requests_ratio_below_threshold(), 0.5); // Additional assertions let non_predefined_threshold = Duration::from_secs(5); let non_existing_bucket = metrics.find_request_duration_bucket(non_predefined_threshold); assert!(non_existing_bucket.is_none()); assert_eq!(2, metrics.success_calls()); assert_eq!(0, metrics.failure_calls()); assert_eq!(0, metrics.errors().len()); assert_eq!(metrics.min_request_duration, Duration::from_secs(1)); assert_eq!(metrics.max_request_duration, Duration::from_secs(4)); }
rust_cleaned_test_functions.jsonl/45093
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 935 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11305, 7893, 6615, 25454, 38749, 368, 341, 286, 1077, 12171, 284, 21045, 486, 1499, 68718, 7, 18, 317, 286, 1077, 5206, 16734, 284, 54190, 341, 310, 7388, 25454, 84156, 25, 4329, 25592, 20703, 190...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_first_vote_msg() { let tbl = vec![ ( MessageType::MsgRequestVote, peer_storage::RAFT_INIT_LOG_TERM + 1, true, ), ( MessageType::MsgRequestVote, peer_storage::RAFT_INIT_LOG_TERM, false, ), ( MessageType::MsgHup, peer_storage::RAFT_INIT_LOG_TERM + 1, false, ), ]; for (msg_type, term, is_vote) in tbl { let mut msg = Message::new(); msg.set_msg_type(msg_type); msg.set_term(term); let mut m = RaftMessage::new(); m.set_message(msg); assert_eq!(is_first_vote_msg(&m), is_vote); } }
rust_cleaned_test_functions.jsonl/10722
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 515 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12978, 54360, 6483, 368, 341, 286, 1077, 21173, 284, 7486, 90515, 310, 2399, 394, 62336, 486, 6611, 1900, 41412, 345, 394, 14397, 23310, 486, 53958, 14446, 8419, 75220, 488, 220, 16, 345, 394, 830...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_explode_single_col() -> Result<()> { let s0 = Series::new("a", &[1i32, 2, 3]); let s1 = Series::new("b", &[1i32, 1, 1]); let list = Series::new("foo", &[s0, s1]); let df = DataFrame::new(vec![list])?; let out = df.explode(&["foo"])?; let out = out .column("foo")? .i32()? .into_no_null_iter() .collect::<Vec<_>>(); assert_eq!(out, &[1i32, 2, 3, 1, 1, 1]); Ok(()) }
rust_cleaned_test_functions.jsonl/89133
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 289 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2702, 70744, 19487, 10211, 368, 1464, 5714, 71698, 341, 286, 1077, 274, 15, 284, 11131, 486, 931, 445, 64, 497, 44590, 16, 72, 18, 17, 11, 220, 17, 11, 220, 18, 2558, 286, 1077, 274, 16, 284...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
#[test] fn test_put_get_simple() { let ledger_path = get_tmp_ledger_path!(); let ledger = Blockstore::open(&ledger_path).unwrap(); // Test meta column family let meta = SlotMeta::new(0, 1); ledger.meta_cf.put(0, &meta).unwrap(); let result = ledger .meta_cf .get(0) .unwrap() .expect("Expected meta object to exist"); assert_eq!(result, meta); // Test erasure column family let erasure = vec![1u8; 16]; let erasure_key = (0, 0); ledger .code_shred_cf .put_bytes(erasure_key, &erasure) .unwrap(); let result = ledger .code_shred_cf .get_bytes(erasure_key) .unwrap() .expect("Expected erasure object to exist"); assert_eq!(result, erasure); // Test data column family let data = vec![2u8; 16]; let data_key = (0, 0); ledger.data_shred_cf.put_bytes(data_key, &data).unwrap(); let result = ledger .data_shred_cf .get_bytes(data_key) .unwrap() .expect("Expected data object to exist"); assert_eq!(result, data); // Destroying database without closing it first is undefined behavior drop(ledger); Blockstore::destroy(&ledger_path).expect("Expected successful database destruction"); }
rust_cleaned_test_functions.jsonl/7594
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 715 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15557, 3062, 30015, 368, 341, 286, 1077, 46933, 2638, 284, 633, 16125, 38367, 1389, 2638, 0, 543, 286, 1077, 46933, 284, 8362, 4314, 486, 2508, 2099, 50704, 2638, 568, 15454, 1428, 286, 442, 3393,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_smallest_repunit_div_by_k() { assert_eq!(smallest_repunit_div_by_k(1), 1); assert_eq!(smallest_repunit_div_by_k(2), -1); assert_eq!(smallest_repunit_div_by_k(3), 3); }
rust_cleaned_test_functions.jsonl/3345
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 105 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15874, 19236, 25533, 3843, 16237, 3710, 4698, 368, 341, 262, 2060, 10714, 10297, 3563, 19236, 25533, 3843, 16237, 3710, 4698, 7, 16, 701, 220, 16, 317, 262, 2060, 10714, 10297, 3563, 19236, 25533, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bits_into_fr() { use pairing::bn256::*; // representation of 4 + 8 + 256 = 12 + 256 = 268 = 0x010c; let bits: Vec<bool> = [false, false, true, true, false, false, false, false, true].to_vec(); let fe: Fr = le_bit_vector_into_field_element::<Fr>(&bits); debug!("{}", fe); }
rust_cleaned_test_functions.jsonl/63322
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 156 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 20034, 45514, 41537, 368, 341, 286, 990, 47713, 486, 11081, 17, 20, 21, 79304, 286, 442, 13042, 315, 220, 19, 488, 220, 23, 488, 220, 17, 20, 21, 284, 220, 16, 17, 488, 220, 17, 20, 21, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_undefined_rule_error() { let mut kb = KnowledgeBase::new(); kb.add_rule(rule!("f", [sym!("x")] => call!("no_such_rule", [sym!("y")]))); let errors = check_undefined_rule_calls(&kb); assert_eq!(errors.len(), 1); assert!(format!("{}", errors.first().unwrap()) .contains("Call to undefined rule: no_such_rule(y)")); }
rust_cleaned_test_functions.jsonl/102138
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 186 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 62, 9614, 21124, 4096, 368, 341, 286, 1077, 5206, 38653, 284, 31925, 3978, 486, 931, 543, 286, 38653, 1364, 21124, 34944, 17223, 69, 497, 508, 23802, 17223, 87, 30917, 589, 1618, 17223, 2152, 643,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_missing_file_ok_if_skip_missing() { let mut cmd = main_command(); let filename = format!("non-existing-file-{}", uuid::Uuid::new_v4().to_string()); cmd.arg(&filename).arg("--skip-missing").assert().success(); }
rust_cleaned_test_functions.jsonl/134341
{ "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, 40447, 2458, 19817, 11119, 44830, 40447, 368, 341, 286, 1077, 5206, 5439, 284, 1887, 10811, 543, 286, 1077, 3899, 284, 3561, 17223, 6280, 49357, 14203, 12, 42351, 16040, 486, 38431, 486, 931, 2273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_instruction_relative() { let instruction0 = Instruction::new_with_bincode( Pubkey::new_unique(), &0, vec![AccountMeta::new(Pubkey::new_unique(), false)], ); let instruction1 = Instruction::new_with_bincode( Pubkey::new_unique(), &0, vec![AccountMeta::new(Pubkey::new_unique(), false)], ); let instruction2 = Instruction::new_with_bincode( Pubkey::new_unique(), &0, vec![AccountMeta::new(Pubkey::new_unique(), false)], ); let sanitized_message = SanitizedMessage::try_from(LegacyMessage::new( &[ instruction0.clone(), instruction1.clone(), instruction2.clone(), ], Some(&Pubkey::new_unique()), )) .unwrap(); let key = id(); let mut lamports = 0; let mut data = construct_instructions_data(&sanitized_message.decompile_instructions()); store_current_index(&mut data, 1); let owner = crate::sysvar::id(); let mut account_info = AccountInfo::new( &key, false, false, &mut lamports, &mut data, &owner, false, 0, ); assert_eq!( Err(ProgramError::InvalidArgument), get_instruction_relative(-2, &account_info) ); assert_eq!( instruction0, get_instruction_relative(-1, &account_info).unwrap() ); assert_eq!( instruction1, get_instruction_relative(0, &account_info).unwrap() ); assert_eq!( instruction2, get_instruction_relative(1, &account_info).unwrap() ); assert_eq!( Err(ProgramError::InvalidArgument), get_instruction_relative(2, &account_info) ); { let mut data = account_info.try_borrow_mut_data().unwrap(); store_current_index(&mut data, 0); } assert_eq!( Err(ProgramError::InvalidArgument), get_instruction_relative(-1, &account_info) ); assert_eq!( instruction0, get_instruction_relative(0, &account_info).unwrap() ); assert_eq!( instruction1, get_instruction_relative(1, &account_info).unwrap() ); assert_eq!( instruction2, get_instruction_relative(2, &account_info).unwrap() ); assert_eq!( Err(ProgramError::InvalidArgument), get_instruction_relative(3, &account_info) ); let key = Pubkey::new_unique(); account_info.key = &key; assert_eq!( Err(ProgramError::UnsupportedSysvar), get_instruction_relative(0, &account_info) ); }
rust_cleaned_test_functions.jsonl/78027
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1568 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 54923, 29286, 368, 341, 286, 1077, 7600, 15, 284, 29051, 486, 931, 6615, 21816, 1851, 1006, 310, 22611, 792, 486, 931, 21218, 3148, 310, 609, 15, 345, 310, 7486, 20703, 7365, 12175, 486, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_verify_multisig() { solana_logger::setup(); let tx = test_multisig_tx(); let mut packet = Packet::from_data(None, tx).unwrap(); let n = 4; let num_batches = 3; let mut batches = generate_packet_batches(&packet, n, num_batches); packet.buffer_mut()[40] = packet.data(40).unwrap().wrapping_add(8); batches[0].push(packet); // verify packets ed25519_verify(&mut batches); // check result let ref_ans = 1u8; let mut ref_vec = vec![vec![ref_ans; n]; num_batches]; ref_vec[0].push(0u8); assert!(batches .iter() .flat_map(|batch| batch.iter()) .zip(ref_vec.into_iter().flatten()) .all(|(p, discard)| { if discard == 0 { p.meta.discard() } else { !p.meta.discard() } })); }
rust_cleaned_test_functions.jsonl/39082
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 532 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35638, 26290, 285, 343, 368, 341, 286, 2048, 3362, 27413, 486, 15188, 1428, 286, 1077, 9854, 284, 1273, 26290, 285, 343, 17805, 543, 286, 1077, 5206, 10151, 284, 28889, 486, 1499, 1769, 26717, 11,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_ls_ignore_backups() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; at.touch("somefile"); at.touch("somebackup~"); at.touch(".somehiddenfile"); at.touch(".somehiddenbackup~"); scene.ucmd().arg("-B").succeeds().stdout_is("somefile\n"); scene .ucmd() .arg("--ignore-backups") .succeeds() .stdout_is("somefile\n"); scene .ucmd() .arg("-aB") .succeeds() .stdout_contains(".somehiddenfile") .stdout_contains("somefile") .stdout_does_not_contain("somebackup") .stdout_does_not_contain(".somehiddenbackup~"); scene .ucmd() .arg("-a") .arg("--ignore-backups") .succeeds() .stdout_contains(".somehiddenfile") .stdout_contains("somefile") .stdout_does_not_contain("somebackup") .stdout_does_not_contain(".somehiddenbackup~"); }
rust_cleaned_test_functions.jsonl/71220
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 485 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 53174, 58493, 3895, 8602, 368, 341, 262, 1077, 6109, 284, 3393, 54031, 486, 931, 67811, 1269, 0, 1423, 262, 1077, 518, 284, 609, 22483, 67785, 18513, 401, 262, 518, 42129, 445, 14689, 1192, 797, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_positive_quota() { // arrange const QUOTA: i64 = 200000; let (tmp, max) = setup("test_set_positive_quota", CGROUP_CPU_MAX); let cpu = LinuxCpuBuilder::new().with_quota(QUOTA).build(); // act Cpu::apply(&tmp, &cpu).expect("apply cpu"); // assert let content = fs::read_to_string(max) .unwrap_or_else(|_| panic!("read {} file content", CGROUP_CPU_MAX)); assert_eq!(content, format!("{} {}", QUOTA, DEFAULT_PERIOD)) }
rust_cleaned_test_functions.jsonl/126559
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 251 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2602, 54160, 97093, 368, 341, 286, 442, 30893, 198, 286, 733, 25999, 36544, 25, 600, 21, 19, 284, 220, 17, 15, 15, 15, 15, 15, 280, 286, 1077, 320, 5173, 11, 1932, 8, 284, 6505, 445, 1944, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bank_hash_consistency() { solana_logger::setup(); let mut genesis_config = GenesisConfig::new( &[( Pubkey::new(&[42; 32]), Account::new(1_000_000_000_000, 0, &system_program::id()), )], &[], ); genesis_config.creation_time = 0; genesis_config.cluster_type = ClusterType::MainnetBeta; genesis_config.rent.burn_percent = 100; let mut bank = Arc::new(Bank::new(&genesis_config)); assert_eq!(bank.get_slots_in_epoch(0), 32); loop { goto_end_of_slot(Arc::get_mut(&mut bank).unwrap()); if bank.slot == 0 { assert_eq!( bank.hash().to_string(), "6oxxAqridoSSPQ1rnEh8qBhQpMmLUve3X4fsNNr2gExE" ); } if bank.slot == 32 { assert_eq!( bank.hash().to_string(), "9FwpFSUvbCfzQMGXDSdvnNhNPpvHUsEJyNA9P3nqiLaJ" ); } if bank.slot == 64 { assert_eq!( bank.hash().to_string(), "7p6g7GmE9quceefLtPe97fr9YQeYWB562os2ttiG3Anq" ); } if bank.slot == 128 { assert_eq!( bank.hash().to_string(), "DfeuEsVvVRUkce31sM1d4Vhhp6Si99JdVEtYddbBgLKV" ); break; } bank = Arc::new(new_from_parent(&bank)); } }
rust_cleaned_test_functions.jsonl/63786
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1012 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35733, 8950, 31971, 47094, 368, 341, 286, 2048, 3362, 27413, 486, 15188, 1428, 286, 1077, 5206, 59366, 5332, 284, 40788, 2648, 486, 931, 1006, 310, 44590, 1006, 394, 22611, 792, 486, 931, 2099, 58...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_unchanged_ranges_non_unique_removed() { assert_eq!( unchanged_ranges( b"a a a a", b"a b a c", &[0..1, 2..3, 4..5, 6..7], &[0..1, 2..3, 4..5, 6..7], ), vec![(0..1, 0..1), (2..3, 4..5)] ); }
rust_cleaned_test_functions.jsonl/89250
{ "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, 62, 3185, 3726, 58748, 21637, 21218, 68248, 368, 341, 286, 2060, 10714, 33673, 310, 34857, 58748, 1006, 394, 293, 56693, 264, 264, 264, 756, 394, 293, 56693, 293, 264, 272, 756, 394, 44590, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_guild_channel_id() { assert_eq!( GuildChannel::Category(guild_category()).id(), ChannelId(123) ); assert_eq!(GuildChannel::Text(guild_text()).id(), ChannelId(456)); assert_eq!(GuildChannel::Voice(guild_voice()).id(), ChannelId(789)); assert_eq!(GuildChannel::Stage(guild_stage()).id(), ChannelId(789)); }
rust_cleaned_test_functions.jsonl/54434
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 187 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 1889, 1498, 14571, 842, 368, 341, 286, 2060, 10714, 33673, 310, 32492, 9629, 486, 6746, 92103, 11847, 6011, 307, 3148, 310, 13434, 764, 7, 16, 17, 18, 340, 286, 1439, 286, 2060, 10714, 10297, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bench_multiple_packages() { if !is_nightly() { return; } let p = project() .file( "Cargo.toml", r#" [project] name = "foo" authors = [] version = "0.1.0" [dependencies.bar] path = "../bar" [dependencies.baz] path = "../baz" "#, ).file("src/lib.rs", "") .build(); let _bar = project() .at("bar") .file( "Cargo.toml", r#" [project] name = "bar" authors = [] version = "0.1.0" [[bench]] name = "bbar" test = true "#, ).file("src/lib.rs", "") .file( "benches/bbar.rs", r#" #![feature(test)] extern crate test; use test::Bencher; #[bench] fn bench_bar(_b: &mut Bencher) {} "#, ).build(); let _baz = project() .at("baz") .file( "Cargo.toml", r#" [project] name = "baz" authors = [] version = "0.1.0" [[bench]] name = "bbaz" test = true "#, ).file("src/lib.rs", "") .file( "benches/bbaz.rs", r#" #![feature(test)] extern crate test; use test::Bencher; #[bench] fn bench_baz(_b: &mut Bencher) {} "#, ).build(); p.cargo("bench -p bar -p baz") .with_stderr_contains("[RUNNING] target/release/deps/bbaz-[..][EXE]") .with_stdout_contains("test bench_baz ... bench: [..]") .with_stderr_contains("[RUNNING] target/release/deps/bbar-[..][EXE]") .with_stdout_contains("test bench_bar ... bench: [..]") .run(); }
rust_cleaned_test_functions.jsonl/50462
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1206 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 19762, 45233, 41874, 368, 341, 262, 421, 753, 285, 1089, 71948, 368, 341, 286, 470, 280, 262, 555, 262, 1077, 281, 284, 2390, 741, 286, 659, 1192, 1006, 310, 330, 98228, 73494, 75, 756, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_uuid_is_empty_functions() -> Result<()> { let tests = vec![ScalarFunctionTest { name: "is-empty-uuid-passed", columns: vec![Series::from_data(vec![ "00000000-0000-0000-0000-000000000000", "5", ])], expect: Series::from_data(vec![true, true]), error: "", }]; test_scalar_functions("isemptyUUID", &tests) }
rust_cleaned_test_functions.jsonl/78853
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 202 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 25540, 6892, 15124, 31708, 368, 1464, 5714, 71698, 341, 262, 1077, 7032, 284, 7486, 20703, 20639, 5152, 2271, 341, 286, 829, 25, 330, 285, 39433, 12, 17128, 46967, 291, 756, 286, 8147, 25, 7486, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_create() { let runc_id = format!("{}", Uuid::new_v4()); let runc_path = env::temp_dir().join(&runc_id).join("runc.amd64"); let runc_root = PathBuf::from(env::var_os("XDG_RUNTIME_DIR").expect("expected temporary path")) .join("rust-runc") .join(&runc_id); fs::create_dir_all(&runc_root).expect("unable to create runc root"); extract_tarball( &PathBuf::from("test_fixture/runc_v1.0.0-rc10.tar.gz"), &env::temp_dir().join(&runc_id), ) .expect("unable to extract runc"); let mut config: RuncConfiguration = Default::default(); config.command = Some(runc_path); config.root = Some(runc_root); let runc = Runc::new(config).expect("Unable to create runc instance"); let task = async move { let id = format!("{}", Uuid::new_v4()); // As an ugly hack leak the pty master handle for the lifecycle of the test process let console_socket = env::temp_dir().join(&id).with_extension("console"); let receive_pty_master = ReceivePtyMaster::new(&console_socket)?; tokio::spawn(async move { match receive_pty_master.receive().await { Ok(pty_master) => { Box::leak(Box::new(pty_master)); } Err(err) => { error!("Receive PTY master error: {}", err); } } }); let bundle = env::temp_dir().join(&id); extract_tarball(&PathBuf::from("test_fixture/busybox.tar.gz"), &bundle) .context(BundleExtractError {})?; runc.create( &id, &bundle, Some(&CreateOpts { pid_file: None, console_socket: Some(console_socket), no_pivot: false, no_new_keyring: false, detach: false, }), ) .await?; runc.state(&id).await }; let mut runtime = Runtime::new().expect("unable to create runtime"); let container = runtime.block_on(task).expect("test failed"); assert_eq!(container.status, Some(String::from("created"))); }
rust_cleaned_test_functions.jsonl/24463
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1281 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8657, 368, 341, 286, 1077, 435, 1347, 842, 284, 3561, 79878, 547, 2423, 486, 931, 2273, 19, 1423, 286, 1077, 435, 1347, 2638, 284, 6105, 486, 3888, 4334, 1005, 5987, 2099, 81, 1347, 842, 568, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_serialize_uint() { let (bytes, handles) = TestInterfaceEvent::Uint { arg: UINT_VALUE }.into_message(SENDER_ID).unwrap().take(); assert!(handles.is_empty()); assert_eq!(bytes, message_bytes!(SENDER_ID, 0 /* opcode */, UINT_VALUE)); }
rust_cleaned_test_functions.jsonl/55791
{ "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, 88686, 15807, 368, 341, 286, 1077, 320, 9651, 11, 13469, 8, 4035, 310, 3393, 5051, 1556, 486, 21570, 314, 1392, 25, 13661, 7476, 16908, 18122, 6462, 51048, 35689, 3450, 568, 15454, 1005, 22769, 54...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_rssi_dbm_field_not_valid() { let rx_info = banjo_wlan_mac::WlanRxInfo { valid_fields: 0, rssi_dbm: 20, ..empty_rx_info() }; assert_eq!(get_rssi_dbm(rx_info), None); }
rust_cleaned_test_functions.jsonl/122386
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 124 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 1710, 45656, 8685, 76, 5013, 7913, 8337, 368, 341, 286, 1077, 19111, 3109, 4035, 310, 8943, 7305, 1670, 10715, 22802, 486, 54, 10715, 50639, 1731, 314, 2697, 12132, 25, 220, 15, 11, 435, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_set_setting_handlers() { let settings = Settings::new(); let property_name = "foo"; fn noop_update(_v: Value) {} fn noop_read() -> Value { Value::Nil } settings.set_setting_handlers(property_name, noop_update, noop_read); let listeners = settings.listeners.read(); let readers = settings.readers.read(); let listener = listeners.get(property_name).unwrap(); let reader = readers.get(property_name).unwrap(); assert_eq!(&(noop_update as UpdateHandlerFunc), listener); assert_eq!(&(noop_read as ReaderFunc), reader); }
rust_cleaned_test_functions.jsonl/29874
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 281 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2602, 20313, 57037, 368, 341, 286, 1077, 5003, 284, 11296, 486, 931, 1428, 286, 1077, 3343, 1269, 284, 330, 7975, 3302, 286, 5168, 60829, 8882, 2490, 85, 25, 5162, 8, 10086, 286, 5168, 60829, 64...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_schema_attrs_success(){ init!("true"); let (handle, schema_attrs ) = get_schema_attrs("Check For Success".to_string(), SCHEMA_ID.to_string()).unwrap(); assert!(schema_attrs.contains(r#""schema_id":"2hoqvcwupRTUNkXn6ArYzs:2:test-licence:4.4.4""#)); assert!(schema_attrs.contains(r#""data":["height","name","sex","age"]"#)); assert!(handle > 0); }
rust_cleaned_test_functions.jsonl/29690
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 200 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 25371, 39578, 18632, 3032, 286, 2930, 17223, 1866, 797, 286, 1077, 320, 8192, 11, 10802, 39578, 873, 284, 633, 25371, 39578, 445, 3973, 1752, 13047, 3263, 983, 3904, 1507, 7531, 35839, 3450, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_expect_timestamp_or_null() { assert_eq!( Ok(None), expect_timestamp_or_null(value_null(0), Format::HttpDate) ); assert_eq!( Ok(Some(DateTime::from_secs_f64(2048.0))), expect_timestamp_or_null(value_number(0, Number::Float(2048.0)), Format::EpochSeconds) ); assert_eq!( Ok(Some(DateTime::from_secs_f64(1445412480.0))), expect_timestamp_or_null( value_string(0, "Wed, 21 Oct 2015 07:28:00 GMT"), Format::HttpDate ) ); assert_eq!( Ok(Some(DateTime::from_secs_f64(1445412480.0))), expect_timestamp_or_null(value_string(0, "2015-10-21T07:28:00Z"), Format::DateTime) ); let err = Error::new( ErrorReason::Custom( "only `Infinity`, `-Infinity`, `NaN` can represent a float as a string but found `wrong`".into(), ), Some(0), ); assert_eq!( Err(err), expect_timestamp_or_null(value_string(0, "wrong"), Format::EpochSeconds) ); assert_eq!( Err(Error::custom("expected ValueString or ValueNull")), expect_timestamp_or_null(value_number(0, Number::Float(0.0)), Format::DateTime) ); }
rust_cleaned_test_functions.jsonl/58157
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 726 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 68918, 23073, 8734, 15162, 368, 341, 286, 2060, 10714, 33673, 310, 7622, 26717, 1326, 310, 1720, 23073, 8734, 15162, 3679, 15162, 7, 15, 701, 15042, 486, 2905, 1916, 340, 286, 1439, 286, 2060, 107...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_die_lock() { let x = Arc::new(Mutex::new(0)); let clone = (x.clone(), x.clone()); { let mut v = clone.0.lock().unwrap(); *v += 1; } clone.1.lock(); }
rust_cleaned_test_functions.jsonl/78839
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 109 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 61588, 9818, 368, 341, 262, 1077, 856, 284, 19689, 486, 931, 3189, 9371, 486, 931, 7, 15, 1106, 262, 1077, 14715, 284, 320, 87, 15997, 1507, 856, 15997, 1423, 262, 341, 286, 1077, 5206, 348, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_column() { let builder = ColumnsBuilder::new(); let columns = builder.build(); assert_eq!(columns.len(), 0); let builder = ColumnsBuilder::new(); let columns = builder .column(Column::create().build()) .column(Column::create().build()) .build(); assert_eq!(columns.len(), 2); }
rust_cleaned_test_functions.jsonl/73875
{ "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, 8744, 368, 341, 286, 1077, 7363, 284, 53573, 3297, 486, 931, 543, 286, 1077, 8147, 284, 7363, 13239, 1428, 286, 2060, 10714, 10297, 16369, 19406, 1507, 220, 15, 626, 286, 1077, 7363, 284, 53573, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_entry_insert() { let mut map = important_cities(); for &state in ALL_STATES { let value = *map.entry(state).or_insert_with(|| state.city()); assert_eq!(value, state.city()); } check_cities(ALL_STATES, &map); }
rust_cleaned_test_functions.jsonl/38663
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 117 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9078, 17678, 368, 341, 262, 1077, 5206, 2415, 284, 2989, 666, 1361, 1428, 262, 369, 609, 2454, 304, 13097, 87437, 341, 286, 1077, 897, 284, 353, 2186, 24116, 8390, 568, 269, 17678, 6615, 79453, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_take_value_index_from_fixed_list() { let list = build_fixed_size_list_nullable::<Int32Type>( vec![ Some(vec![Some(1), Some(2), None]), Some(vec![Some(4), None, Some(6)]), None, Some(vec![None, Some(8), Some(9)]), ], 3, ); let indices = UInt32Array::from(vec![2, 1, 0]); let indexed = take_value_indices_from_fixed_size_list(&list, &indices, 3).unwrap(); assert_eq!(indexed, UInt32Array::from(vec![6, 7, 8, 3, 4, 5, 0, 1, 2])); let indices = UInt32Array::from(vec![3, 2, 1, 2, 0]); let indexed = take_value_indices_from_fixed_size_list(&list, &indices, 3).unwrap(); assert_eq!( indexed, UInt32Array::from(vec![9, 10, 11, 6, 7, 8, 3, 4, 5, 6, 7, 8, 0, 1, 2]) ); }
rust_cleaned_test_functions.jsonl/67655
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 512 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 73261, 3142, 3560, 5673, 37839, 2019, 368, 341, 286, 1077, 1140, 284, 1936, 37839, 2368, 2019, 69743, 27638, 1072, 18, 17, 929, 17055, 310, 7486, 90515, 394, 4329, 25592, 20703, 8373, 7, 16, 701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_range_step_128() { use core::u128::MAX as UMAX; assert!(super::range_step(0u128, 20, 5).eq([0, 5, 10, 15].iter().cloned())); assert!(super::range_step(20i128, 0, -5).eq([20, 15, 10, 5].iter().cloned())); assert!(super::range_step(20i128, 0, -6).eq([20, 14, 8, 2].iter().cloned())); assert!(super::range_step(UMAX - 55, UMAX, 50).eq([UMAX - 55, UMAX - 5].iter().cloned())); assert!(super::range_step(200i128, -5, 1).eq(iter::empty())); assert!(super::range_step(200i128, 200, 1).eq(iter::empty())); }
rust_cleaned_test_functions.jsonl/37397
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 280 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9698, 11946, 62, 16, 17, 23, 368, 341, 286, 990, 6200, 486, 84, 16, 17, 23, 486, 10586, 438, 547, 10586, 401, 286, 2060, 10297, 9522, 486, 9669, 11946, 7, 15, 84, 16, 17, 23, 11, 220, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_radians() { let a = Angle::from_radians(PI/2.0); assert_approx_eq!(a.radians(), PI/2.0); assert_approx_eq!(a.degrees(), 90.0); let a = Angle::from_radians(PI/6.0); assert_approx_eq!(a.radians(), PI/6.0); assert_approx_eq!(a.degrees(), 30.0); }
rust_cleaned_test_functions.jsonl/109958
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 177 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 1710, 20736, 368, 341, 286, 1077, 264, 284, 36237, 486, 1499, 1710, 20736, 7, 1893, 14, 17, 13, 15, 317, 286, 2060, 90425, 10714, 10297, 64, 90644, 1507, 22578, 14, 17, 13, 15, 317, 286,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_simple_pointer_ud() { let mut l = Lexer::<DefaultContext>::new(b"volatile A::B::C * x = nullptr"); let p = TypeDeclaratorParser::new(&mut l); let mut context = Context::default(); let (_, decl) = p.parse(None, None, true, &mut context).unwrap(); let decl = decl.unwrap(); assert_eq!( decl, Rc::new(TypeDeclarator { typ: Type { base: BaseType::UD(Box::new(UserDefined { name: mk_id!("A", "B", "C"), typ: UDType::Indirect(TypeToFix::default()) })), cv: CVQualifier::VOLATILE, pointers: Some(vec![Pointer { kind: PtrKind::Pointer, attributes: None, cv: CVQualifier::empty(), ms: MSModifier::empty(), }]), }, specifier: Specifier::empty(), identifier: Identifier { identifier: Some(mk_id!("x")), attributes: None }, init: Some(Initializer::Equal(ExprNode::Nullptr(Box::new(Nullptr {})))), bitfield_size: None, }) ); }
rust_cleaned_test_functions.jsonl/117518
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 780 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30015, 21425, 71939, 368, 341, 286, 1077, 5206, 326, 284, 85082, 27638, 3675, 1972, 6831, 931, 1883, 1, 27307, 362, 486, 33, 486, 34, 353, 856, 284, 6827, 797, 286, 1077, 281, 284, 3990, 1912, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_8601_24() { let interval = Interval::from_iso("PT1.2S").unwrap(); let interval_exp = Interval::new(0, 0, 1_200_000); assert_eq!(interval, interval_exp); }
rust_cleaned_test_functions.jsonl/90543
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 102 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 62, 23, 21, 15, 16, 62, 17, 19, 368, 341, 286, 1077, 9873, 284, 40584, 486, 1499, 49660, 445, 2828, 16, 13, 17, 50, 1827, 15454, 543, 286, 1077, 9873, 14214, 284, 40584, 486, 931, 7, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_no_arp_request_on_cache_hit() { // ARP request or install a retry timer. let mut ctx = DummyContext::default(); // Perform a gratuitous ARP to populate the cache. send_arp_packet( &mut ctx, ArpOp::Response, TEST_REMOTE_IPV4, TEST_REMOTE_IPV4, TEST_REMOTE_MAC, TEST_REMOTE_MAC, ); // Perform the lookup. lookup(&mut ctx, (), TEST_LOCAL_MAC, TEST_REMOTE_IPV4); // We should not have sent any ARP request. assert_eq!(ctx.frames().len(), 0); // We should not have set a retry timer. assert!(ctx.cancel_timer(ArpTimerId::new_request_retry((), TEST_REMOTE_IPV4)).is_none()); }
rust_cleaned_test_functions.jsonl/16993
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 385 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6536, 62, 7876, 7893, 4470, 11529, 37697, 368, 341, 1789, 286, 442, 91337, 1681, 476, 4582, 264, 22683, 9021, 382, 286, 1077, 5206, 5635, 284, 50567, 1972, 486, 2258, 1428, 286, 442, 25001, 264, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_show_executor_gas_spent() { let _pool = ConstPool::new(); let text = r" script { use 0x1::Signer; fun main(s: &signer) { let _ = Signer::address_of(s); } }"; let res = execute_script( MoveFile::with_content(script_path(), text), vec![stdlib_mod("signer.move")], "libra", "0x1111111111111111", vec![], ) .unwrap(); assert_eq!(res.overall_gas_spent(), 7); }
rust_cleaned_test_functions.jsonl/43920
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 256 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15267, 81207, 82116, 10123, 306, 368, 341, 262, 1077, 716, 10285, 284, 24522, 10551, 486, 931, 1428, 262, 1077, 1467, 284, 435, 698, 262, 5316, 341, 286, 990, 220, 15, 87, 16, 486, 7264, 261, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_write() { use std::io::Write; let data = [1, 2, 3, 4, 5]; let mut small_vec: SmallVec<[u8; 2]> = SmallVec::new(); let len = small_vec.write(&data[..]).unwrap(); assert_eq!(len, 5); assert_eq!(small_vec.as_ref(), data.as_ref()); let mut small_vec: SmallVec<[u8; 2]> = SmallVec::new(); small_vec.write_all(&data[..]).unwrap(); assert_eq!(small_vec.as_ref(), data.as_ref()); }
rust_cleaned_test_functions.jsonl/88176
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 241 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9165, 368, 341, 286, 990, 1460, 486, 815, 486, 7985, 401, 286, 1077, 821, 284, 508, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 4821, 286, 1077, 5206, 2613, 13251, 25, 14994, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_encryption_decryption() { let n_v = get_parameters(Version::NtruPrime761); let g = Poly { positions: gen_positions(n_v.w, n_v.p), coefficients: gen_coefficients(n_v.w), }; let f = Poly { positions: gen_positions(n_v.w, n_v.p), coefficients: gen_coefficients(n_v.w), }; let (pk, sk) = key_gen(&g, &f, &n_v).unwrap(); // message let msg = Poly { positions: gen_positions(n_v.w, n_v.p), coefficients: gen_coefficients(n_v.w), }; let m = build_poly(&msg, n_v.p); // encryption let c = encrypt(&m, &pk, &n_v); let result = decrypt(&c, &sk, &n_v).unwrap(); for i in 0..result.len() { if result[i] != m[i] { panic!("NTRU prime failed!"); } } }
rust_cleaned_test_functions.jsonl/133918
{ "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, 13781, 15597, 13783, 15597, 368, 341, 262, 1077, 308, 2273, 284, 633, 18263, 7, 5637, 486, 45, 65253, 32306, 22, 21, 16, 317, 262, 1077, 342, 284, 18767, 341, 286, 9892, 25, 4081, 37219, 1445, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_proto_convert_vote() { let signer = ValidatorSigner::<Ed25519PrivateKey>::random(None); let vote = VoteMsg::new( HashValue::random(), ExecutedState::state_for_genesis(), 1, signer.author(), placeholder_ledger_info(), &signer, ); assert_protobuf_encode_decode(&vote); }
rust_cleaned_test_functions.jsonl/28471
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 167 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37689, 34910, 54360, 368, 341, 262, 1077, 70039, 284, 32566, 7264, 261, 27638, 2715, 17, 20, 20, 16, 24, 75981, 6831, 11463, 26717, 317, 262, 1077, 6910, 284, 34034, 6611, 486, 931, 1006, 286, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_scoring_p6() { let mut peer_score_params = PeerScoreParams::default(); peer_score_params.ip_colocation_factor_threshold = 5.0; peer_score_params.ip_colocation_factor_weight = -2.0; let (mut gs, _, _) = inject_nodes1() .peer_no(0) .topics(vec![]) .to_subscribe(false) .gs_config(GossipsubConfig::default()) .explicit(0) .outbound(0) .scoring(Some((peer_score_params, PeerScoreThresholds::default()))) .create_network(); //create 5 peers with the same ip let addr = Multiaddr::from(Ipv4Addr::new(10, 1, 2, 3)); let peers = vec![ add_peer_with_addr(&mut gs, &vec![], false, false, addr.clone()), add_peer_with_addr(&mut gs, &vec![], false, false, addr.clone()), add_peer_with_addr(&mut gs, &vec![], true, false, addr.clone()), add_peer_with_addr(&mut gs, &vec![], true, false, addr.clone()), add_peer_with_addr(&mut gs, &vec![], true, true, addr.clone()), ]; //create 4 other peers with other ip let addr2 = Multiaddr::from(Ipv4Addr::new(10, 1, 2, 4)); let others = vec![ add_peer_with_addr(&mut gs, &vec![], false, false, addr2.clone()), add_peer_with_addr(&mut gs, &vec![], false, false, addr2.clone()), add_peer_with_addr(&mut gs, &vec![], true, false, addr2.clone()), add_peer_with_addr(&mut gs, &vec![], true, false, addr2.clone()), ]; //no penalties yet for peer in peers.iter().chain(others.iter()) { assert_eq!(gs.peer_score.as_ref().unwrap().0.score(peer), 0.0); } //add additional connection for 3 others with addr for i in 0..3 { gs.inject_connection_established( &others[i], &ConnectionId::new(0), &ConnectedPoint::Dialer { address: addr.clone(), }, ); } //penalties apply squared for peer in peers.iter().chain(others.iter().take(3)) { assert_eq!(gs.peer_score.as_ref().unwrap().0.score(peer), 9.0 * -2.0); } //fourth other peer still no penalty assert_eq!(gs.peer_score.as_ref().unwrap().0.score(&others[3]), 0.0); //add additional connection for 3 of the peers to addr2 for i in 0..3 { gs.inject_connection_established( &peers[i], &ConnectionId::new(0), &ConnectedPoint::Dialer { address: addr2.clone(), }, ); } //double penalties for the first three of each for peer in peers.iter().take(3).chain(others.iter().take(3)) { assert_eq!( gs.peer_score.as_ref().unwrap().0.score(peer), (9.0 + 4.0) * -2.0 ); } //single penalties for the rest for peer in peers.iter().skip(3) { assert_eq!(gs.peer_score.as_ref().unwrap().0.score(peer), 9.0 * -2.0); } assert_eq!( gs.peer_score.as_ref().unwrap().0.score(&others[3]), 4.0 * -2.0 ); //two times same ip doesn't count twice gs.inject_connection_established( &peers[0], &ConnectionId::new(0), &ConnectedPoint::Dialer { address: addr.clone(), }, ); //nothing changed //double penalties for the first three of each for peer in peers.iter().take(3).chain(others.iter().take(3)) { assert_eq!( gs.peer_score.as_ref().unwrap().0.score(peer), (9.0 + 4.0) * -2.0 ); } //single penalties for the rest for peer in peers.iter().skip(3) { assert_eq!(gs.peer_score.as_ref().unwrap().0.score(peer), 9.0 * -2.0); } assert_eq!( gs.peer_score.as_ref().unwrap().0.score(&others[3]), 4.0 * -2.0 ); }
rust_cleaned_test_functions.jsonl/66933
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2187 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13171, 5503, 620, 21, 368, 341, 286, 1077, 5206, 14397, 10405, 6745, 284, 45147, 10570, 4870, 486, 2258, 543, 286, 14397, 10405, 6745, 23171, 10211, 2276, 18588, 21858, 284, 220, 20, 13, 15, 280, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
#[test] fn test_simple_3() { let src_data = b"(test) a1 b1 a2 b2"; let expected_document = yass_document!(("test") "a1": "b1", "a2": "b2"); let expected_positions = pos_array![(0, 7), (0, 10), (0, 13), (0, 16)]; let (result_doc, pos_map) = yass_parser::parse(yass_parser::ParserLimits::unlimited(), src_data).unwrap(); assert_eq!(result_doc, expected_document); assert_eq!(result_doc.gather_positions_to_vec(&pos_map), expected_positions); }
rust_cleaned_test_functions.jsonl/126483
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 203 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30015, 62, 18, 368, 341, 262, 1077, 2286, 1769, 284, 293, 29209, 1944, 8, 264, 16, 293, 16, 264, 17, 293, 17, 876, 262, 1077, 3601, 26231, 284, 379, 395, 26231, 10297, 445, 1944, 899, 330, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_example_4() { let input = "totally-real-room-200[decoy]"; let answer: usize = solve(&input, 1); assert_eq!(answer, 0); }
rust_cleaned_test_functions.jsonl/49458
{ "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, 39304, 62, 19, 368, 341, 286, 1077, 1946, 284, 330, 27779, 745, 74795, 47740, 12, 17, 15, 15, 58, 450, 1015, 88, 59757, 286, 1077, 4226, 25, 22301, 284, 11625, 2099, 1355, 11, 220, 16, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_configure() { let logger = Logger::new(); let crnt_thread_name = logger.get_thread_name(); assert!(logger.configure(Some(TEST_INSTANCE_ID.to_string())).is_ok()); assert!(logger.configure(None).is_ok()); assert!(logger.configure(Some(TEST_INSTANCE_ID.to_string())).is_ok()); let (writer, mut reader) = log_channel(); assert!(logger .init(TEST_APP_HEADER.to_string(), Box::new(writer)) .is_ok()); validate_log( &mut Box::new(&mut reader), &format!("{}\n", TEST_APP_HEADER), ); // Check that the logs are written to the configured writer. logger.mock_log(Level::Info, "info"); validate_log( &mut Box::new(&mut reader), &format!( "[TEST-INSTANCE-ID:{}:INFO:logger.rs:0] info\n", crnt_thread_name ), ); }
rust_cleaned_test_functions.jsonl/102859
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 502 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 75887, 368, 341, 286, 1077, 5925, 284, 9514, 486, 931, 543, 286, 1077, 1560, 406, 10814, 1269, 284, 5925, 670, 10814, 1269, 1428, 1789, 286, 2060, 10297, 9786, 21343, 65405, 50320, 42587, 3450, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_memchr_both() { let pos = memchr_both(b'\n', b'-', &b"test\n-this"[..]); assert_eq!(pos, Some(4)); let pos = memchr_both(b'\n', b'-', &b"te\nst\n-this"[..]); assert_eq!(pos, Some(5)); }
rust_cleaned_test_functions.jsonl/13581
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 139 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12976, 16789, 88819, 368, 341, 286, 1077, 1133, 284, 1833, 16789, 88819, 1883, 15777, 77, 516, 293, 24293, 516, 609, 65, 1, 1944, 1699, 60191, 36864, 496, 2558, 286, 2060, 10714, 10297, 966, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_description() { use ::Description; use bech32::FromBase32; let input = from_bech32("xysxxatsyp3k7enxv4js".as_bytes()); let expected = Ok(Description::new("1 cup coffee".to_owned()).unwrap()); assert_eq!(Description::from_base32(&input), expected); }
rust_cleaned_test_functions.jsonl/123245
{ "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, 21039, 11448, 368, 341, 197, 41819, 3504, 5009, 280, 197, 41819, 387, 331, 18, 17, 486, 3830, 3978, 18, 17, 401, 197, 10217, 1946, 284, 504, 880, 4737, 18, 17, 445, 87, 1047, 4146, 1862, 1082,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_equal_is_string_comparison_op() { // undocumented but part of the GNU test suite new_ucmd!().args(&["t", "==", "t"]).succeeds(); new_ucmd!().args(&["t", "==", "f"]).run().status_code(1); }
rust_cleaned_test_functions.jsonl/10991
{ "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, 24598, 11478, 6892, 3904, 90797, 10287, 368, 341, 262, 442, 46657, 714, 949, 315, 279, 4253, 1273, 16182, 198, 262, 501, 68887, 2277, 0, 1005, 2116, 2099, 1183, 83, 497, 98651, 497, 330, 83, 450...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_single_url() { let json = br#" {"response":{ "server":"prod", "protocol":"3.0", "app":[ { "appid":"single-url-appid", "status":"ok", "updatecheck":{ "status":"ok", "urls":{ "url":[ {"codebase":"http://url/base/"} ] }, "manifest":{ "version":"1.0", "actions":{ "action":[ {"event":"install", "run":"full.payload"} ] }, "packages":{ "package":[ { "hash_sha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "size":100000000, "name":"full.payload", "fp": "1.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "required":true } ] } } } } ] }}"#; let result = parse_json_response(json); assert!(result.is_ok()); let response = result.unwrap(); let expected = Response { protocol_version: "3.0".to_string(), server: "prod".to_string(), daystart: None, apps: vec![App { id: "single-url-appid".to_string(), status: OmahaStatus::Ok, update_check: Some(UpdateCheck { urgent_update: None, status: OmahaStatus::Ok, info: None, urls: Some(URLs::new(vec!["http://url/base/".to_string()])), manifest: Some(Manifest { version: "1.0".to_string(), actions: Actions { action: vec![Action { event: Some("install".to_string()), run: Some("full.payload".to_string()), extra_attributes: Map::new(), }], }, packages: Packages { package: vec![Package { name: "full.payload".to_string(), required: true, size: Some(100000000), hash: None, hash_sha256: Some( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" .to_string(), ), fingerprint: "1.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" .to_string(), extra_attributes: Map::new(), }], }, }), }), ..App::default() }], }; assert_eq!(response, expected); }
rust_cleaned_test_functions.jsonl/14137
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1698 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19487, 2903, 368, 341, 262, 1077, 2951, 284, 1411, 2, 698, 4913, 2322, 12602, 330, 4030, 3252, 19748, 756, 330, 17014, 3252, 18, 13, 15, 756, 330, 676, 8899, 198, 256, 341, 262, 330, 58342, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_window_post_two_partitions_matching_2kib_base_8() -> Result<()> { let sector_size = SECTOR_SIZE_2_KIB; let sector_count = *WINDOW_POST_SECTOR_COUNT .read() .unwrap() .get(&sector_size) .unwrap(); window_post::<SectorShape2KiB>(sector_size, 2 * sector_count, sector_count) }
rust_cleaned_test_functions.jsonl/6768
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 164 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12571, 6333, 23241, 99097, 70763, 62, 17, 74, 579, 7651, 62, 23, 368, 1464, 5714, 71698, 341, 262, 1077, 10486, 2368, 284, 5052, 26275, 4098, 62, 17, 10102, 3256, 280, 262, 1077, 10486, 3180, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_pow() { let cases = vec![ ( Some(Real::from(1.0f64)), Some(Real::from(3.0f64)), Some(Real::from(1.0f64)), ), ( Some(Real::from(3.0f64)), Some(Real::from(0.0f64)), Some(Real::from(1.0f64)), ), ( Some(Real::from(2.0f64)), Some(Real::from(4.0f64)), Some(Real::from(16.0f64)), ), ( Some(Real::from(std::f64::INFINITY)), Some(Real::from(0.0f64)), Some(Real::from(1.0f64)), ), (Some(Real::from(4.0f64)), None, None), (None, Some(Real::from(4.0f64)), None), (None, None, None), ]; for (lhs, rhs, expect) in cases { let output: Option<Real> = RpnFnScalarEvaluator::new() .push_param(lhs) .push_param(rhs) .evaluate(ScalarFuncSig::Pow) .unwrap(); assert_eq!(output, expect); } let invalid_cases = vec![ ( Some(Real::from(std::f64::INFINITY)), Some(Real::from(std::f64::INFINITY)), ), (Some(Real::from(0.0f64)), Some(Real::from(-9999999.0f64))), ]; for (lhs, rhs) in invalid_cases { assert!(RpnFnScalarEvaluator::new() .push_param(lhs) .push_param(rhs) .evaluate::<Real>(ScalarFuncSig::Pow) .is_err()); } }
rust_cleaned_test_functions.jsonl/37499
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1062 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 56183, 368, 341, 286, 1077, 5048, 284, 7486, 90515, 310, 2399, 394, 4329, 7, 12768, 486, 1499, 7, 16, 13, 15, 69, 21, 19, 6965, 394, 4329, 7, 12768, 486, 1499, 7, 18, 13, 15, 69, 21, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_authorize_url_with_param() { let client = BasicClient::new( ClientId::new("aaa".to_string()), Some(ClientSecret::new("bbb".to_string())), AuthUrl::new("https://example.com/auth?foo=bar".to_string()).unwrap(), Some(TokenUrl::new("https://example.com/token".to_string()).unwrap()), ); let (url, _) = client .authorize_url(|| CsrfToken::new("csrf_token".to_string())) .url(); assert_eq!( Url::parse( "https://example.com/auth?foo=bar&response_type=code&client_id=aaa&state=csrf_token" ) .unwrap(), url ); }
rust_cleaned_test_functions.jsonl/18585
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 307 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22938, 551, 2903, 6615, 4090, 368, 341, 262, 1077, 2943, 284, 14625, 2959, 486, 931, 1006, 286, 8423, 764, 486, 931, 445, 32646, 3263, 983, 3904, 14702, 286, 4329, 46851, 19773, 486, 931, 445, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_stdin_squeeze_blank() { for same_param in vec!["-s", "--squeeze-blank"] { new_ucmd!() .arg(same_param) .pipe_in("\n\na\n\n\n\n\nb\n\n\n") .succeeds() .stdout_only("\na\n\nb\n\n"); } }
rust_cleaned_test_functions.jsonl/90938
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 173 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15656, 258, 643, 19340, 56103, 368, 341, 262, 369, 1852, 4090, 304, 7486, 0, 1183, 12, 82, 497, 14482, 51913, 16278, 1180, 1341, 341, 286, 501, 68887, 2277, 0, 741, 310, 659, 858, 1141, 373, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_jwt_basic() { fn verify_jwt<A>(jwt_access: A, key: &CoreJsonWebKey, expected_payload: &str) where A: JsonWebTokenAccess< CoreJweContentEncryptionAlgorithm, CoreJwsSigningAlgorithm, CoreJsonWebKeyType, String, >, A::ReturnType: ToString, { { let header = jwt_access.unverified_header(); assert_eq!( header.alg, JsonWebTokenAlgorithm::Signature( CoreJwsSigningAlgorithm::RsaSsaPkcs1V15Sha256, PhantomData, ) ); assert_eq!(header.crit, None); assert_eq!(header.cty, None); assert_eq!( header.kid, Some(JsonWebKeyId::new( "bilbo.baggins@hobbiton.example".to_string() )) ); assert_eq!(header.typ, None); } assert_eq!(jwt_access.unverified_payload_ref(), expected_payload); assert_eq!( jwt_access .payload(&CoreJwsSigningAlgorithm::RsaSsaPkcs1V15Sha256, key) .expect("failed to validate payload") .to_string(), expected_payload ); } let key: CoreJsonWebKey = serde_json::from_str(TEST_RSA_PUB_KEY).expect("deserialization failed"); let jwt: JsonWebToken< CoreJweContentEncryptionAlgorithm, CoreJwsSigningAlgorithm, CoreJsonWebKeyType, String, JsonWebTokenStringPayloadSerde, > = serde_json::from_value(serde_json::Value::String(TEST_JWT.to_string())) .expect("failed to deserialize"); assert_eq!( serde_json::to_value(&jwt).expect("failed to serialize"), serde_json::Value::String(TEST_JWT.to_string()) ); verify_jwt(&jwt, &key, TEST_JWT_PAYLOAD); assert_eq!((&jwt).unverified_payload(), TEST_JWT_PAYLOAD); verify_jwt(jwt, &key, TEST_JWT_PAYLOAD); }
rust_cleaned_test_functions.jsonl/66760
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1326 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 95576, 34729, 368, 341, 286, 5168, 10146, 95576, 30192, 2235, 41592, 12759, 25, 362, 11, 1376, 25, 609, 5386, 5014, 5981, 1592, 11, 3601, 32813, 25, 609, 495, 340, 286, 1380, 198, 310, 362, 25, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_find_str() { // byte positions assert_eq!("".find_str(""), Some(0u)); assert!("banana".find_str("apple pie").is_none()); let data = "abcabc"; assert_eq!(data.slice(0u, 6u).find_str("ab"), Some(0u)); assert_eq!(data.slice(2u, 6u).find_str("ab"), Some(3u - 2u)); assert!(data.slice(2u, 4u).find_str("ab").is_none()); let string = "ประเทศไทย中华Việt Nam"; let mut data = String::from_str(string); data.push_str(string); assert!(data.find_str("ไท华").is_none()); assert_eq!(data.slice(0u, 43u).find_str(""), Some(0u)); assert_eq!(data.slice(6u, 43u).find_str(""), Some(6u - 6u)); assert_eq!(data.slice(0u, 43u).find_str("ประ"), Some( 0u)); assert_eq!(data.slice(0u, 43u).find_str("ทศไ"), Some(12u)); assert_eq!(data.slice(0u, 43u).find_str("ย中"), Some(24u)); assert_eq!(data.slice(0u, 43u).find_str("iệt"), Some(34u)); assert_eq!(data.slice(0u, 43u).find_str("Nam"), Some(40u)); assert_eq!(data.slice(43u, 86u).find_str("ประ"), Some(43u - 43u)); assert_eq!(data.slice(43u, 86u).find_str("ทศไ"), Some(55u - 43u)); assert_eq!(data.slice(43u, 86u).find_str("ย中"), Some(67u - 43u)); assert_eq!(data.slice(43u, 86u).find_str("iệt"), Some(77u - 43u)); assert_eq!(data.slice(43u, 86u).find_str("Nam"), Some(83u - 43u)); }
rust_cleaned_test_functions.jsonl/2423
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 763 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21814, 2895, 368, 341, 286, 442, 4922, 9892, 198, 286, 2060, 10714, 17223, 3263, 3903, 2895, 86076, 4329, 7, 15, 84, 1106, 286, 2060, 17223, 87747, 3263, 3903, 2895, 445, 22377, 4349, 1827, 285, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_missing_root() { let db = MockTreeStore::<ValueBlob>::default(); let tree = JellyfishMerkleTree::new(&db); let err = tree .get_with_proof(HashValue::random(), 0) .err() .unwrap() .downcast::<MissingRootError>() .unwrap(); assert_eq!(err.version, 0); }
rust_cleaned_test_functions.jsonl/9457
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 156 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 40447, 12993, 368, 341, 262, 1077, 2927, 284, 14563, 6533, 6093, 27638, 1130, 37985, 6831, 2258, 543, 262, 1077, 4916, 284, 73139, 18170, 44, 16754, 273, 6533, 486, 931, 2099, 1999, 317, 262, 1077...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_pull_request_other() { let mut test = new_test(); test.handler.event = "pull_request".into(); test.handler.action = "some-other-action".into(); test.handler.data.pull_request = some_pr(); test.handler.data.sender = User::new("the-pr-closer"); // should not do anything! let resp = test.handler.handle_event().unwrap(); assert_eq!((StatusCode::OK, "pr".into()), resp); }
rust_cleaned_test_functions.jsonl/89645
{ "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, 65693, 7893, 30456, 368, 341, 262, 1077, 5206, 1273, 284, 501, 4452, 543, 262, 1273, 31171, 5773, 284, 330, 23441, 7893, 3263, 18122, 543, 262, 1273, 31171, 12395, 284, 330, 14689, 72472, 25059, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_time_conversion() { let time = Time::<TimePrefixUpper>::from_str("70 min").unwrap(); assert_eq!(std::time::Duration::from_secs(70 * 60), time.into()); let time = Time::new(1_000_000_123, TimePrefix::Nano); assert_eq!(std::time::Duration::new(1, 123), time.into()); }
rust_cleaned_test_functions.jsonl/38356
{ "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, 3009, 64132, 368, 341, 286, 1077, 882, 284, 4120, 27638, 1462, 14335, 14251, 6831, 1499, 2895, 445, 22, 15, 1308, 1827, 15454, 543, 286, 2060, 10714, 10297, 1834, 486, 1678, 486, 12945, 486, 1499,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_burn_many() { let mut contract = TestContract::new(); let ali_pk = PublicKey::ed25519_from_bytes([3u8; 32]).unwrap(); let ali: Key = ali_pk.to_account_hash().into(); let tokens_to_burn = vec!["a".to_string(), "b".to_string()]; let tokens_to_remain = vec!["c".to_string(), "d".to_string(), "e".to_string()]; let token_ids: Vec<String> = tokens_to_burn .iter() .cloned() .chain(tokens_to_remain.iter().cloned()) .collect(); contract .mint_copies(&ali, Some(token_ids), meta::banana(), 5) .unwrap(); contract.burn_many(&ali, tokens_to_burn.clone()).unwrap(); // Check balances assert_eq!(contract.total_supply(), U256::from(3)); assert_eq!(contract.balance_of(&ali), U256::from(3)); // Check burned tokens for token_id in &tokens_to_burn { assert!(contract.owner_of(token_id).is_none()); assert!(contract.token_meta(token_id).is_none()); } // Check rest of tokens. for token_id in &tokens_to_remain { assert_eq!(&contract.owner_of(token_id).unwrap(), &ali); assert_eq!(&contract.token_meta(token_id).unwrap(), &meta::banana()); } }
rust_cleaned_test_functions.jsonl/122725
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 528 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 399, 22101, 368, 341, 262, 1077, 5206, 5116, 284, 3393, 14067, 486, 931, 543, 262, 1077, 18991, 33321, 284, 70280, 486, 291, 17, 20, 20, 16, 24, 5673, 12524, 2561, 18, 84, 23, 26, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_exec_special_positive_address_advance() { let header = make_test_header(EndianSlice::new(&[], LittleEndian)); let initial_registers = LineRow::new(&header); let opcode = LineInstruction::Special(52); let mut expected_registers = initial_registers; expected_registers.address.0 += 3; assert_exec_opcode(header, initial_registers, opcode, expected_registers, true); }
rust_cleaned_test_functions.jsonl/3361
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 173 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18430, 41629, 54160, 6744, 98093, 368, 341, 286, 1077, 4247, 284, 1281, 4452, 8757, 7, 43231, 33236, 486, 931, 2099, 12995, 14671, 43231, 3237, 286, 1077, 2856, 78360, 284, 7083, 3102, 486, 931, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_parse_actions_req() { // PUT InstanceStart let json = "{ \"action_type\": \"InstanceStart\" }"; let body: Chunk = Chunk::from(json); let path = "/foo"; match parse_actions_req(path, Method::Put, &body) { Ok(pr) => { let (sender, receiver) = oneshot::channel(); assert!(pr.eq(&ParsedRequest::Sync( VmmAction::StartMicroVm(sender), receiver ))); } _ => assert!(false), } // PUT BlockDeviceRescan let json = r#"{ "action_type": "BlockDeviceRescan", "payload": "dummy_id" }"#; let body: Chunk = Chunk::from(json); let path = "/foo"; match parse_actions_req(path, Method::Put, &body) { Ok(pr) => { let (sender, receiver) = oneshot::channel(); assert!(pr.eq(&ParsedRequest::Sync( VmmAction::RescanBlockDevice("dummy_id".to_string(), sender), receiver ))); } _ => assert!(false), } // Error cases // Test PUT with invalid path. let path = "/foo/bar/baz"; let expected_err = Error::InvalidPathMethod(path, Method::Put); assert!(parse_actions_req(path, Method::Put, &Chunk::from("foo")) == Err(expected_err)); let actions_path = "/actions"; assert!( parse_actions_req(actions_path, Method::Put, &Chunk::from("foo")) == Err(Error::SerdeJson(get_dummy_serde_error())) ); // Test PUT BadRequest due to invalid payload. let expected_err = Error::Generic( StatusCode::BadRequest, "InstanceStart does not support a payload.".to_string(), ); let body = r#"{ "action_type": "InstanceStart", "payload": { "foo": "bar" } }"#; assert!( parse_actions_req(actions_path, Method::Put, &Chunk::from(body)) == Err(expected_err) ); // Test invalid method. let expected_err = Error::InvalidPathMethod(actions_path, Method::Post); assert!( parse_actions_req( actions_path, Method::Post, &Chunk::from("{\"action_type\": \"InstanceStart\"}") ) == Err(expected_err) ); }
rust_cleaned_test_functions.jsonl/14369
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1350 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 25368, 17644, 368, 341, 286, 442, 34380, 19283, 3479, 198, 286, 1077, 2951, 284, 330, 515, 394, 7245, 1311, 1819, 11693, 7245, 2523, 3479, 59, 698, 1060, 335, 876, 286, 1077, 2487, 25, 45...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_prevote_migration_with_free_stuck_pre_candidate() { let l = default_logger(); let mut nt = new_prevote_migration_cluster(&l); // n1 is leader with term 2 // n2 is follower with term 2 nt.send(vec![new_message(3, 3, MessageType::MsgHup, 0)]); assert_eq!(nt.peers[&1].state, StateRole::Leader); assert_eq!(nt.peers[&2].state, StateRole::Follower); assert_eq!(nt.peers[&3].state, StateRole::PreCandidate); // Pre-Vote again for safety nt.send(vec![new_message(3, 3, MessageType::MsgHup, 0)]); assert_eq!(nt.peers[&1].state, StateRole::Leader); assert_eq!(nt.peers[&2].state, StateRole::Follower); assert_eq!(nt.peers[&3].state, StateRole::PreCandidate); let mut to_send = new_message(1, 3, MessageType::MsgHeartbeat, 0); to_send.term = nt.peers[&1].term; nt.send(vec![to_send]); // Disrupt the leader so that the stuck peer is freed assert_eq!(nt.peers[&1].state, StateRole::Follower); assert_eq!(nt.peers[&3].term, nt.peers[&1].term); }
rust_cleaned_test_functions.jsonl/19185
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 454 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 25566, 1272, 90373, 6615, 8905, 1261, 1942, 10442, 62360, 368, 341, 262, 1077, 326, 284, 1638, 27413, 543, 262, 1077, 5206, 31412, 284, 501, 25566, 1272, 90373, 28441, 2099, 75, 626, 262, 442, 308...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_v6_offset() { let pa = TempDir::new().unwrap(); let pa_aa = TempFile::new_in(pa.as_path()).unwrap(); let mut node = Node::new( RafsVersion::V6, pa.as_path().to_path_buf(), pa_aa.as_path().to_path_buf(), Overlay::UpperAddition, RAFS_DEFAULT_CHUNK_SIZE as u32, false, ) .unwrap(); let bootstrap_path = TempFile::new().unwrap(); let storage = ArtifactStorage::SingleFile(bootstrap_path.as_path().to_path_buf()); let mut bootstrap_ctx = BootstrapContext::new(storage, false).unwrap(); bootstrap_ctx.offset = 1; // reg file. // it's always aligned to 32 bytes. node.set_v6_offset(&mut bootstrap_ctx); assert_eq!(node.offset, 1); assert_eq!(node.v6_datalayout, EROFS_INODE_CHUNK_BASED); assert_eq!(node.v6_compact_inode, true); assert_eq!(bootstrap_ctx.offset, 40); // symlink and dir are handled in the same way. let mut dir_node = Node::new( RafsVersion::V6, pa.as_path().to_path_buf(), pa.as_path().to_path_buf(), Overlay::UpperAddition, RAFS_DEFAULT_CHUNK_SIZE as u32, false, ) .unwrap(); // 1. tail = 0 bootstrap_ctx.offset = 4096 - 32 - 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192); bootstrap_ctx.offset = 4096 - 32 + 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); bootstrap_ctx.offset = 4096 - 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192); // 2. tail = 32 // avail = 32 bootstrap_ctx.offset = 4096 - 32 - 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 32) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_INLINE); assert_eq!(bootstrap_ctx.offset, 8192); // avail = 33 bootstrap_ctx.offset = 4096 - 32 - 33; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 32) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_INLINE); assert_eq!(bootstrap_ctx.offset, 8192); // avail = 31 bootstrap_ctx.offset = 4096 - 32 - 31; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 32) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); // avail = 4096 bootstrap_ctx.offset = 4096 - 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 32) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); // 3. tail = 4095 // avail = 32 bootstrap_ctx.offset = 4096 - 32 - 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 4095) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); // avail = 33 bootstrap_ctx.offset = 4096 - 32 - 33; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 4095) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); // avail = 31 bootstrap_ctx.offset = 4096 - 32 - 31; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 4095) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); // avail = 4096 bootstrap_ctx.offset = 4096 - 32; dir_node .dir_set_v6_offset(&mut bootstrap_ctx, 4096 + 4095) .unwrap(); assert_eq!(dir_node.v6_datalayout, EROFS_INODE_FLAT_PLAIN); assert_eq!(bootstrap_ctx.offset, 8192 + 4096); }
rust_cleaned_test_functions.jsonl/98420
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2391 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2602, 2273, 21, 6917, 368, 341, 286, 1077, 7106, 284, 19944, 6184, 486, 931, 1005, 15454, 543, 286, 1077, 7106, 89808, 284, 19944, 1703, 486, 931, 1243, 78637, 5357, 2638, 6011, 15454, 543, 286, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_echo() { let mut register = GearRegister::init(); let command = GearCommand::new(String::from("echo")); let gear = register .builder(command.into()) .name(String::from("Echo")) .input(IOInformation::new( String::from("text"), TypedValue::String(Default::default()).ty(), )) .output(IOInformation::new( String::from("exit code"), TypedValue::String(Default::default()).ty(), )) .output(IOInformation::new( String::from("stdout"), TypedValue::String(Default::default()).ty(), )) .output(IOInformation::new( String::from("stderr"), TypedValue::String(Default::default()).ty(), )) .instantiate(); assert_eq!( register .evaluate(gear, vec![TypedValue::String(String::from("Hello world!"))]) .unwrap()[1], TypedValue::String(String::from("Hello world!\n")) ); }
rust_cleaned_test_functions.jsonl/98619
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 597 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 68628, 368, 341, 286, 1077, 5206, 4161, 284, 27503, 8690, 486, 2327, 543, 286, 1077, 3210, 284, 27503, 4062, 486, 931, 2242, 486, 1499, 445, 3047, 14929, 286, 1077, 14448, 284, 4161, 198, 310, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_reset() { let mut ppo = Ppo::new(3, 6, 4).unwrap(); assert_eq!(round(ppo.next(2.0).into()), (0.0, 0.0, 0.0)); assert_eq!(round(ppo.next(3.0).into()), (9.38, 3.75, 5.63)); ppo.reset(); assert_eq!(round(ppo.next(2.0).into()), (0.0, 0.0, 0.0)); assert_eq!(round(ppo.next(3.0).into()), (9.38, 3.75, 5.63)); }
rust_cleaned_test_functions.jsonl/131870
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 218 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18983, 368, 341, 286, 1077, 5206, 281, 5368, 284, 393, 5368, 486, 931, 7, 18, 11, 220, 21, 11, 220, 19, 568, 15454, 1428, 286, 2060, 10714, 10297, 1049, 7, 39480, 4529, 7, 17, 13, 15, 568, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_repeat_with_take() { let mut it = repeat_with(|| 42).take(3); assert_eq!(it.next(), Some(42)); assert_eq!(it.next(), Some(42)); assert_eq!(it.next(), Some(42)); assert_eq!(it.next(), None); is_trusted_len(repeat_with(|| 42).take(3)); assert_eq!(repeat_with(|| 42).take(3).size_hint(), (3, Some(3))); assert_eq!(repeat_with(|| 42).take(0).size_hint(), (0, Some(0))); assert_eq!(repeat_with(|| 42).take(usize::MAX).size_hint(), (usize::MAX, Some(usize::MAX))); }
rust_cleaned_test_functions.jsonl/54170
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 253 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 41975, 6615, 73261, 368, 341, 262, 1077, 5206, 432, 284, 13153, 6615, 79453, 220, 19, 17, 568, 22769, 7, 18, 317, 262, 2060, 10714, 10297, 275, 4529, 1507, 4329, 7, 19, 17, 1106, 262, 2060, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
#[test] fn test_to_value_structured() { assert_eq!(42u64.to_value().to_token(), Token::U64(42)); assert_eq!(42i64.to_value().to_token(), Token::I64(42)); assert_eq!(42.01f64.to_value().to_token(), Token::F64(42.01)); assert_eq!(true.to_value().to_token(), Token::Bool(true)); assert_eq!('a'.to_value().to_token(), Token::Char('a')); assert_eq!( format_args!("a {}", "value").to_value().to_token(), Token::Str("a value".into()) ); assert_eq!( "a loong string".to_value().to_token(), Token::Str("a loong string".into()) ); assert_eq!(Some(true).to_value().to_token(), Token::Bool(true)); assert_eq!(().to_value().to_token(), Token::None); assert_eq!(Option::None::<bool>.to_value().to_token(), Token::None); }
rust_cleaned_test_functions.jsonl/67713
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 422 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2346, 3142, 15126, 3073, 368, 341, 286, 2060, 10714, 10297, 19, 17, 84, 21, 19, 2389, 3142, 1005, 983, 6458, 1507, 9660, 486, 52, 21, 19, 7, 19, 17, 1106, 286, 2060, 10714, 10297, 19, 17, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_poly_multiply() { // x + 1 let left = UnivarPolynomial(FieldElementVector::from(vec![ FieldElement::one(), FieldElement::one(), ])); // -1 + x let right = UnivarPolynomial(FieldElementVector::from(vec![ FieldElement::minus_one(), FieldElement::one(), ])); let product = UnivarPolynomial::multiply(&left, &right); // product = -1 + x^2 assert_eq!(product.degree(), 2); assert_eq!(product[0], FieldElement::minus_one()); assert_eq!(product[1], FieldElement::zero()); assert_eq!(product[2], FieldElement::one()); // Test overloaded operator assert_eq!(product, &left * &right); // 1 + x let left = UnivarPolynomial(FieldElementVector::from(vec![ FieldElement::one(), FieldElement::one(), ])); // 1 + 2x let right = UnivarPolynomial(FieldElementVector::from(vec![ FieldElement::one(), FieldElement::from(2u64), ])); let product = UnivarPolynomial::multiply(&left, &right); // product = 2x^2 + 3x + 1 assert_eq!(product.degree(), 2); assert_eq!(product[0], FieldElement::one()); assert_eq!(product[1], FieldElement::from(3u64)); assert_eq!(product[2], FieldElement::from(2u64)); // Test overloaded operator assert_eq!(product, &left * &right); // 1 + x^2 let left = UnivarPolynomial(FieldElementVector::from(vec![ FieldElement::one(), FieldElement::zero(), FieldElement::one(), ])); // 4 + x^3 let right = UnivarPolynomial(FieldElementVector::from(vec![ FieldElement::from(4u64), FieldElement::zero(), FieldElement::zero(), FieldElement::one(), ])); let product = UnivarPolynomial::multiply(&left, &right); // 4 + 4x^2 + x^3 + x^5 assert_eq!(product.degree(), 5); assert_eq!(product[0], FieldElement::from(4u64)); assert_eq!(product[1], FieldElement::zero()); assert_eq!(product[2], FieldElement::from(4u64)); assert_eq!(product[3], FieldElement::one()); assert_eq!(product[4], FieldElement::zero()); assert_eq!(product[5], FieldElement::one()); // Test overloaded operator assert_eq!(product, &left * &right); }
rust_cleaned_test_functions.jsonl/51312
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1188 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 36133, 93054, 368, 341, 1789, 286, 442, 856, 488, 220, 16, 198, 286, 1077, 2115, 284, 1230, 56398, 14658, 25358, 57788, 1691, 3781, 486, 1499, 25592, 90515, 310, 8601, 1691, 486, 603, 3148, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_min_transaction_price_for_or_constraint_two_not_met() { let payment_service = PaymentsService::new(); let constraint = Constraint::OrConstraint( CombinationConstraint { auth_constraints: vec![ _single_trustee(), _single_owner() ] } ); let requester_info = RequesterInfo { role: Some("2".to_string()), sig_count: 1, is_owner: false, is_off_ledger_signature: false, }; let fees = _fees(); let res = payment_service.get_request_info_with_min_price(&constraint, &requester_info, &fees); assert!(res.is_err()); }
rust_cleaned_test_functions.jsonl/38437
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 429 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 7260, 28884, 9040, 5478, 8734, 46973, 23241, 7913, 44517, 368, 341, 286, 1077, 8160, 12267, 284, 57876, 1860, 486, 931, 1428, 286, 1077, 21568, 284, 44264, 486, 2195, 17890, 1006, 310, 85856, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_mpidr() { let hv = hypervisor::new().unwrap(); let vm = hv.create_vm().unwrap(); let vcpu = vm.create_vcpu(0).unwrap(); let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default(); vm.get_preferred_target(&mut kvi).unwrap(); // Must fail when vcpu is not initialized yet. assert!(read_mpidr(&vcpu).is_err()); vcpu.vcpu_init(&kvi).unwrap(); assert_eq!(read_mpidr(&vcpu).unwrap(), 0x80000000); }
rust_cleaned_test_functions.jsonl/21465
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 253 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 717, 10412, 81, 368, 341, 286, 1077, 22747, 284, 9751, 31396, 486, 931, 1005, 15454, 543, 286, 1077, 10995, 284, 22747, 2520, 39008, 1005, 15454, 543, 286, 1077, 348, 16475, 284, 10995, 2520...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_triangle_mesh() { let cube_vertices = [ TriangleVertex::new( point3(0.0, 0.0, 0.0), point2(0.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(2.0, 0.0, 0.0), point2(1.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(0.0, 2.0, 0.0), point2(0.0, 1.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(2.0, 2.0, 0.0), point2(1.0, 1.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(0.0, 0.0, 2.0), point2(0.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(2.0, 0.0, 2.0), point2(1.0, 0.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(0.0, 2.0, 2.0), point2(0.0, 1.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), TriangleVertex::new( point3(2.0, 2.0, 2.0), point2(1.0, 1.0), vec3(0.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0), ), ]; // An empty triangle mesh is fine - it just has no triangles in it TriangleMesh::new([], cube_vertices.iter().cloned()).expect("Valid empty mesh"); // The triangle index needs to be a multiple of 3 assert!(TriangleMesh::new([1], cube_vertices.iter().cloned()).is_err()); // Out of range triangles are out of range assert!(TriangleMesh::new([0, 1, 9], cube_vertices.iter().cloned()).is_err()); // One valid triangle is good let one_tri = TriangleMesh::new([0, 1, 2], cube_vertices.iter().cloned()) .expect("Valid single triangle"); let bounding = one_tri.bounding_box(); assert_eq!(bounding.min_point(), point3(-0.0001, -0.0001, -0.0001)); assert_eq!( bounding.max_point(), point3(2.0 + 0.0001, 2.0 + 0.0001, 0.0001) ); let intersection = one_tri .intersect( &Ray::new(Point3::new(0.5, 0.5, -10.0), vec3(0.0, 0.0, 1.0), 0.0), 0.0, constants::INFINITY, ) .expect("Missing intersection"); assert_eq!(intersection.hit_point(), point3(0.5, 0.5, 0.0)); assert_eq!(intersection.surface_normal(), vec3(0.0, 0.0, -1.0)); assert_eq!(intersection.tangent(), vec3(0.0, 1.0, 0.0)); assert_eq!(intersection.bitangent(), vec3(-1.0, 0.0, 0.0)); let intersection = one_tri.intersect( &Ray::new(Point3::new(1.5, 1.5, -10.0), vec3(0.0, 0.0, 1.0), 0.0), 0.0, constants::INFINITY, ); assert!( intersection.is_none(), "Unexpected intersection {:?}", intersection ); // One valid triangle is good let one_tri = TriangleMesh::new([0, 2, 3], cube_vertices.iter().cloned()) .expect("Valid single triangle"); let bounding = one_tri.bounding_box(); assert_eq!(bounding.min_point(), point3(-0.0001, -0.0001, -0.0001)); assert_eq!( bounding.max_point(), point3(2.0 + 0.0001, 2.0 + 0.0001, 0.0001) ); let intersection = one_tri .intersect( &Ray::new(Point3::new(0.5, 0.5, -10.0), vec3(0.0, 0.0, 1.0), 0.0), 0.0, constants::INFINITY, ) .expect("Missing intersection"); assert_eq!(intersection.hit_point(), point3(0.5, 0.5, 0.0)); assert_eq!(intersection.surface_normal(), vec3(0.0, 0.0, -1.0)); assert_eq!(intersection.tangent(), vec3(0.0, 1.0, 0.0)); assert_eq!(intersection.bitangent(), vec3(-1.0, 0.0, 0.0)); let intersection = one_tri.intersect( &Ray::new(Point3::new(1.5, 0.5, -10.0), vec3(0.0, 0.0, 1.0), 0.0), 0.0, constants::INFINITY, ); assert!( intersection.is_none(), "Unexpected intersection {:?}", intersection ); }
rust_cleaned_test_functions.jsonl/73942
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2803 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 70575, 29453, 368, 341, 286, 1077, 23739, 37720, 284, 2278, 310, 38031, 8320, 486, 931, 1006, 394, 1459, 18, 7, 15, 13, 15, 11, 220, 15, 13, 15, 11, 220, 15, 13, 15, 1326, 394, 1459, 17, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_parse_user_host_port() { let addr = "test-user@127.0.0.1:2222"; let parsed_addr = parse_user_host_port(addr).unwrap(); assert!(parsed_addr.proto.is_none()); assert_eq!("test-user", parsed_addr.user.unwrap()); assert_eq!("127.0.0.1", parsed_addr.host.unwrap()); assert_eq!("2222", parsed_addr.port.unwrap()); }
rust_cleaned_test_functions.jsonl/56553
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 159 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 3317, 12848, 8716, 368, 341, 262, 1077, 10789, 284, 330, 1944, 8694, 31, 16, 17, 22, 13, 15, 13, 15, 13, 16, 25, 17, 17, 17, 17, 876, 262, 1077, 15676, 7387, 284, 4715, 3317, 12848, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_me() -> StdResult<()> { let x = vec![ 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 96u8, 180u8, 94u8, 195u8, 0u8, 0u8, 0u8, 1u8, 0u8, 3u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 38u8, 229u8, 4u8, 215u8, 149u8, 163u8, 42u8, 54u8, 156u8, 236u8, 173u8, 168u8, 72u8, 220u8, 100u8, 90u8, 154u8, 159u8, 160u8, 215u8, 0u8, 91u8, 48u8, 44u8, 48u8, 44u8, 51u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 53u8, 55u8, 44u8, 52u8, 54u8, 44u8, 50u8, 53u8, 53u8, 44u8, 53u8, 48u8, 44u8, 50u8, 52u8, 51u8, 44u8, 49u8, 48u8, 54u8, 44u8, 49u8, 50u8, 50u8, 44u8, 49u8, 49u8, 48u8, 44u8, 49u8, 50u8, 53u8, 44u8, 56u8, 56u8, 44u8, 55u8, 51u8, 44u8, 49u8, 56u8, 57u8, 44u8, 50u8, 48u8, 55u8, 44u8, 49u8, 48u8, 52u8, 44u8, 56u8, 51u8, 44u8, 49u8, 49u8, 57u8, 44u8, 49u8, 50u8, 55u8, 44u8, 49u8, 57u8, 50u8, 44u8, 49u8, 52u8, 55u8, 44u8, 56u8, 57u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 51u8, 44u8, 50u8, 51u8, 50u8, 44u8, 48u8, 44u8, 51u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 48u8, 44u8, 53u8, 51u8, 44u8, 49u8, 49u8, 54u8, 44u8, 52u8, 56u8, 44u8, 49u8, 49u8, 54u8, 44u8, 49u8, 52u8, 57u8, 44u8, 49u8, 48u8, 56u8, 44u8, 49u8, 49u8, 51u8, 44u8, 56u8, 44u8, 48u8, 44u8, 50u8, 51u8, 50u8, 44u8, 52u8, 57u8, 44u8, 49u8, 53u8, 50u8, 44u8, 49u8, 44u8, 50u8, 56u8, 44u8, 50u8, 48u8, 51u8, 44u8, 50u8, 49u8, 50u8, 44u8, 50u8, 50u8, 49u8, 44u8, 50u8, 52u8, 49u8, 44u8, 56u8, 53u8, 44u8, 49u8, 48u8, 57u8, 93u8, ]; let b = Binary::from(x.clone()); let y = b.as_slice().to_vec(); assert_eq!(x, y); Ok(()) }
rust_cleaned_test_functions.jsonl/106996
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1676 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16612, 368, 1464, 42517, 2077, 71698, 341, 286, 1077, 856, 284, 7486, 90515, 310, 220, 16, 84, 23, 11, 220, 15, 84, 23, 11, 220, 15, 84, 23, 11, 220, 15, 84, 23, 11, 220, 15, 84, 23, 11,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_burn_from() { new_test_ext().execute_with(|| { GovernanceRegistry::set(Origin::root(), ASSET_ID, FROM_ACCOUNT).unwrap(); assert_eq!(Pallet::<Test>::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); assert_eq!(Pallet::<Test>::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); Pallet::<Test>::burn_from( Origin::signed(FROM_ACCOUNT), ASSET_ID, TO_ACCOUNT, TRANSFER_AMOUNT, ) .expect("burn_from should work"); assert_eq!(Pallet::<Test>::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); assert_eq!( Pallet::<Test>::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT - TRANSFER_AMOUNT ); }); }
rust_cleaned_test_functions.jsonl/9175
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 302 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 399, 5673, 368, 341, 8638, 4452, 9927, 1005, 10257, 6615, 79453, 341, 197, 9600, 6706, 681, 15603, 486, 746, 7, 13298, 486, 2888, 1507, 5752, 5884, 3450, 11, 4295, 38831, 568, 15454, 543, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_fuzzing_bugs() { assert!("99999;".parse::<QualityItem<String>>().is_err()); assert!("\x0d;;;=\u{d6aa}==".parse::<QualityItem<String>>().is_err()) }
rust_cleaned_test_functions.jsonl/65740
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 94 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 761, 8889, 287, 880, 13299, 368, 341, 286, 2060, 17223, 24, 24, 24, 24, 24, 26, 3263, 6400, 27638, 33074, 1234, 3464, 2452, 1005, 285, 9266, 1423, 286, 2060, 0, 4921, 87, 15, 67, 36328, 34433,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_single_character_line_is_not_whitespace_error() { let plus_style = "bold yellow red ul"; let config = integration_test_utils::make_config_from_args(&[ "--light", "--keep-plus-minus-markers", "--plus-style", plus_style, ]); let output = integration_test_utils::run_delta(DIFF_WITH_SINGLE_CHARACTER_LINE, &config); ansi_test_utils::assert_line_has_style(&output, 14, "+}", plus_style, &config) }
rust_cleaned_test_functions.jsonl/70109
{ "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, 19487, 40988, 6528, 6892, 7913, 86175, 4096, 368, 341, 286, 1077, 5519, 15117, 284, 330, 14824, 13753, 2518, 8557, 876, 286, 1077, 2193, 284, 17590, 4452, 17309, 486, 6927, 5332, 5673, 8384, 2099, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_write_read_gtk_with_padding() { // Write KDE: let mut w = Writer::new(vec![]); w.write_gtk(&Gtk::new(2, GtkInfoTx::BothRxTx, &vec![24; 5])) .expect("failure writing GTK KDE"); let buf = w.finalize_for_encryption().expect("failure finializing key data"); #[rustfmt::skip] assert_eq!(buf, vec![ // GTK KDE: TYPE, 11, 0x00, 0x0F, 0xAC, GTK_DATA_TYPE, 0b0000_0110, 0, 24, 24, 24, 24, 24, // Padding: TYPE, 0, 0, ]); // Read KDE: let result = extract_elements(&buf[..]); assert!(result.is_ok(), "Error: {:?}", result); let mut elements = result.unwrap(); assert_eq!(elements.len(), 2); assert_variant!(elements.remove(0), Element::Gtk(hdr, kde) => { assert_eq!(hdr, Header { type_: 0xDD, len: 11, oui: Oui::DOT11, data_type: 1 }); assert_eq!(kde, Gtk { info: GtkInfo(6), gtk: vec![24; 5] }); }); assert_variant!(elements.remove(0), Element::Padding); }
rust_cleaned_test_functions.jsonl/52432
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 564 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9165, 6443, 1889, 6242, 6615, 40726, 368, 341, 286, 442, 9645, 75083, 510, 286, 1077, 5206, 289, 284, 29404, 486, 931, 25592, 0, 56703, 286, 289, 3836, 1889, 6242, 2099, 45103, 486, 931, 7, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1