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_is_mate_with_partial_state_repeat_move_kinds_no_mate_with_kaku_occupied_self_sente() { let kinds:Vec<KomaKind> = vec![ SKaku, SKakuN ]; let positions:Vec<(u32,u32)> = vec![ (0,4),(4,0),(4,8),(8,4) ]; let mvs:Vec<(u32,u32)> = vec![ (2,2),(6,2),(6,6),(2,6) ]; let occ_positions:Vec<(u32,u32)> = vec![ (3,3),(5,3),(5,5),(3,5) ]; let blank_banmen = Banmen([[Blank; 9]; 9]); for k in &kinds { for ((p,m),op) in positions.iter().zip(&mvs).zip(&occ_positions) { let mut banmen = blank_banmen.clone(); banmen.0[3][4] = GOu; banmen.0[p.1 as usize][p.0 as usize] = *k; banmen.0[op.1 as usize][op.0 as usize] = SFu; let mut state = State::new(banmen); let mut mc = MochigomaCollections::Empty; let mv = Move::To(KomaSrcPosition(9-4,3+1),KomaDstToPosition(9-4,4+1,false)); match Rule::apply_move_none_check(&state,Teban::Sente,&mc,mv.to_applied_move()) { (next,nmc,_) => { state = next; mc = nmc; } } let mv = Move::To(KomaSrcPosition(9-p.0,p.1+1),KomaDstToPosition(9-m.0,m.1+1,false)); let ps = Rule::apply_move_to_partial_state_none_check(&state,Teban::Sente,&mc,mv.to_applied_move()); assert!(!Rule::is_mate_with_partial_state_repeat_move_kinds(Teban::Sente,&ps), "assertion failed, move = {:?}, {:?}",mv,state.get_banmen()); } } }
rust_cleaned_test_functions.jsonl/72976
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 753 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6892, 717, 349, 6615, 52068, 4387, 41975, 17134, 4698, 8673, 6536, 717, 349, 6615, 4698, 23557, 62, 40356, 25637, 643, 6817, 368, 972, 10217, 12829, 25, 10050, 28239, 7786, 10629, 29, 284, 7486, 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...
4
#[test] fn test_label() { match label().easy_parse(".hello") { Ok((lab, _)) => assert_eq!(lab, String::from("hello")), Err(_) => assert!(false), } match label().easy_parse("._1_la2_52d_4s21j5v2ns_2n3sh_3917d_ncj224b") { Ok((lab, _)) => assert_eq!( lab, String::from("_1_la2_52d_4s21j5v2ns_2n3sh_3917d_ncj224b") ), Err(_) => assert!(false), } match label().easy_parse(".a") { Ok((lab, _)) => assert_eq!(lab, String::from("a")), Err(_) => assert!(false), } match label().easy_parse("._") { Ok((lab, _)) => assert_eq!(lab, String::from("_")), Err(_) => assert!(false), } match label().easy_parse(".9") { Ok(_) => assert!(false), Err(_) => {} } match label().easy_parse(".this_is_a_very_long_label21343_dhe3423b") { Ok((lab, _)) => { assert_eq!(lab, String::from("this_is_a_very_long_label21343_dhe3423b")) } Err(_) => assert!(false), } match label().easy_parse("this isnt a label") { Ok(_) => assert!(false), Err(_) => {} } match label().easy_parse(". hello no label here!") { Ok(_) => assert!(false), Err(_) => {} } }
rust_cleaned_test_functions.jsonl/103366
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 806 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6106, 368, 341, 286, 2432, 2383, 1005, 45022, 21039, 5680, 14990, 899, 341, 310, 7622, 1188, 14380, 11, 716, 593, 589, 2060, 10714, 10297, 14380, 11, 923, 486, 1499, 445, 14990, 30154, 310, 15495,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_destroy_userdata() -> Result<()> { struct MyUserdata(Arc<()>); impl UserData for MyUserdata {} let rc = Arc::new(()); let lua = Lua::new(); lua.globals().set("userdata", MyUserdata(rc.clone()))?; assert_eq!(Arc::strong_count(&rc), 2); // should destroy all objects let _ = lua.globals().raw_remove("userdata")?; lua.gc_collect()?; assert_eq!(Arc::strong_count(&rc), 1); Ok(()) }
rust_cleaned_test_functions.jsonl/40496
{ "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, 18066, 59315, 368, 1464, 5714, 71698, 341, 262, 2036, 3017, 1474, 691, 4346, 1287, 71698, 626, 262, 11605, 71294, 369, 3017, 1474, 691, 10086, 262, 1077, 10192, 284, 19689, 486, 931, 5065, 626, 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...
5
#[test] fn test_from_string() { assert_eq!(LsColors::default(), LsColors::from_string(&String::new())); let result = LsColors::from_string( &String::from("rs=0:di=03;34:ln=01;36:*.foo=01;35:*README=33")); assert_eq!(Colour::Blue.italic(), result.directory); assert_eq!(Colour::Cyan.bold(), result.symlink); assert_eq!(Some(&Colour::Purple.bold()), result.extensions.get("foo")); assert_eq!(Some(&Colour::Yellow.normal()), result.filenames.get("README")); }
rust_cleaned_test_functions.jsonl/90577
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 215 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 3904, 368, 341, 262, 2060, 10714, 10297, 43, 82, 13108, 486, 2258, 1507, 444, 82, 13108, 486, 1499, 3904, 2099, 703, 486, 931, 25138, 262, 1077, 1102, 284, 444, 82, 13108, 486, 1499, 3904,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_used_headers() { let input = r#" { "used_headers": [{ "name": "foo/bar.h" }], "current_target": "//foo:bar" } "#; let ir = deserialize_ir(input.as_bytes()).unwrap(); let expected = FlatIR { used_headers: vec![HeaderName { name: "foo/bar.h".to_string() }], current_target: "//foo:bar".into(), top_level_item_ids: vec![], items: vec![], }; assert_eq!(ir.flat_ir, expected); }
rust_cleaned_test_functions.jsonl/45461
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 294 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 27803, 26719, 368, 341, 286, 1077, 1946, 284, 435, 2, 698, 286, 341, 310, 330, 2591, 26719, 788, 18466, 330, 606, 788, 330, 7975, 49513, 860, 1, 29043, 310, 330, 3231, 11123, 788, 35574, 7975, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_struct() { let mut m = TestFmtJsonWellKnownTypes::new(); m.mut_struct_value().fields.insert("ab".to_owned(), { let mut v = Value::new(); v.set_number_value(3.0); v }); test_json_print_parse_message("{\"structValue\": {\"ab\": 3.0}}", &m); }
rust_cleaned_test_functions.jsonl/49810
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 142 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15126, 368, 341, 262, 1077, 5206, 296, 284, 3393, 93322, 5014, 11395, 48206, 4173, 486, 931, 543, 262, 296, 744, 332, 15126, 3142, 1005, 9007, 7030, 445, 370, 3263, 983, 51973, 1507, 341, 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...
1
#[test] fn test_assembly() { use functional::*; let a = black_box(arr![i32; 1, 3, 5, 7]); let b = black_box(arr![i32; 2, 4, 6, 8]); let c = (&a).zip(b, |l, r| l + r); let d = a.fold(0, |a, x| a + x); assert_eq!(c, arr![i32; 3, 7, 11, 15]); assert_eq!(d, 16); }
rust_cleaned_test_functions.jsonl/122381
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 192 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11898, 5642, 368, 341, 286, 990, 15629, 79304, 286, 1077, 264, 284, 3691, 10194, 10939, 20703, 72, 18, 17, 26, 220, 16, 11, 220, 18, 11, 220, 20, 11, 220, 22, 2558, 286, 1077, 293, 284, 3691...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_persist_checkpoint_builder_others() { let pckpt_orig = part_ckpt!("table_1", "partition_1", {1 => (10, 20), 2 => (5, 15), 3 => (15, 25)}); let mut builder = PersistCheckpointBuilder::new(pckpt_orig.clone()); builder.register_other_partition( &part_ckpt!("table_1", "partition_2", {2 => (2, 15), 3 => (20, 25), 4 => (13, 14)}), ); let (pckpt, dckpt) = builder.build(); assert_eq!(pckpt, pckpt_orig); assert_eq!(dckpt, db_ckpt!({1 => 10, 2 => 2, 3 => 15, 4 => 13})); }
rust_cleaned_test_functions.jsonl/6753
{ "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, 620, 4975, 55208, 28532, 14179, 2985, 368, 341, 286, 1077, 281, 68175, 35328, 4035, 310, 949, 62, 68175, 17223, 2005, 62, 16, 497, 330, 40998, 62, 16, 497, 314, 16, 589, 320, 16, 15, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_hash() { assert_ne!(hash(FloatOrd(0.0f64)), hash(FloatOrd(-0.0f64))); assert_ne!(hash(FloatOrd(0.0f32)), hash(FloatOrd(-0.0f32))); assert_eq!(hash(FloatOrd(-0.0f64)), hash(FloatOrd(-0.0f64))); assert_eq!(hash(FloatOrd(0.0f32)), hash(FloatOrd(0.0f32))); assert_ne!( hash(FloatOrd(::core::f64::NAN)), hash(FloatOrd(-::core::f64::NAN)) ); assert_ne!( hash(FloatOrd(::core::f32::NAN)), hash(FloatOrd(-::core::f32::NAN)) ); assert_eq!( hash(FloatOrd(::core::f64::NAN)), hash(FloatOrd(::core::f64::NAN)) ); assert_eq!( hash(FloatOrd(-::core::f32::NAN)), hash(FloatOrd(-::core::f32::NAN)) ); }
rust_cleaned_test_functions.jsonl/56699
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 462 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8950, 368, 341, 286, 2060, 13925, 10297, 8296, 57178, 24621, 7, 15, 13, 15, 69, 21, 19, 5731, 5175, 57178, 24621, 4080, 15, 13, 15, 69, 21, 19, 4945, 286, 2060, 13925, 10297, 8296, 57178, 2462...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_multiple_patterns() { let mut grok = Grok::empty(); grok.insert_definition("YEAR", r"(\d\d){1,2}"); grok.insert_definition("MONTH", r"\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b"); grok.insert_definition("DAY", r"(?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)"); let pattern = grok.compile("%{DAY} %{MONTH} %{YEAR}", false) .expect("Error while compiling!"); let matches = pattern .match_against("Monday March 2012") .expect("No matches found!"); assert_eq!("Monday", matches.get("DAY").unwrap()); assert_eq!("March", matches.get("MONTH").unwrap()); assert_eq!("2012", matches.get("YEAR").unwrap()); assert_eq!(None, matches.get("unknown")); }
rust_cleaned_test_functions.jsonl/117569
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 440 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 45233, 64923, 368, 341, 286, 1077, 5206, 10487, 74, 284, 17888, 74, 486, 3194, 543, 286, 10487, 74, 7030, 31698, 445, 87201, 497, 435, 1, 11520, 67, 34487, 6098, 16, 11, 17, 20305, 286, 10487, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_fetch_target_description_custom_empty() { block_on(test_fetch_target_description( "custom-empty".to_string(), TargetDescription::from_slice_with_custom( "target with empty custom metadata".as_bytes(), &[HashAlgorithm::Sha256], hashmap!(), ) .unwrap(), )); }
rust_cleaned_test_functions.jsonl/25472
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 207 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11803, 11123, 11448, 15875, 15124, 368, 341, 286, 2504, 4470, 8623, 11803, 11123, 11448, 1006, 310, 330, 9163, 39433, 3263, 983, 3904, 3148, 310, 13483, 5009, 486, 1499, 26488, 6615, 15875, 1006, 39...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_sub() { assert_eq!(u5(1) - u5(1), u5(0)); assert_eq!(u5(3) - u5(2), u5(1)); assert_eq!(i1(-1) - i1(-1) , i1(0)); assert_eq!(i7::MIN - i7::MIN , i7(0)); assert_eq!(i7(4) - i7(-3), i7(7)); assert_eq!(i7(-4) - i7(3), i7(-7)); assert_eq!(i7(-3) - i7(-20), i7(17)); }
rust_cleaned_test_functions.jsonl/112533
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 225 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5228, 368, 341, 286, 2060, 10714, 10297, 84, 20, 7, 16, 8, 481, 575, 20, 7, 16, 701, 575, 20, 7, 15, 1106, 286, 2060, 10714, 10297, 84, 20, 7, 18, 8, 481, 575, 20, 7, 17, 701, 575, 20,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_decoders() { // supported encodings create_and_check_decoder::<Int32Type>(Encoding::PLAIN, None); create_and_check_decoder::<Int32Type>(Encoding::DELTA_BINARY_PACKED, None); create_and_check_decoder::<Int32Type>(Encoding::DELTA_LENGTH_BYTE_ARRAY, None); create_and_check_decoder::<Int32Type>(Encoding::DELTA_BYTE_ARRAY, None); create_and_check_decoder::<BoolType>(Encoding::RLE, None); // error when initializing create_and_check_decoder::<Int32Type>( Encoding::RLE_DICTIONARY, Some(general_err!( "Cannot initialize this encoding through this function" )), ); create_and_check_decoder::<Int32Type>( Encoding::PLAIN_DICTIONARY, Some(general_err!( "Cannot initialize this encoding through this function" )), ); // unsupported create_and_check_decoder::<Int32Type>( Encoding::BIT_PACKED, Some(nyi_err!("Encoding BIT_PACKED is not supported")), ); }
rust_cleaned_test_functions.jsonl/38503
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 548 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 13783, 52498, 368, 341, 286, 442, 7248, 3209, 58335, 198, 286, 1855, 8378, 7200, 49843, 27638, 1072, 18, 17, 929, 2235, 14690, 486, 90889, 11, 2240, 317, 286, 1855, 8378, 7200, 49843, 27638,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_handler_error_cases() { let mem = GuestMemory::new(&[(GuestAddress(0), 0x10000)]).unwrap(); let (mut h, _txq, _rxq) = default_test_netepollhandler(&mem, TestMutators::default()); // RX rate limiter events should error since the limiter is not blocked. // Validate that the event failed and failure was properly accounted for. check_metric_after_block!( &METRICS.net.event_fails, 1, h.handle_event(RX_RATE_LIMITER_EVENT, EPOLLIN) ); // TX rate limiter events should error since the limiter is not blocked. // Validate that the event failed and failure was properly accounted for. check_metric_after_block!( &METRICS.net.event_fails, 1, h.handle_event(TX_RATE_LIMITER_EVENT, EPOLLIN) ); }
rust_cleaned_test_functions.jsonl/84699
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 391 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10183, 4096, 41427, 368, 341, 286, 1077, 1833, 284, 26215, 10642, 486, 931, 2099, 9697, 37804, 4286, 7, 15, 701, 220, 15, 87, 16, 15, 15, 15, 15, 7252, 568, 15454, 543, 286, 1077, 320, 6984, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_array_module() -> Result<()> { let db = Connection::open_in_memory()?; array::load_module(&db)?; let v = vec![1i64, 2, 3, 4]; let values: Vec<Value> = v.into_iter().map(Value::from).collect(); let ptr = Rc::new(values); { let mut stmt = db.prepare("SELECT value from rarray(?);")?; let rows = stmt.query_map(&[&ptr], |row| row.get::<_, i64>(0))?; assert_eq!(2, Rc::strong_count(&ptr)); let mut count = 0; for (i, value) in rows.enumerate() { assert_eq!(i as i64, value? - 1); count += 1; } assert_eq!(4, count); } assert_eq!(1, Rc::strong_count(&ptr)); Ok(()) }
rust_cleaned_test_functions.jsonl/76875
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 425 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3858, 10750, 368, 1464, 5714, 71698, 341, 286, 1077, 2927, 284, 11032, 486, 2508, 1243, 19195, 94136, 286, 1334, 486, 1078, 10750, 2099, 1999, 89720, 286, 1077, 348, 284, 7486, 20703, 16, 72, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
#[test] fn test_derive_serialize_proc_macro() { assert_expand( "serde_derive", "Serialize", "1.0", r"struct Foo {}", include_str!("fixtures/test_serialize_proc_macro.txt"), ); }
rust_cleaned_test_functions.jsonl/72669
{ "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, 35345, 533, 88686, 24436, 58810, 368, 341, 262, 2060, 67875, 1006, 286, 330, 47024, 35345, 533, 756, 286, 330, 15680, 756, 286, 330, 16, 13, 15, 756, 286, 435, 80575, 33428, 4687, 756, 286, 2924...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_isaac64_new_uninitialized() { // Compare the results from initializing `IsaacRng` with // implementation when used uninitialized. // first block. let mut rng = Isaac64Rng::seed_from_u64(0); let mut results = [0u64; 16]; for i in results.iter_mut() { *i = rng.next_u64(); } let expected: [u64; 16] = [ 0xF67DFBA498E4937C, 0x84A5066A9204F380, 0xFEE34BD5F5514DBB, 0x4D1664739B8F80D6, 0x8607459AB52A14AA, 0x0E78BC5A98529E49, 0xFE5332822AD13777, 0x556C27525E33D01A, 0x08643CA615F3149F, 0xD0771FAF3CB04714, 0x30E86F68A37B008D, 0x3074EBC0488A3ADF, 0x270645EA7A2790BC, 0x5601A0A8D3763C6A, 0x2F83071F53F325DD, 0xB9090F3D42D2D2EA]; assert_eq!(results, expected); }
rust_cleaned_test_functions.jsonl/5538
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 480 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6892, 64705, 21, 19, 5921, 4907, 36161, 368, 341, 286, 442, 23768, 279, 3059, 504, 57060, 1565, 3872, 64705, 49, 968, 63, 448, 8945, 286, 442, 8129, 979, 1483, 97287, 624, 1789, 286, 442, 1156, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_hidden_file_attribute() { use std::os::windows::fs::OpenOptionsExt; let te = TestEnv::new(DEFAULT_DIRS, DEFAULT_FILES); const FILE_ATTRIBUTE_HIDDEN: u32 = 2; fs::OpenOptions::new() .create(true) .write(true) .attributes(FILE_ATTRIBUTE_HIDDEN) .open(te.test_root().join("hidden-file.txt")) .unwrap(); te.assert_output(&["--hidden", "hidden-file.txt"], "hidden-file.txt"); te.assert_output(&["hidden-file.txt"], ""); }
rust_cleaned_test_functions.jsonl/10863
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 235 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 26739, 2458, 16791, 368, 341, 262, 990, 1460, 486, 436, 486, 27077, 486, 3848, 486, 5002, 3798, 6756, 401, 262, 1077, 1013, 284, 3393, 14359, 486, 931, 43175, 90560, 11, 11955, 48010, 626, 1066, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_contribution_to_bankrupt_pool() { new_test_ext().execute_with(|| { set_block_1(); setup_workers(1); setup_pool_with_workers(1, &[1]); // pid = 0 assert_ok!(PhalaStakePool::contribute( Origin::signed(1), 0, 100 * DOLLARS )); assert_ok!(PhalaStakePool::start_mining( Origin::signed(1), 0, worker_pubkey(1), 100 * DOLLARS )); simulate_v_update(1, fp!(0).to_bits()); assert_ok!(PhalaStakePool::stop_mining( Origin::signed(1), 0, worker_pubkey(1) )); elapse_cool_down(); assert_ok!(PhalaStakePool::reclaim_pool_worker( Origin::signed(1), 0, worker_pubkey(1) )); // Check cannot contribute assert_noop!( PhalaStakePool::contribute(Origin::signed(1), 0, 10 * DOLLARS), Error::<Test>::PoolBankrupt, ); }); }
rust_cleaned_test_functions.jsonl/60465
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 456 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6536, 3382, 31140, 2346, 35733, 6585, 15709, 368, 341, 298, 8638, 4452, 9927, 1005, 10257, 6615, 79453, 341, 571, 8196, 7113, 62, 16, 543, 571, 84571, 43557, 7, 16, 317, 571, 84571, 15709, 6615, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_unified_disabled() { // Allow invalid yatp config when yatp is not used. let unified = UnifiedReadPoolConfig { min_thread_count: 0, max_thread_count: 0, }; assert!(unified.validate().is_err()); let storage = StorageReadPoolConfig::default(); assert!(storage.validate().is_ok()); let coprocessor = CoprReadPoolConfig::default(); assert!(coprocessor.validate().is_ok()); let cfg = ReadPoolConfig { unify_read_pool: false, unified, storage, coprocessor, }; assert!(cfg.validate().is_ok()); // Storage and coprocessor config must be valid when yatp is not used. let unified = UnifiedReadPoolConfig::default(); assert!(unified.validate().is_ok()); let storage = StorageReadPoolConfig { high_concurrency: 0, ..Default::default() }; assert!(storage.validate().is_err()); let coprocessor = CoprReadPoolConfig::default(); let invalid_cfg = ReadPoolConfig { unify_read_pool: false, unified, storage, coprocessor, }; assert!(invalid_cfg.validate().is_err()); }
rust_cleaned_test_functions.jsonl/30859
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 612 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4907, 1870, 51401, 368, 341, 286, 442, 26530, 8318, 131454, 79, 2193, 979, 131454, 79, 374, 537, 1483, 624, 286, 1077, 42690, 284, 72434, 4418, 10551, 2648, 341, 310, 1308, 10814, 3180, 25, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_progress_resume_by_heartbeat_resp() { let l = default_logger(); let mut raft = new_test_raft(1, vec![1, 2], 5, 1, new_storage(), &l); raft.become_candidate(); raft.become_leader(); raft.mut_prs().get_mut(2).unwrap().paused = true; raft.step(new_message(1, 1, MessageType::MsgBeat, 0)) .expect(""); assert!(raft.prs().get(2).unwrap().paused); raft.mut_prs().get_mut(2).unwrap().become_replicate(); raft.step(new_message(2, 1, MessageType::MsgHeartbeatResponse, 0)) .expect(""); assert!(!raft.prs().get(2).unwrap().paused); }
rust_cleaned_test_functions.jsonl/19082
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 270 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 27200, 58132, 3710, 62, 72471, 35160, 368, 341, 262, 1077, 326, 284, 1638, 27413, 543, 262, 1077, 5206, 52455, 284, 501, 4452, 62, 2944, 7, 16, 11, 7486, 20703, 16, 11, 220, 17, 1125, 220, 20,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_lazy_query_7() { let date = NaiveDate::from_ymd(2021, 3, 5); let dates = [ NaiveDateTime::new(date, NaiveTime::from_hms(12, 0, 0)), NaiveDateTime::new(date, NaiveTime::from_hms(12, 1, 0)), NaiveDateTime::new(date, NaiveTime::from_hms(12, 2, 0)), NaiveDateTime::new(date, NaiveTime::from_hms(12, 3, 0)), NaiveDateTime::new(date, NaiveTime::from_hms(12, 4, 0)), NaiveDateTime::new(date, NaiveTime::from_hms(12, 5, 0)), ]; let data = vec![Some(1.), Some(2.), Some(3.), Some(4.), None, None]; let df = DataFrame::new(vec![ DatetimeChunked::from_naive_datetime("date", dates, TimeUnit::Nanoseconds).into(), Series::new("data", data), ]) .unwrap(); // this tests if predicate pushdown not interferes with the shift data. let out = df .lazy() .with_column(col("data").shift(-1).alias("output")) .with_column(col("output").shift(2).alias("shifted")) .filter(col("date").gt(lit(NaiveDateTime::new(date, NaiveTime::from_hms(12, 2, 0))))) .collect() .unwrap(); let a = out.column("shifted").unwrap().sum::<f64>().unwrap() - 7.0; assert!(a < 0.01 && a > -0.01); }
rust_cleaned_test_functions.jsonl/124
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 573 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 49646, 5738, 62, 22, 368, 341, 262, 1077, 2400, 284, 12812, 533, 1916, 486, 1499, 62, 1600, 67, 7, 17, 15, 17, 16, 11, 220, 18, 11, 220, 20, 317, 262, 1077, 12713, 284, 2278, 286, 12812, 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_string_dictionary_builder_with_existing_dictionary() { let dictionary = StringArray::from(vec![None, Some("def"), Some("abc")]); let key_builder = PrimitiveBuilder::<Int8Type>::new(6); let mut builder = StringDictionaryBuilder::new_with_dictionary(key_builder, &dictionary) .unwrap(); builder.append("abc").unwrap(); builder.append_null().unwrap(); builder.append("def").unwrap(); builder.append("def").unwrap(); builder.append("abc").unwrap(); builder.append("ghi").unwrap(); let array = builder.finish(); assert_eq!( array.keys(), &Int8Array::from(vec![Some(2), None, Some(1), Some(1), Some(2), Some(3)]) ); // Values are polymorphic and so require a downcast. let av = array.values(); let ava: &StringArray = av.as_any().downcast_ref::<StringArray>().unwrap(); assert_eq!(ava.is_valid(0), false); assert_eq!(ava.value(1), "def"); assert_eq!(ava.value(2), "abc"); assert_eq!(ava.value(3), "ghi"); }
rust_cleaned_test_functions.jsonl/31002
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 517 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3904, 42605, 28532, 6615, 62630, 42605, 368, 341, 286, 1077, 10997, 284, 923, 1857, 486, 1499, 25592, 20703, 4064, 11, 4329, 445, 750, 3975, 4329, 445, 13683, 899, 10149, 286, 1077, 1376, 28532, 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_from_receiver() { let (tx, rx) = channel(); tx.send("whale".to_string()); let mut f = Future::from_receiver(rx); assert_eq!(f.get(), "whale".to_string()); }
rust_cleaned_test_functions.jsonl/12166
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 108 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 65691, 368, 341, 286, 1077, 320, 3998, 11, 19111, 8, 284, 5496, 543, 286, 9854, 5219, 445, 1312, 1574, 3263, 983, 3904, 1423, 286, 1077, 5206, 282, 284, 12498, 486, 1499, 65691, 75279, 317...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_drain_inclusive_out_of_bounds() { let mut v = vec![1, 2, 3, 4, 5]; v.drain(5..=5); }
rust_cleaned_test_functions.jsonl/24426
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 65 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 26680, 466, 1243, 8336, 6068, 3575, 36878, 368, 341, 262, 1077, 5206, 348, 284, 7486, 20703, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 935, 262, 348, 950, 29093, 7, 20, 496, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_panic_tags() { let pos_t = get::<Pos>(); let kind = pos_t.get_kind(); let pos_t = TaggedType::new(&pos_t, kind, Box::new(PanicDrop(42))); assert_eq!(pos_t.get_tagged_data(), Some(&PanicDrop(42))); }
rust_cleaned_test_functions.jsonl/101714
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 112 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 620, 31270, 16333, 368, 341, 262, 1077, 1133, 528, 284, 633, 27638, 4859, 3913, 262, 1077, 3093, 284, 1133, 528, 670, 33162, 543, 262, 1077, 1133, 528, 284, 12353, 3556, 929, 486, 931, 2099, 966...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_exploded_window_function() -> Result<()> { let df = fruits_cars(); let out = df .clone() .lazy() .sort("fruits", false) .select(vec![ col("fruits"), col("B") .shift(1) .over(vec![col("fruits")]) .explode() .alias("shifted"), ]) .collect()?; assert_eq!( Vec::from(out.column("shifted")?.i32()?), &[None, Some(3), None, Some(5), Some(4)] ); // this tests if cast succeeds in aggregation context // we implicitly also test that a literal does not upcast a column let out = df .lazy() .sort("fruits", false) .select(vec![ col("fruits"), col("B") .shift_and_fill(1, lit(-1.0)) .over(vec![col("fruits")]) .explode() .alias("shifted"), ]) .collect()?; assert_eq!( Vec::from(out.column("shifted")?.i32()?), &[Some(-1), Some(3), Some(-1), Some(5), Some(4)] ); Ok(()) }
rust_cleaned_test_functions.jsonl/22411
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 625 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2702, 500, 6737, 12571, 9174, 368, 1464, 5714, 71698, 341, 262, 1077, 6764, 284, 25322, 666, 1561, 1428, 262, 1077, 700, 284, 6764, 198, 286, 659, 19982, 741, 286, 659, 49013, 741, 286, 659, 686...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
#[test] fn test_units_mm() { let vm = &mut VM::new(); vm.set_source("0.3E mm"); vm.evaluate_input(); assert_eq!(vm.last_error(), None); assert_eq!(vm.f_stack().len(), 1); let t = vm.f_stack().pop(); assert!(double_value_check(t, 0.000_3)); }
rust_cleaned_test_functions.jsonl/29586
{ "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, 28345, 35599, 368, 341, 286, 1077, 10995, 284, 609, 6984, 17792, 486, 931, 543, 286, 10995, 980, 10347, 445, 15, 13, 18, 36, 9465, 797, 286, 10995, 36036, 5898, 543, 286, 2060, 10714, 10297, 733...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_sort_stability() { for len in (2..25).chain(500..510) { for _ in 0..10 { let mut counts = [0; 10]; // the second item represents which occurrence of that // will occur in sorted order. let mut v: Vec<_> = (0..len) .map(|_| { let n = thread_rng().gen::<usize>() % 10; counts[n] += 1; (n, counts[n]) }) .collect(); // may mix up the counts. v.sort_by(|&(a, _), &(b, _)| a.cmp(&b)); // this comparison includes the count (the second item // will need to be ordered with increasing // stable. assert!(v.windows(2).all(|w| w[0] <= w[1])); } } }
rust_cleaned_test_functions.jsonl/73343
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 534 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18435, 1261, 2897, 368, 341, 262, 369, 2422, 304, 320, 17, 496, 17, 20, 568, 8819, 7, 20, 15, 15, 496, 20, 16, 15, 8, 341, 286, 369, 716, 304, 220, 15, 496, 16, 15, 341, 310, 1077, 5206,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_memory() { let memory = "backend=memory"; storage(memory).unwrap(); let memory = "backend=memory;extra=stuff"; assert!(storage(memory).is_err()); }
rust_cleaned_test_functions.jsonl/32308
{ "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, 19195, 368, 341, 286, 1077, 4938, 284, 330, 20942, 28, 17269, 876, 286, 5819, 63230, 568, 15454, 1428, 286, 1077, 4938, 284, 330, 20942, 28, 17269, 26, 15460, 28, 57304, 876, 286, 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, 1, 1, 1 ]
1
#[test] fn test_find_magnitude_of_added_snailfish_numbers() { // given let input = "[[[0,[5,8]],[[1,7],[9,6]]],[[4,[1,2]],[[1,4],2]]]\r\n\ [[[5,[2,8]],4],[5,[[9,9],0]]]\r\n[6,[[[6,2],[5,6]],[[7,6],[4,7]]]]\r\n\ [[[6,[0,7]],[0,9]],[4,[9,[9,0]]]]\r\n\ [[[7,[6,4]],[3,[1,3]]],[[[5,5],1],9]]\r\n\ [[6,[[7,3],[3,2]]],[[[3,8],[5,7]],4]]\r\n\ [[[[5,4],[7,7]],8],[[8,3],8]]\r\n[[9,3],[[9,9],[6,[4,9]]]]\r\n\ [[2,[[7,7],7]],[[5,8],[[9,3],[0,2]]]]\r\n\ [[[[5,2],5],[8,[3,7]]],[[5,[7,5]],[4,4]]]\r\n"; // when let magnitude_of_added_snailfish_numbers = find_magnitude_of_added_snailfish_numbers(input); // then assert_eq!(magnitude_of_added_snailfish_numbers, Ok(4140)); }
rust_cleaned_test_functions.jsonl/60566
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 641 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21814, 717, 34715, 3575, 37653, 28022, 604, 18170, 32964, 368, 341, 286, 442, 2661, 198, 286, 1077, 1946, 284, 10545, 15505, 15, 17259, 20, 11, 23, 60, 14955, 58, 16, 11, 22, 14955, 24, 11, 21...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_find_roots_linear() { assert_eq!(find_roots_linear(0f32, 0f32), Roots::One([0f32])); assert_eq!(find_roots_linear(2f64, 1f64), Roots::One([-0.5f64])); assert_eq!(find_roots_linear(0f32, 1f32), Roots::No([])); }
rust_cleaned_test_functions.jsonl/98048
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 134 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21814, 26608, 2412, 40674, 368, 341, 286, 2060, 10714, 10297, 3903, 26608, 2412, 40674, 7, 15, 69, 18, 17, 11, 220, 15, 69, 18, 17, 701, 74587, 486, 3966, 2561, 15, 69, 18, 17, 14382, 286, 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_config_manager__config_dir_exists__success() -> TestResult { let cm = ConfigManager {}; let (_config_dir, _tmp_dir) = set_and_create_config_dir()?; let config_dir_exists = cm.config_dir_exists(); env::remove_var("HOME"); assert!(config_dir_exists); Ok(()) }
rust_cleaned_test_functions.jsonl/81013
{ "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, 5332, 12144, 563, 1676, 4334, 9766, 563, 5630, 368, 1464, 3393, 2077, 341, 286, 1077, 9961, 284, 5532, 2043, 9321, 286, 1077, 5453, 1676, 4334, 11, 716, 5173, 4334, 8, 284, 738, 8378, 8657, 5332...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_validate_max_gas_units_below_min() { let (config, key) = config_builder::test_config(); let (vm_validator, mut rt) = TestValidator::new(&config); let address = account_config::association_address(); let txn = transaction_test_helpers::get_test_signed_transaction( address, 1, &key, key.public_key(), None, 0, 0, /* max gas price */ Some(1), // Max gas units ); let ret = rt.block_on(vm_validator.validate_transaction(txn)).unwrap(); assert_eq!( ret.unwrap().major_status, StatusCode::MAX_GAS_UNITS_BELOW_MIN_TRANSACTION_GAS_UNITS ); }
rust_cleaned_test_functions.jsonl/2298
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 316 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 42681, 6345, 82116, 28345, 82750, 7260, 368, 341, 262, 1077, 320, 1676, 11, 1376, 8, 284, 2193, 28532, 486, 1944, 5332, 543, 262, 1077, 320, 7338, 64959, 11, 5206, 16677, 8, 284, 3393, 14256, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_try_into_ndarray1_0() { let hw = RefCell::new(CpuHardware::new()); let src = Array::fill_f32(&hw, Shape::new([0]), 42.); let dest = ndarray::Array1::<f32>::try_from(&src).unwrap(); assert_eq!(dest, ndarray::arr1(&[])); }
rust_cleaned_test_functions.jsonl/73965
{ "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, 53283, 45514, 43544, 1653, 16, 62, 15, 368, 341, 262, 1077, 31256, 284, 8550, 3599, 486, 931, 3025, 5584, 66862, 486, 931, 1423, 262, 1077, 2286, 284, 2910, 486, 7559, 761, 18, 17, 2099, 27827, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_dominance_frontiers() { let graph = create_test_graph(); let dominance_frontiers = graph.compute_dominance_frontiers(1).unwrap(); assert_eq!( dominance_frontiers.get(&1).unwrap(), &vec![].into_iter().collect() ); assert_eq!( dominance_frontiers.get(&2).unwrap(), &vec![2].into_iter().collect() ); assert_eq!( dominance_frontiers.get(&3).unwrap(), &vec![5].into_iter().collect() ); assert_eq!( dominance_frontiers.get(&4).unwrap(), &vec![5].into_iter().collect() ); assert_eq!( dominance_frontiers.get(&5).unwrap(), &vec![2].into_iter().collect() ); assert_eq!( dominance_frontiers.get(&6).unwrap(), &vec![].into_iter().collect() ); }
rust_cleaned_test_functions.jsonl/1478
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 491 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 814, 7970, 681, 22926, 4813, 368, 341, 286, 1077, 4771, 284, 1855, 4452, 14738, 543, 286, 1077, 43492, 22926, 4813, 284, 4771, 35347, 814, 7970, 681, 22926, 4813, 7, 16, 568, 15454, 1428, 286, 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_from_dec_lit() { let d = Decimal::<2>::from_str("-17.5").unwrap(); assert_eq!(d.coeff, -1750); }
rust_cleaned_test_functions.jsonl/12017
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 78 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 13783, 98399, 368, 341, 286, 1077, 294, 284, 26728, 27638, 17, 6831, 1499, 2895, 13645, 16, 22, 13, 20, 1827, 15454, 543, 286, 2060, 10714, 10297, 67, 86462, 11, 481, 16, 22, 20, 15, 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
#[test] fn test_accountsdb_add_root() { morgan_logger::setup(); let paths = get_tmp_accounts_path!(); let db = AccountsDB::new(&paths.paths); let key = Pubkey::default(); let account0 = Account::new(1, 0, 0, &key); db.store(0, &[(&key, &account0)]); db.add_root(0); let ancestors = vec![(1, 1)].into_iter().collect(); assert_eq!(db.load_slow(&ancestors, &key), Some((account0, 0))); }
rust_cleaned_test_functions.jsonl/49122
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 227 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 55665, 1999, 2891, 12993, 368, 341, 286, 296, 8462, 27413, 486, 15188, 543, 286, 1077, 12716, 284, 633, 16125, 55665, 2638, 0, 543, 286, 1077, 2927, 284, 40655, 3506, 486, 931, 2099, 21623, 65345,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_arg_matches_unicode() { let argv = vec!["lsd", "--icon-theme", "unicode"]; let matches = app::build().get_matches_from_safe(argv).unwrap(); assert_eq!( Some(IconTheme::Unicode), IconTheme::from_arg_matches(&matches) ); }
rust_cleaned_test_functions.jsonl/17365
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 157 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 6057, 38344, 54662, 368, 341, 286, 1077, 10213, 284, 7486, 0, 1183, 4730, 67, 497, 14482, 1924, 33185, 497, 330, 24519, 6332, 286, 1077, 9071, 284, 906, 486, 5834, 1005, 455, 38344, 5673, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_ref_middle() { let mut cache = Cache::with_capacity(100); let key1 = Key::Rid(RID(1)); let key2 = Key::Rid(RID(2)); let key3 = Key::Rid(RID(3)); let dbs = Box::new(DivBufShared::from(vec![0u8; 5])); cache.insert(key1, dbs); let dbs = Box::new(DivBufShared::from(vec![0u8; 7])); cache.insert(key2, dbs); let dbs = Box::new(DivBufShared::from(vec![0u8; 11])); cache.insert(key3, dbs); let r = cache.get_ref(&key2).unwrap().downcast::<DivBuf>().unwrap(); assert_eq!(r.len(), 7); assert_eq!(cache.mru, Some(key3)); assert_eq!(cache.lru, Some(key1)); { let v = &cache.store[&key1]; assert_eq!(v.mru, Some(key2)); } { let v = &cache.store[&key2]; assert_eq!(v.lru, Some(key1)); assert_eq!(v.mru, Some(key3)); } { let v = &cache.store[&key3]; assert_eq!(v.lru, Some(key2)); } }
rust_cleaned_test_functions.jsonl/90044
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 491 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 7793, 62580, 368, 341, 262, 1077, 5206, 6500, 284, 19479, 486, 4197, 35603, 7, 16, 15, 15, 317, 262, 1077, 1376, 16, 284, 5309, 486, 49, 307, 2785, 915, 7, 16, 1106, 262, 1077, 1376, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_truncating_serializer() { // Test truncate front. let body = vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; let ser = TruncatingSerializer::new(Buf::new(body.clone(), ..), TruncateDirection::DiscardFront) .into_verifying(true); let buf = ser.clone().with_mtu_verifying(4, true).serialize_vec_outer().unwrap(); let buf: &[u8] = buf.as_ref(); assert_eq!(buf, &[6, 7, 8, 9][..]); // Test truncate back. let ser = TruncatingSerializer::new(Buf::new(body.clone(), ..), TruncateDirection::DiscardBack) .into_verifying(true); let buf = ser.with_mtu_verifying(7, true).serialize_vec_outer().unwrap(); let buf: &[u8] = buf.as_ref(); assert_eq!(buf, &[0, 1, 2, 3, 4, 5, 6][..]); let ser = TruncatingSerializer::new(Buf::new(body.clone(), ..), TruncateDirection::NoTruncating) .into_verifying(false); assert!(ser.clone().with_mtu_verifying(5, true).serialize_vec_outer().is_err()); assert!(ser.with_mtu_verifying(5, true).serialize_vec_outer().is_err()); fn test_serialization_failure<S: Serializer + Clone + Eq + Debug>( ser: S, err: SerializeError<BufferTooShortError>, ) where S::Buffer: ReusableBuffer + Debug, { // Serialize with a PacketBuilder with an MTU of 1 so that the body // should be returned to its original un-truncated state before // being returned from `serialize`. let (e, new_ser) = ser.clone().serialize_no_alloc(DummyPacketBuilder::new(2, 2, 0, 1)).unwrap_err(); assert_eq!(err, e); assert_eq!(new_ser, ser); } let body = Buf::new(vec![1, 2], ..); test_serialization_failure( TruncatingSerializer::new(body.clone(), TruncateDirection::DiscardFront) .into_verifying(true), SerializeError::Alloc(BufferTooShortError), ); test_serialization_failure( TruncatingSerializer::new(body.clone(), TruncateDirection::DiscardFront) .into_verifying(true), SerializeError::Alloc(BufferTooShortError), ); test_serialization_failure( TruncatingSerializer::new(body.clone(), TruncateDirection::NoTruncating) .into_verifying(false), SerializeError::Mtu, ); }
rust_cleaned_test_functions.jsonl/131784
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1383 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3547, 1347, 1095, 67441, 368, 341, 1789, 286, 442, 3393, 56772, 4065, 624, 23459, 286, 1077, 2487, 284, 7486, 20703, 15, 11, 220, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 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_line_len_rope() { use crate::commandline; let (rope, s) = commandline::from_path(Some("./KJV.txt".to_string())); assert_eq!(s, Some("./KJV.txt".to_string())); let v = rope.line(0).as_str().unwrap_or("\n").trim().chars().collect::<Vec<char>>(); assert_eq!(v.len(), 66); }
rust_cleaned_test_functions.jsonl/131723
{ "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, 6528, 6043, 26608, 375, 368, 341, 262, 990, 17717, 486, 5631, 1056, 280, 262, 1077, 320, 299, 375, 11, 274, 8, 284, 3210, 1056, 486, 1499, 2638, 65405, 13988, 42, 77891, 3909, 3263, 983, 3904, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_delete_trackers_from_memory() { let responder = init_responder(MockedServerQuery::Regular); // Add user to the database let user_id = get_random_user_id(); responder .dbm .lock() .unwrap() .store_user(user_id, &UserInfo::new(21, 42)) .unwrap(); // Add some trackers both to memory and to the database let mut to_be_deleted = HashMap::new(); for _ in 0..10 { let (uuid, appointment) = generate_dummy_appointment_with_user(user_id, None); responder .dbm .lock() .unwrap() .store_appointment(uuid, &appointment) .unwrap(); let breach = get_random_breach(); responder.add_tracker( uuid, breach.clone(), user_id, ConfirmationStatus::ConfirmedIn(21), ); to_be_deleted.insert(uuid, breach.penalty_tx.txid()); } responder.delete_trackers_from_memory( &to_be_deleted.keys().cloned().collect(), DeletionReason::Completed, ); for (uuid, txid) in to_be_deleted { // Data is not in memory assert!(!responder.trackers.lock().unwrap().contains_key(&uuid)); assert!(!responder.tx_tracker_map.lock().unwrap().contains_key(&txid)); // But it can be found in the database assert!(matches!( responder.dbm.lock().unwrap().load_tracker(uuid), Ok(TransactionTracker { .. }) )); } }
rust_cleaned_test_functions.jsonl/55484
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 910 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11353, 28545, 388, 5673, 19195, 368, 341, 286, 1077, 64034, 284, 2930, 4918, 20328, 66436, 291, 5475, 2859, 486, 30404, 626, 286, 442, 2691, 1196, 311, 279, 4625, 198, 286, 1077, 1196, 842, 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...
3
#[test] fn test_cond() { expect_prog(r#"let a = 5; a == 5"#, Value::Boolean(true)); expect_prog(r#"let a = 5.0; a == 5.0"#, Value::Boolean(true)); expect_prog(r#"let a = 5.001; a >= 5"#, Value::Boolean(true)); expect_prog(r#"let a = 5.001; a <= 5"#, Value::Boolean(false)); }
rust_cleaned_test_functions.jsonl/77503
{ "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, 24433, 368, 341, 262, 1720, 60390, 2601, 55543, 1149, 264, 284, 220, 20, 26, 264, 621, 220, 20, 57676, 11, 5162, 486, 6890, 3715, 1106, 262, 1720, 60390, 2601, 55543, 1149, 264, 284, 220, 20, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_add_to_trie() { let mut builder = DictionaryBuilder::default(); builder.add_to_trie("abc", 0); builder.add_to_trie("abc", 1); builder.add_to_trie("abcd", 2); assert!(builder.trie_keys["abc"].contains(&0)); assert!(builder.trie_keys["abc"].contains(&1)); assert!(builder.trie_keys["abcd"].contains(&2)); }
rust_cleaned_test_functions.jsonl/134073
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 157 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2891, 2346, 3547, 645, 368, 341, 262, 1077, 5206, 7363, 284, 10466, 3297, 486, 2258, 543, 262, 7363, 1364, 2346, 3547, 645, 445, 13683, 497, 220, 15, 317, 262, 7363, 1364, 2346, 3547, 645, 445, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_nonce_ix_no_acc_data_fail() { assert_eq!( process_nonce_instruction(&system_instruction::advance_nonce_account( &Pubkey::default(), &Pubkey::default() )), Err(InstructionError::InvalidAccountData), ); }
rust_cleaned_test_functions.jsonl/73059
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 170 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11305, 48508, 62686, 6536, 17737, 1769, 22121, 368, 341, 286, 2060, 10714, 33673, 310, 1882, 48508, 54923, 2099, 8948, 54923, 486, 59320, 48508, 13500, 1006, 394, 609, 29162, 792, 486, 2258, 3148, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_to_packets_pinning() { let recycler = PacketsRecycler::default(); for i in 0..2 { let _first_packets = Packets::new_with_recycler(recycler.clone(), i + 1, "first one"); } }
rust_cleaned_test_functions.jsonl/32597
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 116 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2346, 63569, 620, 19770, 368, 341, 286, 1077, 1395, 10760, 284, 13795, 1415, 3820, 10760, 486, 2258, 543, 286, 369, 600, 304, 220, 15, 496, 17, 341, 310, 1077, 716, 3896, 63569, 284, 13795, 1415...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_get_item() { let gil = Python::acquire_gil(); let py = gil.python(); let v = vec![2, 3, 5, 7]; let list = v.to_py_object(py); assert_eq!(2, list.get_item(py, 0).extract::<i32>(py).unwrap()); assert_eq!(3, list.get_item(py, 1).extract::<i32>(py).unwrap()); assert_eq!(5, list.get_item(py, 2).extract::<i32>(py).unwrap()); assert_eq!(7, list.get_item(py, 3).extract::<i32>(py).unwrap()); }
rust_cleaned_test_functions.jsonl/4741
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 250 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 5634, 368, 341, 286, 1077, 342, 321, 284, 13027, 486, 580, 984, 1889, 321, 543, 286, 1077, 4510, 284, 342, 321, 43193, 543, 286, 1077, 348, 284, 7486, 20703, 17, 11, 220, 18, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_random_access_skip() { let xs = [1, 2, 3, 4, 5]; let empty: &[int] = []; check_randacc_iter(xs.iter().skip(2), xs.len() - 2); check_randacc_iter(empty.iter().skip(2), 0); }
rust_cleaned_test_functions.jsonl/1030
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 122 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22644, 12759, 44830, 368, 341, 286, 1077, 11943, 284, 508, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 935, 286, 1077, 4287, 25, 44590, 396, 60, 284, 5907, 286, 1779, 33864, 4475...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_block_segment_postings_seek() -> crate::Result<()> { let mut docs = vec![0]; for i in 0..1300 { docs.push((i * i / 100) + i); } let mut block_postings = build_block_postings(&docs[..])?; for i in &[0, 424, 10000] { block_postings.seek(*i); let docs = block_postings.docs(); assert!(docs[0] <= *i); assert!(docs.last().cloned().unwrap_or(0u32) >= *i); } block_postings.seek(100_000); assert_eq!(block_postings.doc(COMPRESSION_BLOCK_SIZE - 1), TERMINATED); Ok(()) }
rust_cleaned_test_functions.jsonl/40751
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 327 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7113, 28061, 6333, 819, 74473, 368, 1464, 17717, 486, 2077, 71698, 341, 286, 1077, 5206, 26340, 284, 7486, 20703, 15, 935, 286, 369, 600, 304, 220, 15, 496, 16, 18, 15, 15, 341, 310, 26340, 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...
4
#[test] fn test_handle_polyline() { let input_str = include_str!("../fixtures/input.polyline.txt").to_string(); assert_eq!( handle_polyline(input_str, "5", 0.).unwrap(), vec![ GridGeom::Line(Line::new((-120.2, 38.5), (-120.95, 40.7))), GridGeom::Line(Line::new((-120.95, 40.7), (-126.453, 43.252))) ] ); }
rust_cleaned_test_functions.jsonl/133000
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 226 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10630, 36133, 1056, 368, 341, 286, 1077, 1946, 2895, 284, 2924, 2895, 17223, 1244, 45247, 39990, 64581, 1056, 3909, 1827, 983, 3904, 543, 286, 2060, 10714, 33673, 310, 3705, 36133, 1056, 5384, 2895,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_custom_bounds() { let mut map: SendMap = TypeMap::custom(); map.insert::<KeyType>(Value(10)); assert!(map.contains::<KeyType>()); map.remove::<KeyType>(); assert!(!map.contains::<KeyType>()); }
rust_cleaned_test_functions.jsonl/33446
{ "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, 15875, 36878, 368, 341, 286, 1077, 5206, 2415, 25, 11000, 2227, 284, 3990, 2227, 486, 9163, 543, 286, 2415, 7030, 27638, 97964, 2235, 1130, 7, 16, 15, 1106, 286, 2060, 10297, 2186, 8786, 27638, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_kr_definition1() { use ast::DerivedDeclarator::{KRFunction, Pointer}; use ast::Statement::Compound; use ast::TranslationUnit; use ast::TypeSpecifier::{Char, Int}; use parser::translation_unit; let env = &mut Env::new(); assert_eq!( translation_unit("int main(argc, argv) int argc; char **argv; { }", env), Ok(TranslationUnit(vec![FunctionDefinition { specifiers: vec![Int.into()], declarator: Declarator { kind: ident("main"), derived: vec![KRFunction(vec![ident("argc"), ident("argv")]).into()], extensions: vec![], } .into(), declarations: vec![ Declaration { specifiers: vec![Int.into()], declarators: vec![InitDeclarator { declarator: Declarator { kind: ident("argc"), derived: vec![], extensions: vec![], } .into(), initializer: None } .into()], } .into(), Declaration { specifiers: vec![Char.into()], declarators: vec![InitDeclarator { declarator: Declarator { kind: ident("argv"), derived: vec![Pointer(vec![]).into(), Pointer(vec![]).into()], extensions: vec![], } .into(), initializer: None } .into()], } .into(), ], statement: Compound(vec![]).into(), } .into()])) ); }
rust_cleaned_test_functions.jsonl/107585
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1176 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4698, 81, 31698, 16, 368, 341, 262, 990, 11763, 486, 67843, 1912, 12821, 850, 22964, 61884, 5152, 11, 21635, 2440, 262, 990, 11763, 486, 8636, 486, 43134, 280, 262, 990, 11763, 486, 24412, 4562, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_cmp() { assert_eq!( parse("CMP RX0 5 10").unwrap().body, vec![Node( Statement::Operator(Node( Operator::Cmp( Node(RegisterRef::User(0), span(1, 5, 1, 8)), Node( ValueSource::Const(Node(5, span(1, 9, 1, 10))), span(1, 9, 1, 10) ), Node( ValueSource::Const(Node(10, span(1, 11, 1, 13))), span(1, 11, 1, 13) ) ), span(1, 1, 1, 13) )), span(1, 1, 1, 13) )] ); }
rust_cleaned_test_functions.jsonl/118221
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 560 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35193, 368, 341, 286, 2060, 10714, 33673, 310, 4715, 445, 93158, 28170, 15, 220, 20, 220, 16, 15, 1827, 15454, 1005, 2599, 345, 310, 7486, 20703, 1955, 1006, 394, 21756, 486, 18461, 22078, 1006, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_file_name_only() { let query = "lib"; let line = "crates/extracted_fzy/src/lib.rs"; let (_, origin_indices) = fuzzy_indices_fzy(line, query).unwrap(); let (_, indices) = apply_fzy_on_file_line(line, query).unwrap(); assert_eq!(origin_indices, indices); }
rust_cleaned_test_functions.jsonl/115950
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 151 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2458, 1269, 18410, 368, 341, 286, 1077, 3239, 284, 330, 2740, 876, 286, 1077, 1555, 284, 330, 5082, 973, 14, 23493, 291, 761, 4246, 13437, 8194, 25638, 876, 286, 1077, 39464, 6238, 18333, 8, 284...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_verify_slice_with_hashes1() { solana_logger::setup(); let zero = Hash::default(); let one = hash(zero.as_ref()); let two = hash(one.as_ref()); assert!(vec![][..].verify(&one)); // base case assert!(vec![Entry::new_tick(1, &two)][..].verify(&one)); // singleton case 1 assert!(!vec![Entry::new_tick(1, &two)][..].verify(&two)); let mut ticks = vec![next_entry(&one, 1, vec![])]; ticks.push(next_entry(&ticks.last().unwrap().hash, 1, vec![])); assert!(ticks.verify(&one)); // inductive step let mut bad_ticks = vec![next_entry(&one, 1, vec![])]; bad_ticks.push(next_entry(&bad_ticks.last().unwrap().hash, 1, vec![])); bad_ticks[1].hash = one; assert!(!bad_ticks.verify(&one)); }
rust_cleaned_test_functions.jsonl/1635
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 393 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35638, 26488, 6615, 91616, 16, 368, 341, 286, 2048, 3362, 27413, 486, 15188, 543, 286, 1077, 7168, 284, 6531, 486, 2258, 543, 286, 1077, 825, 284, 5175, 13174, 2328, 5357, 7793, 1423, 286, 1077, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_group_common_pairs() { // Given let bpe_pairs = generate_bpe_pair_vocab(); let test_tuples = [ ( vec![ "h".to_owned(), "e".to_owned(), "l".to_owned(), "l".to_owned(), "o".to_owned(), ], ( vec![ "h".to_owned(), "el".to_owned(), "l".to_owned(), "o".to_owned(), ], false, ), ), ( vec![ "h".to_owned(), "el".to_owned(), "l".to_owned(), "o".to_owned(), ], ( vec!["h".to_owned(), "ell".to_owned(), "o".to_owned()], false, ), ), ( vec!["h".to_owned(), "ell".to_owned(), "o".to_owned()], (vec!["h".to_owned(), "ell".to_owned(), "o".to_owned()], true), ), (vec!["h".to_owned()], (vec!["h".to_owned()], true)), ( vec!["h".to_owned(), "ello".to_owned()], (vec!["h".to_owned(), "ello".to_owned()], true), ), ( vec!["h".to_owned(), "ello".to_owned()], (vec!["h".to_owned(), "ello".to_owned()], true), ), ]; for (input, expected_output) in &test_tuples { assert_eq!( group_common_pairs(input.clone(), &bpe_pairs), *expected_output ); } }
rust_cleaned_test_functions.jsonl/13640
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1244 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6288, 21107, 36430, 368, 341, 286, 442, 286, 16246, 198, 286, 1077, 293, 375, 36430, 284, 6923, 880, 375, 14445, 52823, 1428, 286, 1077, 1273, 89269, 284, 2278, 310, 2399, 394, 7486, 90515, 503, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_get_version_jar_url() { let manifest = VersionManifest::default(); let url = manifest .find_version("20w48a") .expect("Failed to find this version") .jar_url() .expect("Failed to find the version server jar"); assert_eq!(url.as_str(), "https://launcher.mojang.com/v1/objects/a14d24f89d5a4ec7521b91909caf4fee89c997f4/server.jar") }
rust_cleaned_test_functions.jsonl/73540
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 211 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 9438, 5374, 277, 2903, 368, 341, 286, 1077, 14455, 284, 6079, 38495, 486, 2258, 1428, 286, 1077, 2515, 284, 14455, 198, 310, 659, 3903, 9438, 445, 17, 15, 86, 19, 23, 64, 1138, 310, 659,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_chunked() { let req = TestRequest::default().finish(); assert!(!req.chunked().unwrap()); let req = TestRequest::with_header(header::TRANSFER_ENCODING, "chunked").finish(); assert!(req.chunked().unwrap()); let req = TestRequest::default() .header( header::TRANSFER_ENCODING, Bytes::from_static(b"some va\xadscc\xacas0xsdasdlue"), ) .finish(); assert!(req.chunked().is_err()); }
rust_cleaned_test_functions.jsonl/7652
{ "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, 30539, 291, 368, 341, 286, 1077, 4232, 284, 3393, 1900, 486, 2258, 1005, 30150, 543, 286, 2060, 0, 3471, 2958, 47806, 291, 1005, 15454, 5231, 286, 1077, 4232, 4035, 310, 3393, 1900, 486, 4197, 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_f_order() { // even if the underlying memory order is different let c = arr2(&[[1, 2, 3], [4, 5, 6]]); let mut f = Array::zeros(c.dim().f()); f.assign(&c); assert_eq!(f, c); assert_eq!(f.shape(), c.shape()); assert_eq!(c.strides(), &[3, 1]); assert_eq!(f.strides(), &[1, 2]); itertools::assert_equal(f.iter(), c.iter()); itertools::assert_equal(f.rows(), c.rows()); itertools::assert_equal(f.outer_iter(), c.outer_iter()); itertools::assert_equal(f.axis_iter(Axis(0)), c.axis_iter(Axis(0))); itertools::assert_equal(f.axis_iter(Axis(1)), c.axis_iter(Axis(1))); let dupc = &c + &c; let dupf = &f + &f; assert_eq!(dupc, dupf); }
rust_cleaned_test_functions.jsonl/92620
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 341 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 761, 7869, 368, 341, 1066, 262, 442, 1496, 421, 279, 16533, 4938, 1973, 374, 2155, 198, 262, 1077, 272, 284, 2890, 17, 2099, 15505, 16, 11, 220, 17, 11, 220, 18, 1125, 508, 19, 11, 220, 20, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_as_string(){ let json_value = from_str("\"dog\"").unwrap(); let json_str = json_value.as_string(); let expected_str = "dog"; assert_eq!(json_str, Some(expected_str)); }
rust_cleaned_test_functions.jsonl/6570
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 107 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11898, 3904, 3032, 286, 1077, 2951, 3142, 284, 504, 2895, 38915, 18457, 2105, 1827, 15454, 543, 286, 1077, 2951, 2895, 284, 2951, 3142, 5357, 3904, 543, 286, 1077, 3601, 2895, 284, 330, 18457, 876...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_size() { // size of a pointer. assert_eq!( std::mem::size_of::<List<'_, i32>>(), std::mem::size_of::<*const u8>() ); }
rust_cleaned_test_functions.jsonl/17503
{ "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, 2368, 368, 341, 9401, 41693, 262, 442, 1379, 315, 264, 7445, 624, 262, 2060, 10714, 33673, 286, 1460, 486, 10536, 486, 2141, 3575, 27638, 852, 18291, 6878, 600, 18, 17, 2452, 3148, 286, 1460, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_file_path_with_no_dir() { let (dir, name, ext) = file_path_name_ext("image.png"); assert_eq!(dir, None); assert_eq!(name, "image"); assert_eq!(ext, Some("png")); }
rust_cleaned_test_functions.jsonl/5160
{ "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, 2458, 2638, 6615, 6536, 4334, 368, 341, 286, 1077, 320, 3741, 11, 829, 11, 1303, 8, 284, 1034, 2638, 1269, 9927, 445, 1805, 3508, 797, 286, 2060, 10714, 10297, 3741, 11, 2240, 317, 286, 2060, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_insert_overwrite() { let mut m = HashMap::new(); assert!(m.insert(1i, 2i)); assert_eq!(*m.find(&1).unwrap(), 2); assert!(!m.insert(1i, 3i)); assert_eq!(*m.find(&1).unwrap(), 3); }
rust_cleaned_test_functions.jsonl/41861
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 133 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17678, 15431, 4934, 368, 341, 286, 1077, 5206, 296, 284, 10528, 486, 931, 543, 286, 2060, 10297, 76, 7030, 7, 16, 72, 11, 220, 17, 72, 1106, 286, 2060, 10714, 0, 4071, 76, 2658, 2099, 16, 56...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_serialize_move_resource_with_address_0x0() { let res = MoveResource::try_from(annotated_move_struct( "Values", vec![( identifier("address_0x0"), AnnotatedMoveValue::Address(address("0x0")), )], )) .unwrap(); let value = to_value(&res).unwrap(); assert_json( value, json!({ "type": "0x1::Type::Values", "data": { "address_0x0": "0x0", } }), ); }
rust_cleaned_test_functions.jsonl/66275
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 362 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 88686, 17134, 17962, 6615, 6744, 62, 15, 87, 15, 368, 341, 286, 1077, 592, 284, 14561, 4783, 486, 1539, 5673, 7, 3401, 657, 17134, 15126, 1006, 310, 330, 6227, 756, 310, 7486, 20703, 1006, 394, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_node_merge_dist_isolation() { let mut cluster = new_node_cluster(0, 3); configure_for_merge(&mut cluster); let pd_client = Arc::clone(&cluster.pd_client); pd_client.disable_default_operator(); cluster.run(); cluster.must_put(b"k1", b"v1"); cluster.must_put(b"k3", b"v3"); let region = pd_client.get_region(b"k1").unwrap(); cluster.must_split(&region, b"k2"); let left = pd_client.get_region(b"k1").unwrap(); let right = pd_client.get_region(b"k3").unwrap(); cluster.must_transfer_leader(right.get_id(), new_peer(1, 1)); let target_leader = left .get_peers() .iter() .find(|p| p.get_store_id() == 3) .unwrap() .clone(); cluster.must_transfer_leader(left.get_id(), target_leader); must_get_equal(&cluster.get_engine(1), b"k3", b"v3"); // So cluster becomes: // I means isolation. cluster.add_send_filter(IsolationFilterFactory::new(1)); pd_client.must_merge(left.get_id(), right.get_id()); cluster.must_put(b"k4", b"v4"); cluster.clear_send_filters(); must_get_equal(&cluster.get_engine(1), b"k4", b"v4"); let region = pd_client.get_region(b"k1").unwrap(); cluster.must_split(&region, b"k2"); let left = pd_client.get_region(b"k1").unwrap(); let right = pd_client.get_region(b"k3").unwrap(); cluster.must_put(b"k11", b"v11"); pd_client.must_remove_peer(right.get_id(), new_peer(3, 3)); cluster.must_put(b"k33", b"v33"); cluster.add_send_filter(CloneFilterFactory( RegionPacketFilter::new(right.get_id(), 3).direction(Direction::Recv), )); pd_client.must_add_peer(right.get_id(), new_peer(3, 4)); let right = pd_client.get_region(b"k3").unwrap(); // So cluster becomes: // [x] means a replica exists logically but is not created on the store x yet. let res = cluster.try_merge(region.get_id(), right.get_id()); assert!(res.get_header().has_error(), "{:?}", res); let target_leader = left .get_peers() .iter() .find(|p| p.get_store_id() == 2) .unwrap() .clone(); cluster.must_transfer_leader(left.get_id(), target_leader); pd_client.must_merge(left.get_id(), right.get_id()); cluster.must_put(b"k4", b"v4"); cluster.clear_send_filters(); must_get_equal(&cluster.get_engine(3), b"k4", b"v4"); }
rust_cleaned_test_functions.jsonl/27249
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1084 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5084, 20888, 16031, 6892, 34962, 368, 341, 262, 1077, 5206, 10652, 284, 501, 5084, 28441, 7, 15, 11, 220, 18, 317, 262, 14411, 5478, 20888, 2099, 6984, 10652, 317, 262, 1077, 7744, 8179, 284, 19...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_cmpxchg() { let context = Context::create(); let module = context.create_module("cmpxchg"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("", fn_type, None); let entry = context.append_basic_block(fn_value, "entry"); let builder = context.create_builder(); builder.position_at_end(entry); let i32_type = context.i32_type(); let i64_type = context.i64_type(); let i32_ptr_type = i32_type.ptr_type(AddressSpace::Zero); let i32_ptr_ptr_type = i32_ptr_type.ptr_type(AddressSpace::Zero); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Monotonic, ); assert!(result.is_ok()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Unordered, AtomicOrdering::Monotonic, ); assert!(result.is_err()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Unordered, ); assert!(result.is_err()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Release, ); assert!(result.is_err()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::AcquireRelease, ); assert!(result.is_err()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::SequentiallyConsistent, ); assert!(result.is_err()); let ptr_value = i32_ptr_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Monotonic, ); assert!(result.is_err()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i64_type.const_zero(); let neg_one_value = i32_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Monotonic, ); assert!(result.is_err()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_type.const_zero(); let neg_one_value = i64_type.const_all_ones(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Monotonic, ); assert!(result.is_err()); let ptr_value = i32_ptr_ptr_type.get_undef(); let zero_value = i32_ptr_type.const_zero(); let neg_one_value = i32_ptr_type.const_zero(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Monotonic, ); assert!(result.is_ok()); let ptr_value = i32_ptr_type.get_undef(); let zero_value = i32_ptr_type.const_zero(); let neg_one_value = i32_ptr_type.const_zero(); let result = builder.build_cmpxchg( ptr_value, zero_value, neg_one_value, AtomicOrdering::Monotonic, AtomicOrdering::Monotonic, ); assert!(result.is_err()); }
rust_cleaned_test_functions.jsonl/125179
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2068 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35193, 87, 65940, 368, 341, 262, 1077, 2266, 284, 9608, 486, 3182, 543, 262, 1077, 4688, 284, 2266, 2520, 10750, 445, 7293, 87, 65940, 3071, 262, 1077, 737, 1819, 284, 2266, 13, 1004, 1819, 543,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_fs_repr_display() { assert_eq!( format!("{}", FsRepr([0xa296db59787359df, 0x8d3e33077430d318, 0xd1abf5c606102eb7, 0xcbc33ee28108f0])), "0x00cbc33ee28108f0d1abf5c606102eb78d3e33077430d318a296db59787359df".to_string() ); assert_eq!( format!("{}", FsRepr([0x14cb03535054a620, 0x312aa2bf2d1dff52, 0x970fe98746ab9361, 0xc1e18acf82711e6])), "0x0c1e18acf82711e6970fe98746ab9361312aa2bf2d1dff5214cb03535054a620".to_string() ); assert_eq!( format!("{}", FsRepr([0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff])), "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff".to_string() ); assert_eq!( format!("{}", FsRepr([0, 0, 0, 0])), "0x0000000000000000000000000000000000000000000000000000000000000000".to_string() ); }
rust_cleaned_test_functions.jsonl/95521
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 440 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 34470, 68535, 14825, 368, 341, 262, 2060, 10714, 33673, 286, 3561, 79878, 84619, 693, 649, 2561, 15, 9591, 17, 24, 21, 1999, 20, 24, 22, 23, 22, 18, 20, 24, 2940, 11, 220, 15, 87, 23, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bytes_written() { macro_rules! test1 { ( $( $n:expr ),* ) => { { $( let mut s = String::new(); let c = s.write_formatted(&$n, &Locale::en).unwrap(); assert_eq!(c, 5); )* } }; } test1!( 1_000u16, 1_000u32, 1_000usize, 1_000u64, 1_000u128, 1_000i16, 1_000i32, 1_000isize, 1_000i64, 1_000i128, NonZeroU16::new(1_000).unwrap(), NonZeroU32::new(1_000).unwrap(), NonZeroUsize::new(1_000).unwrap(), NonZeroU64::new(1_000).unwrap(), NonZeroU128::new(1_000).unwrap() ); macro_rules! test2 { ( $( $n:expr ),* ) => { { $( let mut s = String::new(); let format = CustomFormat::builder().separator(Some('𠜱')).build().unwrap(); let c = s.write_formatted(&$n, &format).unwrap(); assert_eq!(c, 8); )* } }; } test2!( 1_000u16, 1_000u32, 1_000usize, 1_000u64, 1_000u128, 1_000i16, 1_000i32, 1_000isize, 1_000i64, 1_000i128, NonZeroU16::new(1_000).unwrap(), NonZeroU32::new(1_000).unwrap(), NonZeroUsize::new(1_000).unwrap(), NonZeroU64::new(1_000).unwrap(), NonZeroU128::new(1_000).unwrap() ); }
rust_cleaned_test_functions.jsonl/88482
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 998 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6536, 12524, 72403, 368, 341, 262, 18072, 21407, 0, 1273, 16, 341, 286, 320, 4930, 400, 77, 96011, 6882, 9, 873, 589, 341, 310, 341, 394, 400, 1006, 503, 1077, 5206, 274, 284, 923, 486, 931, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_test_execvp() { assert_emscripten_output!( "../../emtests/test_execvp.wasm", "test_execvp", vec![], "../../emtests/test_execvp.out" ); }
rust_cleaned_test_functions.jsonl/26655
{ "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, 4452, 18430, 15260, 368, 341, 262, 2060, 22504, 2282, 268, 7645, 33673, 286, 10208, 336, 23841, 12697, 18430, 15260, 1418, 10530, 756, 286, 330, 1944, 18430, 15260, 756, 286, 7486, 20703, 1259, 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
#[test] fn test_hit() { let block = Rect { x: 0, y: 0, width: 10, height: 10, }; assert!(block.hit(1, 1)) }
rust_cleaned_test_functions.jsonl/79775
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 96 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37697, 368, 341, 262, 1077, 2504, 284, 11920, 341, 286, 856, 25, 220, 15, 345, 286, 379, 25, 220, 15, 345, 286, 2374, 25, 220, 16, 15, 345, 286, 2608, 25, 220, 16, 15, 345, 262, 2605, 262,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_sound_inheritance() { let parent = SoundBuilder::new(BaseBuilder::new()) .with_radius(1.0) .with_gain(2.0) .with_status(Status::Paused) .with_pitch(2.0) .with_playback_time(Duration::from_secs(2)) .with_looping(true) .with_play_once(true) .with_panning(0.1) .build_node(); let mut child = SoundBuilder::new(BaseBuilder::new()).build_sound(); child.inherit(&parent).unwrap(); let parent = parent.cast::<Sound>().unwrap(); check_inheritable_properties_equality(&child.base, &parent.base); check_inheritable_properties_equality(&child, parent); }
rust_cleaned_test_functions.jsonl/11303
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 359 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37676, 1243, 62443, 368, 341, 286, 1077, 2681, 284, 14594, 3297, 486, 931, 22225, 3297, 486, 931, 2398, 310, 659, 4197, 28936, 7, 16, 13, 15, 340, 310, 659, 4197, 39925, 7, 17, 13, 15, 340, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_error() { assert_eq!( rsix::io::Error::INVAL, rsix::io::Error::from_raw_os_error(rsix::io::Error::INVAL.raw_os_error()) ); assert_eq!(rsix::io::Error::INVAL.raw_os_error(), libc::EINVAL); }
rust_cleaned_test_functions.jsonl/71295
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 122 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4096, 368, 341, 262, 2060, 10714, 33673, 286, 10036, 941, 486, 815, 486, 1454, 486, 27842, 345, 286, 10036, 941, 486, 815, 486, 1454, 486, 1499, 16067, 29387, 4096, 17027, 941, 486, 815, 486, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_encoded_pointer_uleb128() { let encoding = constants::DwEhPe(constants::DW_EH_PE_absptr.0 | constants::DW_EH_PE_uleb128.0); let expected_rest = [1, 2, 3, 4]; let input = Section::with_endian(Endian::Little) .uleb(0x12_3456) .append_bytes(&expected_rest); let input = input.get_contents().unwrap(); let input = EndianSlice::new(&input, LittleEndian); let mut rest = input; let parameters = PointerEncodingParameters { bases: &SectionBaseAddresses::default(), func_base: None, address_size: 4, section: &input, }; assert_eq!( parse_encoded_pointer(encoding, &parameters, &mut rest), Ok(Pointer::Direct(0x12_3456)) ); assert_eq!(rest, EndianSlice::new(&expected_rest, LittleEndian)); }
rust_cleaned_test_functions.jsonl/9411
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 446 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 73069, 21425, 62, 1111, 65, 16, 17, 23, 368, 341, 286, 1077, 11170, 4035, 310, 18021, 486, 35, 86, 36, 71, 10197, 80368, 486, 54219, 2089, 39, 45784, 22885, 2154, 376, 13, 15, 760, 1802...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_asn() { let buffer = std::fs::read("./testdata/GeoLite2-ASN-Test.mmdb").unwrap(); let reader = Reader::<ASN>::from_bytes(&buffer).unwrap(); { let result = reader .lookup(IpAddr::from_str("1.128.0.0").unwrap()) .unwrap(); assert_eq!(result.autonomous_system_number, Some(1221)); assert_eq!( result.autonomous_system_organization, Some("Telstra Pty Ltd") ); } { let result = reader .lookup(IpAddr::from_str("2600:6000::").unwrap()) .unwrap(); assert_eq!(result.autonomous_system_number, Some(237)); assert_eq!( result.autonomous_system_organization, Some("Merit Network Inc.") ); } }
rust_cleaned_test_functions.jsonl/37387
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 494 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11898, 77, 368, 341, 286, 1077, 4147, 284, 1460, 486, 3848, 486, 878, 13988, 92425, 14, 37344, 43844, 17, 12, 68134, 12, 2271, 37008, 1999, 1827, 15454, 543, 286, 1077, 6604, 284, 25166, 27638, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_compatible_wpa3_mixed_rsne() { let mut a_rsne = make_rsne(Some(cipher::CCMP_128), vec![cipher::CCMP_128], vec![akm::SAE, akm::PSK]); a_rsne.rsn_capabilities = Some(RsnCapabilities(0).with_mgmt_frame_protection_cap(true)); assert_eq!(is_rsn_compatible(&a_rsne), true); assert_eq!(is_wpa3_rsn_compatible(&a_rsne), true); }
rust_cleaned_test_functions.jsonl/113750
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 199 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2965, 37079, 1670, 6595, 18, 717, 3286, 47115, 811, 368, 341, 286, 1077, 5206, 264, 47115, 811, 4035, 310, 1281, 47115, 811, 65405, 1337, 10558, 486, 3706, 5781, 62, 16, 17, 23, 701, 7486, 20703...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_hit_test() { use crate::math::point; use crate::path::Path; let mut builder = Path::builder(); builder.begin(point(0.0, 0.0)); builder.line_to(point(1.0, 0.0)); builder.line_to(point(1.0, 1.0)); builder.line_to(point(0.0, 1.0)); builder.end(true); builder.begin(point(0.25, 0.25)); builder.line_to(point(0.75, 0.25)); builder.line_to(point(0.75, 0.75)); builder.line_to(point(0.20, 0.75)); builder.end(true); let path = builder.build(); assert!(!hit_test_path( &point(-1.0, 0.5), path.iter(), FillRule::EvenOdd, 0.1 )); assert!(!hit_test_path( &point(2.0, 0.5), path.iter(), FillRule::EvenOdd, 0.1 )); println!( "winding {:?}", path_winding_number_at_position(&point(2.0, 0.0), path.iter(), 0.1) ); assert!(!hit_test_path( &point(2.0, 0.0), path.iter(), FillRule::EvenOdd, 0.1 )); assert!(!hit_test_path( &point(0.5, -1.0), path.iter(), FillRule::EvenOdd, 0.1 )); assert!(!hit_test_path( &point(0.5, 2.0), path.iter(), FillRule::EvenOdd, 0.1 )); assert!(!hit_test_path( &point(0.5, 0.5), path.iter(), FillRule::EvenOdd, 0.1 )); assert!(hit_test_path( &point(0.5, 0.5), path.iter(), FillRule::NonZero, 0.1 )); assert!(hit_test_path( &point(0.2, 0.5), path.iter(), FillRule::EvenOdd, 0.1 )); assert!(hit_test_path( &point(0.8, 0.5), path.iter(), FillRule::EvenOdd, 0.1 )); }
rust_cleaned_test_functions.jsonl/34465
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 987 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37697, 4452, 368, 341, 262, 990, 17717, 486, 10374, 486, 2768, 280, 262, 990, 17717, 486, 2343, 486, 1820, 401, 262, 1077, 5206, 7363, 284, 7933, 486, 17850, 543, 262, 7363, 6848, 20235, 7, 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_conversion() { let projstring = " proj=pipeline step proj=unitconvert xy_in=us-ft xy_out=m step inv proj=lcc lat_0=32.1666666666667 lon_0=-116.25 lat_1=33.8833333333333 lat_2=32.7833333333333 x_0=2000000.0001016 y_0=500000.0001016 ellps=GRS80 step proj=lcc lat_0=32.1666666666667 lon_0=-116.25 lat_1=33.8833333333333 lat_2=32.7833333333333 x_0=2000000 y_0=500000 ellps=GRS80 "; let nad83_m = Proj::new(projstring).unwrap(); println!("{:?}", nad83_m.def().unwrap()); let t = nad83_m .convert(MyPoint::new(4760096.421921, 3744293.729449)) .unwrap(); assert_relative_eq!(t.x(), 1450880.2910605022); assert_relative_eq!(t.y(), 1141263.0111604782); }
rust_cleaned_test_functions.jsonl/133385
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 482 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 64132, 368, 341, 1789, 286, 1077, 21333, 917, 284, 6228, 310, 21333, 17385, 8790, 3019, 21333, 28, 3843, 14166, 30784, 1243, 28, 355, 93624, 715, 310, 30784, 6068, 27221, 3019, 1529, 21333, 40627, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_basic_double_ops() -> Result<(), Error> { let mut info = Data::new(); info.apply(&create_numeric_property!(parent: ROOT_ID, id: 3, name: "value", value: Number::DoubleT(42.0)))?; assert!(info.apply(&add_number!(id: 3, value: Number::DoubleT(3.0))).is_ok()); assert!(info.to_string().contains("value: Double(45.0)")); assert!(info.apply(&add_number!(id: 3, value: Number::IntT(3))).is_err()); assert!(info.apply(&add_number!(id: 3, value: Number::UintT(3))).is_err()); assert!(info.to_string().contains("value: Double(45.0)")); assert!(info.apply(&subtract_number!(id: 3, value: Number::DoubleT(5.0))).is_ok()); assert!(info.to_string().contains("value: Double(40.0)")); assert!(info.apply(&subtract_number!(id: 3, value: Number::UintT(5))).is_err()); assert!(info.apply(&subtract_number!(id: 3, value: Number::UintT(5))).is_err()); assert!(info.to_string().contains("value: Double(40.0)")); assert!(info.apply(&set_number!(id: 3, value: Number::DoubleT(22.0))).is_ok()); assert!(info.to_string().contains("value: Double(22.0)")); assert!(info.apply(&set_number!(id: 3, value: Number::UintT(23))).is_err()); assert!(info.apply(&set_number!(id: 3, value: Number::UintT(24))).is_err()); assert!(info.to_string().contains("value: Double(22.0)")); Ok(()) }
rust_cleaned_test_functions.jsonl/10358
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 684 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 34729, 24598, 21959, 368, 1464, 5714, 68843, 4600, 29, 341, 286, 1077, 5206, 3546, 284, 2885, 486, 931, 543, 286, 3546, 13045, 2099, 3182, 29418, 16638, 10297, 3765, 25, 35736, 3450, 11, 877, 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_cb_called_on_success() { let result = call_callback(Ok(String::from("Heyahh"))).unwrap(); assert_eq!(ErrorCode::Success, result.0); assert_eq!(String::from("Heyahh"), result.1); }
rust_cleaned_test_functions.jsonl/12836
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 104 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16450, 27859, 4470, 18632, 368, 341, 286, 1077, 1102, 284, 1618, 12519, 7, 11578, 2242, 486, 1499, 445, 18665, 1466, 71, 2761, 568, 15454, 543, 286, 2060, 10714, 10297, 30748, 486, 7188, 11, 1102,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_scopes() { let request = parse(br#"{"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":12}"#); assert_match!( request, ProtocolMessage::Request(Request { command: Command::Known(RequestArguments::scopes(..)), .. }) ); let response = parse(br#"{"request_seq":12,"command":"scopes","body":{"scopes":[{"variablesReference":1001,"name":"Local","expensive":false},{"variablesReference":1002,"name":"Static","expensive":false},{"variablesReference":1003,"name":"Global","expensive":false},{"variablesReference":1004,"name":"Registers","expensive":false}]},"type":"response","success":true}"#); assert_match!( response, ProtocolMessage::Response(Response { body: Some(ResponseBody::scopes(..)), .. }) ); }
rust_cleaned_test_functions.jsonl/113326
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 397 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13171, 18523, 368, 341, 286, 1077, 1681, 284, 4715, 41237, 55543, 4913, 5631, 3252, 80925, 2198, 16370, 22317, 6763, 764, 788, 16, 15, 15, 15, 51193, 1313, 3252, 2035, 2198, 13262, 788, 16, 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_memory_full_cause_of_raft_message() { let mut cluster = new_server_cluster(0, 2); let pd_client = cluster.pd_client.clone(); cluster.pd_client.disable_default_operator(); let r1 = cluster.run_conf_change(); cluster.must_put(b"k1", b"v1"); pd_client.must_add_peer(r1, new_learner_peer(2, 2)); must_get_equal(&cluster.get_engine(2), b"k1", b"v1"); cluster.must_transfer_leader(1, new_peer(1, 1)); let append_to_2 = Arc::new(AtomicUsize::new(0)); let append_to_2_ = append_to_2.clone(); cluster.add_send_filter(CloneFilterFactory( RegionPacketFilter::new(r1, 2) .direction(Direction::Recv) .msg_type(MessageType::MsgAppend) .allow(usize::MAX) .set_msg_callback(Arc::new(move |_m| { append_to_2_.fetch_add(1, Ordering::SeqCst); })), )); let response_to_1 = Arc::new(AtomicUsize::new(0)); let response_to_1_ = response_to_1.clone(); cluster.add_send_filter(CloneFilterFactory( RegionPacketFilter::new(r1, 1) .direction(Direction::Recv) .msg_type(MessageType::MsgUnreachable) .allow(usize::MAX) .set_msg_callback(Arc::new(move |_m| { response_to_1_.fetch_add(1, Ordering::SeqCst); })), )); // A MsgHeartbeatResponse will trigger one MsgAppend. fail::cfg("needs_reject_raft_append", "return").unwrap(); (0..10).for_each(|_| cluster.must_put(b"k1", b"v1")); let now = Instant::now(); while now.elapsed() < Duration::from_secs(2) { sleep_ms(100); let appends = append_to_2.load(Ordering::SeqCst); if appends < 10 { continue; } let responses = response_to_1.load(Ordering::SeqCst); if responses < 10 { continue; } fail::cfg("needs_delay_raft_append", "off").unwrap(); return; } panic!("must have 10 MsgAppend and 10 MsgUnreachable"); }
rust_cleaned_test_functions.jsonl/29349
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 973 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19195, 16372, 666, 3454, 3575, 62, 2944, 6462, 368, 341, 262, 1077, 5206, 10652, 284, 501, 12015, 28441, 7, 15, 11, 220, 17, 317, 262, 1077, 7744, 8179, 284, 10652, 556, 67, 8179, 15997, 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...
4
#[test] fn test_eval_def_cfa_expression() { let expr = [1, 2, 3, 4]; let cie = make_test_cie(); let ctx = UnwindContext::new(); let mut expected = ctx.clone(); expected.set_cfa(CfaRule::Expression(Expression(EndianSlice::new( &expr, LittleEndian, )))); let instructions = [( Ok(false), CallFrameInstruction::DefCfaExpression { expression: Expression(EndianSlice::new(&expr, LittleEndian)), }, )]; assert_eval(ctx, expected, cie, None, instructions); }
rust_cleaned_test_functions.jsonl/9353
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 306 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21296, 7844, 666, 3632, 28068, 368, 341, 286, 1077, 15169, 284, 508, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 935, 286, 1077, 272, 645, 284, 1281, 4452, 666, 645, 543, 286, 1077, 5635, 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_from_structured() { let record = Record { timestamp: 72, severity: StreamSeverity::Error, arguments: vec![ Argument { name: "arg1".to_string(), value: Value::SignedInt(-23) }, Argument { name: PID_LABEL.to_string(), value: Value::UnsignedInt(43) }, Argument { name: TID_LABEL.to_string(), value: Value::UnsignedInt(912) }, Argument { name: DROPPED_LABEL.to_string(), value: Value::UnsignedInt(2) }, Argument { name: TAG_LABEL.to_string(), value: Value::Text("tag".to_string()) }, Argument { name: MESSAGE_LABEL.to_string(), value: Value::Text("msg".to_string()) }, ], }; let mut buffer = Cursor::new(vec![0u8; MAX_DATAGRAM_LEN]); let mut encoder = Encoder::new(&mut buffer); encoder.write_record(&record).unwrap(); let encoded = &buffer.get_ref().as_slice()[..buffer.position() as usize]; let parsed = Message::from_structured(encoded).unwrap(); assert_eq!( parsed, Message::new( zx::Time::from_nanos(72), Severity::Error, encoded.len(), PLACEHOLDER_MONIKER, PLACEHOLDER_URL, LogsHierarchy::new( "root", vec![ LogsProperty::Int(LogsField::Other("arg1".to_string()), -23), LogsProperty::Uint(LogsField::ProcessId, 43), LogsProperty::Uint(LogsField::ThreadId, 912), LogsProperty::Uint(LogsField::Dropped, 2), LogsProperty::String(LogsField::Tag, "tag".to_string()), LogsProperty::String(LogsField::Msg, "msg".to_string()), ], vec![], ) ) ); assert_eq!( parsed.for_listener(), LogMessage { severity: LegacySeverity::Error.for_listener(), time: 72, dropped_logs: 2, pid: 43, tid: 912, msg: "msg arg1=-23".into(), tags: vec!["tag".into()] } ); // multiple tags let record = Record { timestamp: 72, severity: StreamSeverity::Error, arguments: vec![ Argument { name: TAG_LABEL.to_string(), value: Value::Text("tag1".to_string()) }, Argument { name: TAG_LABEL.to_string(), value: Value::Text("tag2".to_string()) }, Argument { name: TAG_LABEL.to_string(), value: Value::Text("tag3".to_string()) }, ], }; let mut buffer = Cursor::new(vec![0u8; MAX_DATAGRAM_LEN]); let mut encoder = Encoder::new(&mut buffer); encoder.write_record(&record).unwrap(); let encoded = &buffer.get_ref().as_slice()[..buffer.position() as usize]; let parsed = Message::from_structured(encoded).unwrap(); assert_eq!( parsed, Message::new( zx::Time::from_nanos(72), Severity::Error, encoded.len(), PLACEHOLDER_MONIKER, PLACEHOLDER_URL, LogsHierarchy::new( "root", vec![ LogsProperty::String(LogsField::Tag, "tag1".to_string()), LogsProperty::String(LogsField::Tag, "tag2".to_string()), LogsProperty::String(LogsField::Tag, "tag3".to_string()), ], vec![], ) ) ); // empty record let record = Record { timestamp: 72, severity: StreamSeverity::Error, arguments: vec![] }; let mut buffer = Cursor::new(vec![0u8; MAX_DATAGRAM_LEN]); let mut encoder = Encoder::new(&mut buffer); encoder.write_record(&record).unwrap(); let encoded = &buffer.get_ref().as_slice()[..buffer.position() as usize]; let parsed = Message::from_structured(encoded).unwrap(); assert_eq!( parsed, Message::new( zx::Time::from_nanos(72), Severity::Error, encoded.len(), PLACEHOLDER_MONIKER, PLACEHOLDER_URL, LogsHierarchy::new("root", vec![], vec![],) ) ); // parse error assert!(matches!( Message::from_structured(&vec![]).unwrap_err(), StreamError::ParseError { .. } )); }
rust_cleaned_test_functions.jsonl/67974
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2592 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 15126, 3073, 368, 341, 286, 1077, 3255, 284, 13583, 341, 310, 11441, 25, 220, 22, 17, 345, 310, 29920, 25, 9203, 65594, 486, 1454, 345, 310, 5977, 25, 7486, 90515, 394, 13818, 314, 829, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_char_at_reverse() { let s = "ศไทย中华Việt Nam"; let v = vec!['ศ','ไ','ท','ย','中','华','V','i','ệ','t',' ','N','a','m']; let mut pos = s.len(); for ch in v.iter().rev() { assert!(s.char_at_reverse(pos) == *ch); pos -= ch.to_string().len(); } }
rust_cleaned_test_functions.jsonl/2459
{ "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, 9232, 3752, 43277, 368, 341, 286, 1077, 274, 284, 330, 123863, 125451, 100849, 35544, 124382, 29974, 876, 286, 1077, 348, 284, 7486, 0, 677, 123863, 1844, 49756, 1844, 35884, 1844, 34509, 1844, 1594...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_clean_multiple_zero_lamport_decrements_index_ref_count() { solana_logger::setup(); let accounts = AccountsDb::new(Vec::new(), &ClusterType::Development); let pubkey1 = solana_sdk::pubkey::new_rand(); let pubkey2 = solana_sdk::pubkey::new_rand(); let zero_lamport_account = AccountSharedData::new(0, 0, AccountSharedData::default().owner()); accounts.store_uncached(0, &[(&pubkey1, &zero_lamport_account)]); accounts.store_uncached(0, &[(&pubkey2, &zero_lamport_account)]); accounts.store_uncached(1, &[(&pubkey1, &zero_lamport_account)]); accounts.store_uncached(2, &[(&pubkey1, &zero_lamport_account)]); // Root all slots accounts.add_root(0); accounts.add_root(1); accounts.add_root(2); // Account ref counts should match how many slots they were stored in // Account 1 = 3 slots; account 2 = 1 slot assert_eq!(accounts.accounts_index.ref_count_from_storage(&pubkey1), 3); assert_eq!(accounts.accounts_index.ref_count_from_storage(&pubkey2), 1); accounts.clean_accounts(None, false, None); // Slots 0 and 1 should each have been cleaned because all of their // accounts are zero lamports assert!(accounts.storage.get_slot_stores(0).is_none()); assert!(accounts.storage.get_slot_stores(1).is_none()); // should exclude slot 2 from the clean due to changes in other slots assert!(accounts.storage.get_slot_stores(2).is_some()); // Index ref counts should be consistent with the slot stores. Account 1 ref count // should be 1 since slot 2 is the only alive slot; account 2 should have a ref // count of 0 due to slot 0 being dead assert_eq!(accounts.accounts_index.ref_count_from_storage(&pubkey1), 1); assert_eq!(accounts.accounts_index.ref_count_from_storage(&pubkey2), 0); accounts.clean_accounts(None, false, None); assert!(accounts.storage.get_slot_stores(2).is_none()); assert_eq!(accounts.accounts_index.ref_count_from_storage(&pubkey1), 0); }
rust_cleaned_test_functions.jsonl/6964
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 900 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19573, 45233, 19359, 907, 309, 403, 2259, 837, 1368, 3560, 7793, 3180, 368, 341, 286, 2048, 3362, 27413, 486, 15188, 1428, 286, 1077, 9618, 284, 40655, 7994, 486, 931, 49923, 486, 931, 1507, 609, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_collect_expr() -> Result<()> { let mut accum: HashSet<String> = HashSet::new(); expr_to_column_names( &Expr::Cast { expr: Box::new(col("a")), data_type: DataType::Float64, }, &mut accum, )?; expr_to_column_names( &Expr::Cast { expr: Box::new(col("a")), data_type: DataType::Float64, }, &mut accum, )?; assert_eq!(1, accum.len()); assert!(accum.contains("a")); Ok(()) }
rust_cleaned_test_functions.jsonl/33212
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 356 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 68140, 21915, 368, 1464, 5714, 71698, 341, 286, 1077, 5206, 15421, 25, 18931, 3464, 29, 284, 18931, 486, 931, 543, 286, 15169, 2346, 8744, 9187, 1006, 310, 609, 16041, 486, 18714, 341, 394, 15169,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_cast() { let b = bson!(u64::MAX); assert_eq!(b.cast_i64(), -1); let b = bson!(100u64); assert_eq!(b.cast_i64(), 100i64); }
rust_cleaned_test_functions.jsonl/86737
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 108 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5303, 368, 341, 286, 1077, 293, 284, 50980, 10297, 84, 21, 19, 486, 10586, 317, 286, 2060, 10714, 10297, 65, 35091, 5318, 21, 19, 1507, 481, 16, 317, 286, 1077, 293, 284, 50980, 10297, 16, 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_components_radio() { // Make component let mut component = Radio::default() .background(Color::Blue) .foreground(Color::Red) .borders(Borders::default()) .title("C'est oui ou bien c'est non?", Alignment::Center) .choices(&["Oui!", "Non", "Peut-être"]) .value(1) .rewind(false); // Verify states assert_eq!(component.states.choice, 1); assert_eq!(component.states.choices.len(), 3); component.attr( Attribute::Value, AttrValue::Payload(PropPayload::One(PropValue::Usize(2))), ); assert_eq!(component.state(), State::One(StateValue::Usize(2))); // Get value component.states.choice = 1; assert_eq!(component.state(), State::One(StateValue::Usize(1))); // Handle events assert_eq!( component.perform(Cmd::Move(Direction::Left)), CmdResult::Changed(State::One(StateValue::Usize(0))), ); assert_eq!(component.state(), State::One(StateValue::Usize(0))); // Left again assert_eq!( component.perform(Cmd::Move(Direction::Left)), CmdResult::Changed(State::One(StateValue::Usize(0))), ); assert_eq!(component.state(), State::One(StateValue::Usize(0))); // Right assert_eq!( component.perform(Cmd::Move(Direction::Right)), CmdResult::Changed(State::One(StateValue::Usize(1))), ); assert_eq!(component.state(), State::One(StateValue::Usize(1))); // Right again assert_eq!( component.perform(Cmd::Move(Direction::Right)), CmdResult::Changed(State::One(StateValue::Usize(2))), ); assert_eq!(component.state(), State::One(StateValue::Usize(2))); // Right again assert_eq!( component.perform(Cmd::Move(Direction::Right)), CmdResult::Changed(State::One(StateValue::Usize(2))), ); assert_eq!(component.state(), State::One(StateValue::Usize(2))); // Submit assert_eq!( component.perform(Cmd::Submit), CmdResult::Submit(State::One(StateValue::Usize(2))), ); }
rust_cleaned_test_functions.jsonl/101080
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1110 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 23258, 49740, 368, 341, 286, 442, 7405, 3692, 198, 286, 1077, 5206, 3692, 284, 13484, 486, 2258, 741, 310, 659, 6742, 15028, 486, 10331, 340, 310, 659, 34919, 15028, 486, 6033, 340, 310, 659, 65...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_stale_resolver() { let mut suite = TestSuite::new(3); let fp = "before_schedule_resolver_ready"; fail::cfg(fp, "pause").unwrap(); // Close previous connection and open a new one twice time let region = suite.cluster.get_region(&[]); let mut req = ChangeDataRequest::default(); req.region_id = region.get_id(); req.set_region_epoch(region.get_region_epoch().clone()); let (req_tx, event_feed_wrap, receive_event) = new_event_feed(suite.get_region_cdc_client(region.get_id())); let _req_tx = req_tx .send((req.clone(), WriteFlags::default())) .wait() .unwrap(); // Sleep for a while to wait the scan is done sleep_ms(200); let (k, v) = ("key1".to_owned(), "value".to_owned()); // Prewrite let start_ts = block_on(suite.cluster.pd_client.get_tso()).unwrap(); let mut mutation = Mutation::default(); mutation.set_op(Op::Put); mutation.key = k.clone().into_bytes(); mutation.value = v.into_bytes(); suite.must_kv_prewrite( region.get_id(), vec![mutation], k.clone().into_bytes(), start_ts, ); // Block next scan let fp1 = "cdc_incremental_scan_start"; fail::cfg(fp1, "pause").unwrap(); // Close previous connection and open two new connections let (req_tx, resp_rx) = suite .get_region_cdc_client(region.get_id()) .event_feed() .unwrap(); event_feed_wrap.as_ref().replace(Some(resp_rx)); let _req_tx = req_tx .send((req.clone(), WriteFlags::default())) .wait() .unwrap(); let (req_tx1, resp_rx1) = suite .get_region_cdc_client(region.get_id()) .event_feed() .unwrap(); let _req_tx1 = req_tx1.send((req, WriteFlags::default())).wait().unwrap(); // Unblock the first scan fail::remove(fp); // Sleep for a while to wait the wrong resolver init sleep_ms(100); // Async commit let commit_ts = block_on(suite.cluster.pd_client.get_tso()).unwrap(); let commit_resp = suite.async_kv_commit(region.get_id(), vec![k.into_bytes()], start_ts, commit_ts); // Receive Commit response commit_resp.wait().unwrap(); // Unblock all scans fail::remove(fp1); // Receive events let mut events = receive_event(false); while events.len() < 2 { events.extend(receive_event(false).into_iter()); } assert_eq!(events.len(), 2); for event in events { match event.event.unwrap() { Event_oneof_event::Entries(es) => match es.entries.len() { 1 => { assert_eq!(es.entries[0].get_type(), EventLogType::Commit, "{:?}", es); } 2 => { let e = &es.entries[0]; assert_eq!(e.get_type(), EventLogType::Prewrite, "{:?}", es); let e = &es.entries[1]; assert_eq!(e.get_type(), EventLogType::Initialized, "{:?}", es); } _ => panic!("{:?}", es), }, Event_oneof_event::Error(e) => panic!("{:?}", e), _ => panic!("unknown event"), } } event_feed_wrap.as_ref().replace(Some(resp_rx1)); // Receive events for _ in 0..2 { let mut events = receive_event(false); match events.pop().unwrap().event.unwrap() { Event_oneof_event::Entries(es) => match es.entries.len() { 1 => { let e = &es.entries[0]; assert_eq!(e.get_type(), EventLogType::Commit, "{:?}", es); } 2 => { let e = &es.entries[0]; assert_eq!(e.get_type(), EventLogType::Prewrite, "{:?}", es); let e = &es.entries[1]; assert_eq!(e.get_type(), EventLogType::Initialized, "{:?}", es); } _ => { panic!("unexepected event length {:?}", es); } }, Event_oneof_event::Error(e) => panic!("{:?}", e), _ => panic!("unknown event"), } } event_feed_wrap.as_ref().replace(None); suite.stop(); }
rust_cleaned_test_functions.jsonl/47405
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2089 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 1261, 1574, 91578, 368, 341, 262, 1077, 5206, 16182, 284, 3393, 28000, 486, 931, 7, 18, 626, 262, 1077, 12007, 284, 330, 14801, 34530, 91578, 35456, 876, 262, 3690, 486, 14072, 17815, 11, 330, 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...
8
#[test] fn test_align() { assert_eq!(align(0b1111, 1), 0b1111); assert_eq!(align(0b1111, 2), 0b1110); assert_eq!(align(0b1111, 4), 0b1100); }
rust_cleaned_test_functions.jsonl/50746
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 98 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37015, 368, 341, 286, 2060, 10714, 10297, 6612, 7, 15, 65, 16, 16, 16, 16, 11, 220, 16, 701, 220, 15, 65, 16, 16, 16, 16, 317, 286, 2060, 10714, 10297, 6612, 7, 15, 65, 16, 16, 16, 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_from_string_m() { let d: Duration = DurationString::try_from(String::from("1m")).unwrap().into(); assert_eq!(d, Duration::from_secs(60)); }
rust_cleaned_test_functions.jsonl/97547
{ "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, 5673, 3904, 717, 368, 341, 286, 1077, 294, 25, 21045, 284, 21045, 703, 486, 1539, 5673, 2242, 486, 1499, 445, 16, 76, 15197, 15454, 1005, 18122, 543, 286, 2060, 10714, 10297, 67, 11, 21045, 486,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_integer() { assert_eq!( Variant::VSingle(5.1).divide(Variant::VInteger(2)).unwrap(), Variant::VSingle(2.55) ); }
rust_cleaned_test_functions.jsonl/84607
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 140 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31725, 368, 341, 394, 2060, 10714, 33673, 503, 39292, 486, 53, 10888, 7, 20, 13, 16, 568, 59394, 12410, 15341, 486, 53, 3486, 7, 17, 4579, 15454, 3148, 503, 39292, 486, 53, 10888, 7, 17, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_distinct_with_subquery() { let expected_sql = "SELECT DISTINCT (SELECT $1 FROM \"test2\"), \"bar\" FROM \"test\""; let query = Select::from_table("test") .value(Select::from_table("test2").value(val!(1))) .column(Column::new("bar")) .distinct(); let (sql, _) = Postgres::build(query).unwrap(); assert_eq!(expected_sql, sql); }
rust_cleaned_test_functions.jsonl/6449
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 196 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16031, 7800, 6615, 5228, 1631, 368, 341, 286, 1077, 3601, 18063, 284, 330, 4858, 59086, 320, 4858, 400, 16, 4295, 7245, 1944, 17, 2105, 701, 7245, 2257, 2105, 4295, 7245, 1944, 95349, 286, 1077, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_vertical_filter_with_kernel_taller_than_image_does_not_panic() { let image = gray_image!( 1, 4, 1; 4, 7, 4; 1, 4, 1); let kernel = vec![1f32 / 10f32; 10]; black_box(vertical_filter(&image, &kernel)); }
rust_cleaned_test_functions.jsonl/35607
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 158 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 61203, 8727, 6615, 26876, 528, 13956, 51613, 4954, 96374, 7913, 620, 31270, 368, 341, 286, 1077, 2168, 284, 17545, 4954, 33673, 310, 220, 16, 11, 220, 19, 11, 220, 16, 280, 310, 220, 19, 11, 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_banking_stage_entries_only() { solana_logger::setup(); let GenesisBlockInfo { genesis_block, mint_keypair, .. } = create_genesis_block(10); let bank = Arc::new(Bank::new(&genesis_block)); let start_hash = bank.last_blockhash(); let (verified_sender, verified_receiver) = unbounded(); let (vote_sender, vote_receiver) = unbounded(); let ledger_path = get_tmp_ledger_path!(); { let blocktree = Arc::new( Blocktree::open(&ledger_path).expect("Expected to be able to open database ledger"), ); let mut poh_config = PohConfig::default(); poh_config.target_tick_count = Some(bank.max_tick_height() - 1); let (exit, poh_recorder, poh_service, entry_receiver) = create_test_recorder(&bank, &blocktree, Some(poh_config)); let cluster_info = ClusterInfo::new_with_invalid_keypair(Node::new_localhost().info); let cluster_info = Arc::new(RwLock::new(cluster_info)); let banking_stage = BankingStage::new( &cluster_info, &poh_recorder, verified_receiver, vote_receiver, ); // fund another account so we can send 2 good transactions in a single batch. let keypair = Keypair::new(); let fund_tx = system_transaction::transfer(&mint_keypair, &keypair.pubkey(), 2, start_hash); bank.process_transaction(&fund_tx).unwrap(); // good tx let to = Pubkey::new_rand(); let tx = system_transaction::transfer(&mint_keypair, &to, 1, start_hash); let to2 = Pubkey::new_rand(); let tx_no_ver = system_transaction::transfer(&keypair, &to2, 2, start_hash); let keypair = Keypair::new(); let to3 = Pubkey::new_rand(); let tx_anf = system_transaction::transfer(&keypair, &to3, 1, start_hash); // send 'em over let packets = to_packets(&[tx_no_ver, tx_anf, tx]); // glad they all fit assert_eq!(packets.len(), 1); let packets = packets .into_iter() .map(|packets| (packets, vec![0u8, 1u8, 1u8])) .collect(); let packets = convert_from_old_verified(packets); verified_sender .send(packets) .unwrap(); drop(verified_sender); drop(vote_sender); // wait until banking_stage to finish up all packets banking_stage.join().unwrap(); exit.store(true, Ordering::Relaxed); poh_service.join().unwrap(); drop(poh_recorder); let mut blockhash = start_hash; let bank = Bank::new(&genesis_block); bank.process_transaction(&fund_tx).unwrap(); //receive entries + ticks loop { let entries: Vec<Entry> = entry_receiver .iter() .map(|(_bank, (entry, _tick_height))| entry) .collect(); assert!(entries.verify(&blockhash)); if !entries.is_empty() { blockhash = entries.last().unwrap().hash; for entry in entries { bank.process_transactions(&entry.transactions) .iter() .for_each(|x| assert_eq!(*x, Ok(()))); } } if bank.get_balance(&to) == 1 { break; } sleep(Duration::from_millis(200)); } assert_eq!(bank.get_balance(&to), 1); assert_eq!(bank.get_balance(&to2), 0); drop(entry_receiver); } Blocktree::destroy(&ledger_path).unwrap(); }
rust_cleaned_test_functions.jsonl/58828
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2146 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 32334, 35238, 26092, 18410, 368, 341, 286, 2048, 3362, 27413, 486, 15188, 543, 286, 1077, 40788, 4713, 1731, 341, 310, 59366, 7113, 345, 310, 28337, 3097, 12670, 345, 310, 54538, 286, 335, 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...
4
#[test] fn test_sync_channel() { let c = MainContext::new(); let l = MainLoop::new(Some(&c), false); c.acquire(); let (sender, receiver) = MainContext::sync_channel(Priority::default(), 2); let sum = Rc::new(RefCell::new(0)); let sum_clone = sum.clone(); let l_clone = l.clone(); receiver.attach(Some(&c), move |item| { *sum_clone.borrow_mut() += item; if *sum_clone.borrow() == 6 { l_clone.quit(); Continue(false) } else { Continue(true) } }); let (wait_sender, wait_receiver) = mpsc::channel(); let thread = thread::spawn(move || { // The first two must succeed sender.try_send(1).unwrap(); sender.try_send(2).unwrap(); // This fills up the channel assert!(sender.try_send(3).is_err()); wait_sender.send(()).unwrap(); // This will block sender.send(3).unwrap(); }); // 50ms to make sure the sender is blocked now and // can wake up properly once an item was consumed assert!(wait_receiver.recv().is_ok()); thread::sleep(time::Duration::from_millis(50)); l.run(); thread.join().unwrap(); assert_eq!(*sum.borrow(), 6); }
rust_cleaned_test_functions.jsonl/5023
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 695 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 23008, 14571, 368, 341, 286, 1077, 272, 284, 4697, 1972, 486, 931, 543, 286, 1077, 326, 284, 4697, 14620, 486, 931, 65405, 2099, 66, 701, 895, 626, 286, 272, 69627, 1428, 286, 1077, 320, 11644, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_mtu() { // ser is a Serializer that will consume 1 byte of buffer space fn test<S: Serializer + Clone>(ser: S) { // Each of these tests encapsulates ser in a DummyPacketBuilder. // Test that an MTU of 3 is OK. assert!(ser.clone().encapsulate(DummyPacketBuilder).serialize_mtu_outer(3).is_ok()); // Test that the inner MTU of 1 only applies to the inner // consumes 3 bytes total. assert!(ser .clone() .with_mtu(1) .encapsulate(DummyPacketBuilder) .serialize_mtu_outer(3) .is_ok()); // Test that the inner MTU of 0 is exceeded by the inner // serializer's 1 byte length. assert!(ser .clone() .with_mtu(0) .encapsulate(DummyPacketBuilder) .serialize_outer() .is_err()); // Test that an MTU which would be exceeded by the encapsulating // layer is rejected by EncapsulatingSerializer's implementation. If // resulting in a panic (see the EncapsulatingSerializer assert!(ser.clone().encapsulate(DummyPacketBuilder).serialize_mtu_outer(1).is_err()); } test(DummyPacketBuilder); test(InnerSerializer::new_vec(DummyPacketBuilder, Buf::new(vec![], ..))); test(FnSerializer::new_vec(DummyPacketBuilder)); test(BufferSerializer::new_vec(Buf::new(vec![0], ..))); }
rust_cleaned_test_functions.jsonl/83355
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 818 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 717, 24494, 368, 341, 286, 442, 1420, 374, 264, 58822, 429, 686, 24057, 220, 16, 4922, 315, 4147, 3550, 198, 286, 5168, 1273, 18858, 25, 58822, 488, 27913, 2235, 799, 25, 328, 8, 341, 310, 442...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_cancel_push_frame_on_request_stream() { test_wrong_frame_on_request_stream(&[0x3, 0x1, 0x5], Error::WrongStream); }
rust_cleaned_test_functions.jsonl/10927
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 72 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28895, 14218, 8929, 4470, 7893, 12673, 368, 341, 286, 1273, 75198, 8929, 4470, 7893, 12673, 2099, 58, 15, 87, 18, 11, 220, 15, 87, 16, 11, 220, 15, 87, 20, 1125, 4600, 486, 29185, 3027, 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
#[test] fn test_rpc_getnewaddress() { let client = TestClient::default(); client.requests().expect(vec![ request! { method: "getnewaddress", params: ["maintain"], response: "mmoXxKhAwnhtFiAMvxJ82CKCBia751mzfY" }, ]); let addr = client.getnewaddress("maintain").unwrap(); assert_eq!(addr, "mmoXxKhAwnhtFiAMvxJ82CKCBia751mzfY"); }
rust_cleaned_test_functions.jsonl/82253
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 208 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 60799, 3062, 931, 4995, 368, 341, 262, 1077, 2943, 284, 3393, 2959, 486, 2258, 543, 262, 2943, 67671, 1005, 17119, 25592, 90515, 286, 1681, 0, 341, 310, 1714, 25, 330, 455, 931, 4995, 756, 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