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_json_extract() { let cases: Vec<(Vec<ScalarValue>, _)> = vec![ (vec![None::<Json>.into(), None::<Bytes>.into()], None), ( vec![ Some(Json::from_str("[10, 20, [30, 40]]").unwrap()).into(), Some(b"$[1]".to_vec()).into(), ], Some("20"), ), ( vec![ Some(Json::from_str("[10, 20, [30, 40]]").unwrap()).into(), Some(b"$[1]".to_vec()).into(), Some(b"$[0]".to_vec()).into(), ], Some("[20, 10]"), ), ( vec![ Some(Json::from_str("[10, 20, [30, 40]]").unwrap()).into(), Some(b"$[2][*]".to_vec()).into(), ], Some("[30, 40]"), ), ( vec![ Some(Json::from_str("[10, 20, [30, 40]]").unwrap()).into(), Some(b"$[2][*]".to_vec()).into(), None::<Bytes>.into(), ], None, ), ]; for (vargs, expected) in cases { let expected = expected.map(|s| Json::from_str(s).unwrap()); let output = RpnFnScalarEvaluator::new() .push_params(vargs.clone()) .evaluate(ScalarFuncSig::JsonExtractSig) .unwrap(); assert_eq!(output, expected, "{:?}", vargs); } }
rust_cleaned_test_functions.jsonl/60599
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1025 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9455, 39123, 368, 341, 286, 1077, 5048, 25, 11312, 28706, 10050, 78505, 1130, 8066, 716, 16018, 284, 7486, 90515, 310, 320, 4083, 20703, 4064, 27638, 5014, 14276, 18122, 1507, 2240, 27638, 7078, 142...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_locate_data() { warn!( "Note: test data can be obtained from the akaze-test-data repository See README.md" ); let test_data_path = locate_test_data(); let mut image_file_path = test_data_path; image_file_path.push("1.jpg"); let metadata = ::std::fs::metadata(image_file_path).unwrap(); debug_assert!(metadata.is_file()); let test_data_path = locate_test_data(); let mut image_file_path = test_data_path; image_file_path.push("2.jpg"); let metadata = ::std::fs::metadata(image_file_path).unwrap(); debug_assert!(metadata.is_file()); }
rust_cleaned_test_functions.jsonl/73614
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 251 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13400, 349, 1769, 368, 341, 262, 8809, 33673, 286, 330, 9112, 25, 1273, 821, 646, 387, 12180, 504, 279, 17324, 9832, 16839, 13945, 198, 286, 12542, 3496, 61945, 21324, 698, 262, 1439, 262, 1077, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_invalid_binary_operands() { check_error("1 + \"string\";", &|err: &str| { assert!(err.starts_with("invalid operands in binary operator")) }) }
rust_cleaned_test_functions.jsonl/111836
{ "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, 31433, 31761, 25634, 2844, 368, 341, 286, 1779, 4096, 445, 16, 488, 7245, 917, 2105, 32503, 609, 91, 615, 25, 609, 495, 91, 341, 310, 2060, 10297, 615, 4962, 82, 6615, 445, 11808, 54510, 304, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_xor() { assert_eq!( xor( "1c0111001f010100061a024b53535009181c", "686974207468652062756c6c277320657965" ), "746865206b696420646f6e277420706c6179" ) }
rust_cleaned_test_functions.jsonl/119096
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 179 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 76462, 368, 341, 286, 2060, 10714, 33673, 310, 53941, 1006, 394, 330, 16, 66, 15, 16, 16, 16, 15, 15, 16, 69, 15, 16, 15, 16, 15, 15, 15, 21, 16, 64, 15, 17, 19, 65, 20, 18, 20, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_field_auth_status_user_created() { let mut context_builder = ContextBuilder::new(); let conn = context_builder.db_conn(); let user = UserFactory::default().username("user1").insert(conn); let user_provider = UserProviderFactory::default() .user(Some(&user)) .insert(conn); context_builder.set_user_provider(user_provider); let runner = QueryRunner::new(context_builder); assert_eq!( runner.query(QUERY, hashmap! {}), ( json!({ "authStatus": { "authenticated": true, "userCreated": true, "user": { "id": user.id.to_string(), "username": "user1", }, } }), vec![] ) ); }
rust_cleaned_test_functions.jsonl/129724
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 460 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5013, 14014, 4773, 3317, 27288, 368, 341, 262, 1077, 5206, 2266, 28532, 284, 9608, 3297, 486, 931, 543, 262, 1077, 4534, 284, 2266, 28532, 7076, 17241, 1428, 262, 1077, 1196, 284, 2657, 4153, 486,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_prime_meridian() { assert_relative_eq!(super::hour_angle(0., -22.97753), 90.9018, epsilon = 0.00001) }
rust_cleaned_test_functions.jsonl/31611
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 68 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 38217, 717, 261, 35642, 368, 341, 286, 2060, 29286, 10714, 10297, 9522, 486, 24677, 21727, 7, 15, 2572, 481, 17, 17, 13, 24, 22, 22, 20, 18, 701, 220, 24, 15, 13, 24, 15, 16, 23, 11, 31204...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_builder_non_field() { let s = SchemaBuilder::new() .non_null_field("the_influx_field", ArrowDataType::Float64) // can't represent with lp .non_null_field("the_no_influx_field", ArrowDataType::Decimal(10, 0)) .build() .unwrap(); let (influxdb_column_type, field) = s.field(0); assert_eq!(field.name(), "the_influx_field"); assert_eq!(field.data_type(), &ArrowDataType::Float64); assert!(!field.is_nullable()); assert_eq!(influxdb_column_type, Some(Field(Float))); let (influxdb_column_type, field) = s.field(1); assert_eq!(field.name(), "the_no_influx_field"); assert_eq!(field.data_type(), &ArrowDataType::Decimal(10, 0)); assert!(!field.is_nullable()); assert_eq!(influxdb_column_type, None); assert_eq!(s.len(), 2); }
rust_cleaned_test_functions.jsonl/12635
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 439 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28532, 21637, 5013, 368, 341, 286, 1077, 274, 284, 12539, 3297, 486, 931, 741, 310, 659, 6280, 15162, 5013, 445, 1782, 1243, 36706, 5013, 497, 33712, 22653, 486, 5442, 21, 19, 340, 310, 442, 646...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_server_encode_connect_method() { let mut head = MessageHead::default(); let mut vec = Vec::new(); let encoder = Server::encode( Encode { head: &mut head, body: None, keep_alive: true, req_method: &mut Some(Method::CONNECT), title_case_headers: false, }, &mut vec, ) .unwrap(); assert!(encoder.is_last()); }
rust_cleaned_test_functions.jsonl/7670
{ "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, 12015, 11224, 15720, 9032, 368, 341, 286, 1077, 5206, 1968, 284, 4856, 12346, 486, 2258, 1428, 286, 1077, 5206, 7486, 284, 11312, 486, 931, 543, 286, 1077, 23668, 284, 8422, 486, 6180, 1006, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_read_write_pubkey() -> Result<(), Box<dyn error::Error>> { let filename = "test_pubkey.json"; let pubkey = Pubkey::new_rand(); write_pubkey_file(filename, pubkey)?; let read = read_pubkey_file(filename)?; assert_eq!(read, pubkey); remove_file(filename)?; Ok(()) }
rust_cleaned_test_functions.jsonl/87856
{ "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, 6443, 9165, 34014, 792, 368, 1464, 5714, 68843, 8261, 92846, 1465, 486, 1454, 2452, 341, 286, 1077, 3899, 284, 330, 1944, 34014, 792, 4323, 876, 286, 1077, 95116, 284, 22611, 792, 486, 931, 33864,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_compact_files_in_range() { let temp_dir = TempDir::new("test_compact_files_in_range").unwrap(); let mut cf_opts = ColumnFamilyOptions::new(); cf_opts.set_disable_auto_compactions(true); let cfs_opts = vec![ CFOptions::new("default", cf_opts.clone()), CFOptions::new("test", cf_opts.clone()), ]; let db = new_engine( temp_dir.path().to_str().unwrap(), None, &["default", "test"], Some(cfs_opts), ) .unwrap(); for cf_name in db.cf_names() { let cf = db.cf_handle(cf_name).unwrap(); for i in 0..5 { db.put_cf(cf, &[i], &[i]).unwrap(); db.put_cf(cf, &[i + 1], &[i + 1]).unwrap(); db.flush_cf(cf, true).unwrap(); } let cf_meta = db.get_column_family_meta_data(cf); let cf_levels = cf_meta.get_levels(); assert_eq!(cf_levels.first().unwrap().get_files().len(), 5); } // # Before // # After // Level-0: [4-5] // Level-1: [0-4] compact_files_in_range(&db, None, Some(&[4]), Some(1)).unwrap(); for cf_name in db.cf_names() { let cf = db.cf_handle(cf_name).unwrap(); let cf_meta = db.get_column_family_meta_data(cf); let cf_levels = cf_meta.get_levels(); let level_0 = cf_levels[0].get_files(); assert_eq!(level_0.len(), 1); assert_eq!(level_0[0].get_smallestkey(), &[4]); assert_eq!(level_0[0].get_largestkey(), &[5]); let level_1 = cf_levels[1].get_files(); assert_eq!(level_1.len(), 1); assert_eq!(level_1[0].get_smallestkey(), &[0]); assert_eq!(level_1[0].get_largestkey(), &[4]); } // # Before // Level-0: [4-5] // Level-1: [0-4] // # After // Level-0: [4-5] // Level-N: [0-4] compact_files_in_range(&db, Some(&[2]), Some(&[4]), None).unwrap(); for cf_name in db.cf_names() { let cf = db.cf_handle(cf_name).unwrap(); let cf_opts = db.get_options_cf(cf); let cf_meta = db.get_column_family_meta_data(cf); let cf_levels = cf_meta.get_levels(); let level_0 = cf_levels[0].get_files(); assert_eq!(level_0.len(), 1); assert_eq!(level_0[0].get_smallestkey(), &[4]); assert_eq!(level_0[0].get_largestkey(), &[5]); let level_n = cf_levels[cf_opts.get_num_levels() - 1].get_files(); assert_eq!(level_n.len(), 1); assert_eq!(level_n[0].get_smallestkey(), &[0]); assert_eq!(level_n[0].get_largestkey(), &[4]); } }
rust_cleaned_test_functions.jsonl/90347
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1545 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18177, 531, 10931, 1243, 9698, 368, 341, 286, 1077, 2730, 4334, 284, 19944, 6184, 486, 931, 445, 1944, 18177, 531, 10931, 1243, 9698, 1827, 15454, 1428, 286, 1077, 5206, 24111, 32354, 284, 9332, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_eval_fail_unknown_ident() { let expr = Expr::BindingRef("X".to_string()); let res = eval_expr(&expr, &mut *ctx()); assert!(res.is_err()); }
rust_cleaned_test_functions.jsonl/108369
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 95 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21296, 22121, 57507, 38399, 368, 972, 286, 1077, 15169, 284, 28819, 486, 15059, 3945, 445, 55, 3263, 983, 3904, 6201, 286, 1077, 592, 284, 5603, 21915, 2099, 9413, 11, 609, 6984, 353, 3773, 6201, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_der_read_bool_ok() { let tests : &[(bool, &[u8])] = &[ (false, &[1, 1, 0]), (true, &[1, 1, 255]), ]; for &(evalue, data) in tests { let value = parse_der(data, |reader| { reader.read_bool() }).unwrap(); assert_eq!(value, evalue); } }
rust_cleaned_test_functions.jsonl/111097
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 179 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35345, 6443, 22159, 19817, 368, 341, 262, 1077, 7032, 549, 609, 9697, 2641, 11, 44590, 84, 23, 72080, 284, 609, 9640, 286, 320, 3849, 11, 44590, 16, 11, 220, 16, 11, 220, 15, 17036, 286, 320, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_parse_background_image() { assert_eq!(parse_css_background("image(\"Cat 01\")"), Ok(StyleBackground::Image( CssImageId(String::from("Cat 01")) ))); }
rust_cleaned_test_functions.jsonl/37123
{ "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, 21039, 24103, 4954, 368, 341, 286, 2060, 10714, 10297, 6400, 25924, 24103, 445, 1805, 36014, 26801, 220, 15, 16, 62705, 3975, 7622, 7, 2323, 8706, 486, 1906, 1006, 310, 79214, 1906, 764, 2242, 486...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_match_is_not_greedy() { check( r#" macro_rules! foo { ($($i:ident $(,)*),*) => {}; } foo!(a,b); "#, expect![[r#" macro_rules! foo { ($($i:ident $(,)*),*) => {}; } "#]], ); }
rust_cleaned_test_functions.jsonl/85255
{ "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, 10708, 6892, 7913, 1889, 265, 9313, 368, 341, 262, 1779, 1006, 286, 435, 2, 698, 32606, 21407, 0, 15229, 341, 262, 1711, 699, 72, 25, 1713, 4930, 11, 4806, 701, 3764, 589, 9321, 532, 7975, 102...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_attr_to_token_tree() { let expansion = parse_to_token_tree_by_syntax( r#" #[derive(Copy)] struct Foo; "#, ); assert_eq!(to_punct(&expansion.token_trees[0]).char, '#'); assert_eq!( to_subtree(&expansion.token_trees[1]).delimiter_kind(), Some(tt::DelimiterKind::Bracket) ); }
rust_cleaned_test_functions.jsonl/28722
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 201 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10422, 2346, 6458, 11663, 368, 341, 262, 1077, 14461, 284, 4715, 2346, 6458, 11663, 3710, 78894, 1006, 286, 435, 2, 698, 310, 11506, 27098, 3025, 1266, 5563, 310, 2036, 33428, 280, 310, 5869, 345,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_paren_expr() { test_walk( "(a + b)", vec![ "File", "ExprStmt", "BinaryExpr", "IdentifierExpr", "IdentifierExpr", ], ) }
rust_cleaned_test_functions.jsonl/3329
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 241 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 620, 9151, 21915, 368, 341, 310, 1273, 56131, 1006, 394, 11993, 64, 488, 293, 15752, 394, 7486, 90515, 503, 330, 1703, 756, 503, 330, 16041, 31063, 756, 503, 330, 21338, 16041, 756, 503, 330, 87...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_query_stream_timeout() { let url = format!("{}{}", DATABASE_URL.as_str(), "&query_block_timeout=10ms"); let pool = Pool::new(url); let done = pool .get_handle() .and_then(|c| { c.query("SELECT sleep(10)") .stream_blocks() .for_each(|block| { println!("{:?}\nblock counts: {} rows", block, block.row_count()); Ok(()) }) }); run(done).unwrap_err(); let info = pool.info(); assert_eq!(info.ongoing, 0); assert_eq!(info.tasks_len, 0); assert_eq!(info.idle_len, 0); }
rust_cleaned_test_functions.jsonl/62525
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 416 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5738, 12673, 20537, 368, 341, 286, 1077, 2515, 284, 3561, 17223, 6257, 42351, 42859, 8000, 5357, 2895, 1507, 13399, 1631, 7113, 20537, 28, 16, 15, 1011, 797, 286, 1077, 7314, 284, 22728, 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_union() { use test_capnp::test_union; let mut message = message::Builder::new_default(); let mut union_struct = message.init_root::<test_union::Builder>(); union_struct.reborrow().get_union0().set_u0f0s0(()); match union_struct.reborrow().get_union0().which() { Ok(test_union::union0::U0f0s0(())) => {} _ => panic!() } union_struct.reborrow().init_union0().set_u0f0s1(true); match union_struct.reborrow().get_union0().which() { Ok(test_union::union0::U0f0s1(true)) => {} _ => panic!() } union_struct.reborrow().init_union0().set_u0f0s8(127); match union_struct.reborrow().get_union0().which() { Ok(test_union::union0::U0f0s8(127)) => {} _ => panic!() } assert_eq!(union_struct.reborrow().get_union0().has_u0f0sp(), false); union_struct.reborrow().init_union0().set_u0f0sp("abcdef"); assert_eq!(union_struct.get_union0().has_u0f0sp(), true); }
rust_cleaned_test_functions.jsonl/55857
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 532 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 51621, 368, 341, 286, 990, 1273, 16388, 6199, 486, 1944, 51621, 401, 286, 1077, 5206, 1943, 284, 1943, 486, 3297, 486, 931, 9993, 543, 286, 1077, 5206, 11300, 15126, 284, 1943, 8271, 12993, 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...
4
#[test] fn test_bpf_loader_upgradeable_write() { let loader_id = bpf_loader_upgradeable::id(); let buffer_address = Pubkey::new_unique(); let mut buffer_account = AccountSharedData::new( 1, UpgradeableLoaderState::buffer_len(9).unwrap(), &loader_id, ); let instruction_accounts = vec![ AccountMeta { pubkey: buffer_address, is_signer: false, is_writable: false, }, AccountMeta { pubkey: buffer_address, is_signer: true, is_writable: false, }, ]; // Case: Not initialized let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 0, bytes: vec![42; 9], }) .unwrap(); process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], instruction_accounts.clone(), Err(InstructionError::InvalidAccountData), ); // Case: Write entire buffer let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 0, bytes: vec![42; 9], }) .unwrap(); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address), }) .unwrap(); let accounts = process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], instruction_accounts.clone(), Ok(()), ); let state: UpgradeableLoaderState = accounts[0].state().unwrap(); assert_eq!( state, UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address) } ); assert_eq!( &accounts[0].data()[UpgradeableLoaderState::buffer_data_offset().unwrap()..], &[42; 9] ); // Case: Write portion of the buffer let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 3, bytes: vec![42; 6], }) .unwrap(); let mut buffer_account = AccountSharedData::new( 1, UpgradeableLoaderState::buffer_len(9).unwrap(), &loader_id, ); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address), }) .unwrap(); let accounts = process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], instruction_accounts.clone(), Ok(()), ); let state: UpgradeableLoaderState = accounts[0].state().unwrap(); assert_eq!( state, UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address) } ); assert_eq!( &accounts[0].data()[UpgradeableLoaderState::buffer_data_offset().unwrap()..], &[0, 0, 0, 42, 42, 42, 42, 42, 42] ); // Case: overflow size let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 0, bytes: vec![42; 10], }) .unwrap(); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address), }) .unwrap(); process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], instruction_accounts.clone(), Err(InstructionError::AccountDataTooSmall), ); // Case: overflow offset let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 1, bytes: vec![42; 9], }) .unwrap(); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address), }) .unwrap(); process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], instruction_accounts.clone(), Err(InstructionError::AccountDataTooSmall), ); // Case: Not signed let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 0, bytes: vec![42; 9], }) .unwrap(); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address), }) .unwrap(); process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], vec![ AccountMeta { pubkey: buffer_address, is_signer: false, is_writable: false, }, AccountMeta { pubkey: buffer_address, is_signer: false, is_writable: false, }, ], Err(InstructionError::MissingRequiredSignature), ); // Case: wrong authority let authority_address = Pubkey::new_unique(); let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 1, bytes: vec![42; 9], }) .unwrap(); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: Some(buffer_address), }) .unwrap(); process_instruction( &loader_id, &[], &instruction, vec![ (buffer_address, buffer_account.clone()), (authority_address, buffer_account.clone()), ], vec![ AccountMeta { pubkey: buffer_address, is_signer: false, is_writable: false, }, AccountMeta { pubkey: authority_address, is_signer: false, is_writable: false, }, ], Err(InstructionError::IncorrectAuthority), ); // Case: None authority let instruction = bincode::serialize(&UpgradeableLoaderInstruction::Write { offset: 1, bytes: vec![42; 9], }) .unwrap(); buffer_account .set_state(&UpgradeableLoaderState::Buffer { authority_address: None, }) .unwrap(); process_instruction( &loader_id, &[], &instruction, vec![(buffer_address, buffer_account.clone())], instruction_accounts, Err(InstructionError::Immutable), ); }
rust_cleaned_test_functions.jsonl/55711
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 3945 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 15897, 22139, 67794, 480, 9165, 368, 341, 286, 1077, 16047, 842, 284, 293, 15897, 22139, 67794, 480, 486, 307, 543, 286, 1077, 4147, 6744, 284, 22611, 792, 486, 931, 21218, 543, 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_get_move_type() { assert_eq!(MoveType::Horizontal, get_move_type("R10")); assert_eq!(MoveType::Horizontal, get_move_type("L10")); assert_eq!(MoveType::Vertical, get_move_type("U10")); assert_eq!(MoveType::Vertical, get_move_type("D10")); }
rust_cleaned_test_functions.jsonl/44990
{ "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, 3062, 17134, 1819, 368, 341, 286, 2060, 10714, 10297, 9860, 929, 486, 15837, 11, 633, 17134, 1819, 445, 49, 16, 15, 4010, 286, 2060, 10714, 10297, 9860, 929, 486, 15837, 11, 633, 17134, 1819, 44...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_read_required_records() { // Construct column schema let message_type = " message test_schema { REQUIRED INT32 leaf; } "; let desc = parse_message_type(message_type) .map(|t| SchemaDescriptor::new(Arc::new(t))) .map(|s| s.column(0)) .unwrap(); // Construct record reader let mut record_reader = RecordReader::<Int32Type>::new(desc.clone()); // First page // Records data: // test_schema // leaf: 4 // test_schema // leaf: 7 // test_schema // leaf: 6 // test_schema // left: 3 // test_schema // left: 2 { let values = [4, 7, 6, 3, 2]; let mut pb = DataPageBuilderImpl::new(desc.clone(), 5, true); pb.add_values::<Int32Type>(Encoding::PLAIN, &values); let page = pb.consume(); let page_reader = Box::new(TestPageReader::new(vec![page])); record_reader.set_page_reader(page_reader).unwrap(); assert_eq!(2, record_reader.read_records(2).unwrap()); assert_eq!(2, record_reader.num_records()); assert_eq!(2, record_reader.num_values()); assert_eq!(3, record_reader.read_records(3).unwrap()); assert_eq!(5, record_reader.num_records()); assert_eq!(5, record_reader.num_values()); } // Second page // Records data: // test_schema // leaf: 8 // test_schema // leaf: 9 { let values = [8, 9]; let mut pb = DataPageBuilderImpl::new(desc, 2, true); pb.add_values::<Int32Type>(Encoding::PLAIN, &values); let page = pb.consume(); let page_reader = Box::new(TestPageReader::new(vec![page])); record_reader.set_page_reader(page_reader).unwrap(); assert_eq!(2, record_reader.read_records(10).unwrap()); assert_eq!(7, record_reader.num_records()); assert_eq!(7, record_reader.num_values()); } let mut bb = Int32BufferBuilder::new(7); bb.append_slice(&[4, 7, 6, 3, 2, 8, 9]); let expected_buffer = bb.finish(); assert_eq!( expected_buffer, record_reader.consume_record_data().unwrap() ); assert_eq!(None, record_reader.consume_def_levels().unwrap()); assert_eq!(None, record_reader.consume_bitmap().unwrap()); }
rust_cleaned_test_functions.jsonl/52887
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1304 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 18743, 31279, 368, 341, 286, 442, 18678, 3250, 10802, 198, 286, 1077, 1943, 1819, 284, 6228, 286, 1943, 1273, 25371, 341, 688, 66577, 9221, 18, 17, 15933, 280, 286, 456, 286, 7620, 286, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_box_str() { let b = "str".to_owned().into_boxed_str(); let tokens = quote!( #b ); assert_eq!("\"str\"", tokens.to_string()); }
rust_cleaned_test_functions.jsonl/3601
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 74 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10194, 2895, 368, 341, 262, 1077, 293, 284, 330, 495, 3263, 983, 51973, 1005, 18122, 10194, 291, 2895, 543, 262, 1077, 11211, 284, 12641, 10297, 671, 65, 1439, 262, 2060, 10714, 17223, 2105, 495, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_nonzero() { let nonempty: nonzero::NonEmpty<_> = NonEmpty::from((0, vec![1, 2, 3])).into(); assert_eq!(nonempty.len(), 4.try_into().unwrap()); assert_eq!(nonempty.capacity(), 4.try_into().unwrap()); }
rust_cleaned_test_functions.jsonl/117935
{ "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, 21637, 14154, 368, 341, 286, 1077, 2477, 3194, 25, 72232, 486, 8121, 3522, 32399, 29, 284, 11581, 3522, 486, 1499, 1188, 15, 11, 7486, 20703, 16, 11, 220, 17, 11, 220, 18, 54697, 18122, 1428, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_skipmap_iterator_0() { let skm = SkipMap::new(options::for_test().cmp); let mut i = 0; for (_, _) in LdbIteratorIter::wrap(&mut skm.iter()) { i += 1; } assert_eq!(i, 0); assert!(!skm.iter().valid()); }
rust_cleaned_test_functions.jsonl/89155
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 155 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 44830, 2186, 13491, 62, 15, 368, 341, 286, 1077, 1901, 76, 284, 25784, 2227, 486, 931, 12078, 486, 1958, 4452, 1005, 7293, 317, 286, 1077, 5206, 600, 284, 220, 15, 401, 286, 369, 39464, 27439, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_buffer() { let reader = bam::IndexedReader::from_path(&"test/test.bam").unwrap(); let mut buffer = RecordBuffer::new(reader); buffer.fetch(b"CHROMOSOME_I", 1, 5).unwrap(); { let records = buffer.iter().collect_vec(); assert_eq!(records.len(), 6); assert_eq!(records[0].pos(), 1); assert_eq!(records[1].pos(), 1); assert_eq!(records[2].pos(), 1); assert_eq!(records[3].pos(), 1); assert_eq!(records[4].pos(), 1); assert_eq!(records[5].pos(), 1); } }
rust_cleaned_test_functions.jsonl/45090
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 324 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7776, 368, 341, 286, 1077, 6604, 284, 41304, 486, 1552, 17120, 486, 1499, 2638, 2099, 1, 1944, 12697, 71804, 1827, 15454, 1428, 286, 1077, 5206, 4147, 284, 13583, 4095, 486, 931, 21987, 626, 286, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_integer_key() { let s = " 0: important: true 1: important: false "; let out = YamlLoader::load_from_str(&s).unwrap(); let first = out.into_iter().next().unwrap(); assert_eq!(first[0]["important"].as_bool().unwrap(), true); }
rust_cleaned_test_functions.jsonl/1213
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 136 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31725, 3097, 368, 341, 286, 1077, 274, 284, 6228, 15, 510, 262, 2989, 25, 830, 198, 16, 510, 262, 2989, 25, 895, 198, 876, 286, 1077, 700, 284, 809, 9467, 9181, 486, 1078, 5673, 2895, 2099, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_from_axis_angle_rotate_point() { let axis = Unit::from_value(Vector3::new(-1_f64, -1_f64, 1_f64)); let angle = Degrees(60_f64); let rotation = Rotation3::from_axis_angle(&axis, angle); let point = Point3::new(-1_f64, -1_f64, 0_f64); let expected = Point3::new(-2_f64 / 6_f64, -8_f64 / 6_f64, 2_f64 / 6_f64); let result = rotation.rotate_point(&point); assert!(relative_eq!(result, expected, epsilon = 1e-8)); }
rust_cleaned_test_functions.jsonl/70520
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 242 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 23567, 21727, 60834, 6085, 368, 341, 286, 1077, 8024, 284, 7954, 486, 1499, 3142, 20258, 18, 486, 931, 4080, 16, 761, 21, 19, 11, 481, 16, 761, 21, 19, 11, 220, 16, 761, 21, 19, 1106, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_build_string() { let test_str = "Journey before destination".to_string(); let test = build_string(cstring(&test_str).as_ptr()); assert!(test.is_some()); assert_eq!(test_str, test.unwrap()); }
rust_cleaned_test_functions.jsonl/50406
{ "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, 20801, 3904, 368, 341, 286, 1077, 1273, 2895, 284, 330, 41, 32990, 1573, 9106, 3263, 983, 3904, 1428, 286, 1077, 1273, 284, 1936, 3904, 1337, 917, 2099, 1944, 2895, 568, 300, 4348, 1423, 286, 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
#[test] fn test_new_id_token() { let client_id = ClientId::new("my_client".to_string()); let issuer = IssuerUrl::new("https://example.com".to_string()).unwrap(); let nonce = Nonce::new("the_nonce".to_string()); let rsa_priv_key = CoreRsaPrivateSigningKey::from_pem(TEST_RSA_PRIV_KEY, None).unwrap(); let id_token = CoreIdToken::new( CoreIdTokenClaims::new( issuer.clone(), vec![Audience::new((*client_id).clone())], Utc.timestamp(1544932149, 0), Utc.timestamp(1544928549, 0), StandardClaims::new(SubjectIdentifier::new("subject".to_string())), Default::default(), ) .set_nonce(Some(nonce.clone())) .set_auth_context_ref(Some(AuthenticationContextClass::new("the_acr".to_string()))) .set_auth_time(Some(Utc.timestamp(1544928548, 0))), &rsa_priv_key, CoreJwsSigningAlgorithm::RsaSsaPkcs1V15Sha256, Some(&AccessToken::new("the_access_token".to_string())), Some(&AuthorizationCode::new( "the_authorization_code".to_string(), )), ) .unwrap(); let serialized_jwt: serde_json::Value = serde_json::to_value(&id_token).unwrap(); let expected_serialized_jwt = "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuY29tIiwiYXVkIjpbIm15X2NsaWVudCJdL\ CJleHAiOjE1NDQ5MzIxNDksImlhdCI6MTU0NDkyODU0OSwiYXV0aF90aW1lIjoxNTQ0OTI4NTQ4LCJub25jZSI\ 6InRoZV9ub25jZSIsImFjciI6InRoZV9hY3IiLCJhdF9oYXNoIjoiWjNJQUNVR00tbXhIV3lZUXZpSzhFUSIsI\ mNfaGFzaCI6Imo2OW1CZmFIbmRMM1Y1RmNoak9LVXciLCJzdWIiOiJzdWJqZWN0In0.CHCWFcIqbCZhZwZH4oY\ _mlcRy5aUQQtlNI0VHNYxiILn9ppRHLL4Bn_LMn9VP8tGXkfZWxCgP25ZTyBXXKfk0fQvnukVdyM0bCOpQbiBg\ 5gB9c46l_f-ZznDoHWonpnKky2Gmzk3ocb3TCUQ9GSeRXAzRdRNWTT0ElWNBsLWU4j2IIdnghM78gkXwOC76Rk\ pshgB73ubtuHGdIf5L9Ec3hifHlVjzKuvedAM4SIOjdBOelgtBlF3463ufX_Ut91CjP5TzLMsuK3Lh_vyo8ttn\ S41rBDuetR2ENvR0yj5RjkX_SPY3V0yCW8_NPPu1CHu_1oL0Nma0ohCbF3vnUJcwg"; assert_eq!(expected_serialized_jwt, serialized_jwt.as_str().unwrap()); let rsa_pub_key = serde_json::from_str::<CoreJsonWebKey>(TEST_RSA_PUB_KEY) .expect("deserialization failed"); let mock_current_time = AtomicUsize::new(1544932148); let verifier = CoreIdTokenVerifier::new_public_client( client_id, issuer, CoreJsonWebKeySet::new(vec![rsa_pub_key]), ) .set_time_fn(|| seconds_to_utc(&Seconds::new(mock_current_time.load(Ordering::Relaxed).into())).unwrap()); id_token.claims(&verifier, &nonce).unwrap(); }
rust_cleaned_test_functions.jsonl/60968
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1605 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5921, 842, 6458, 368, 341, 286, 1077, 2943, 842, 284, 8423, 764, 486, 931, 445, 2408, 8179, 3263, 983, 3904, 1423, 286, 1077, 54835, 284, 15935, 8801, 2864, 486, 931, 445, 2428, 1110, 8687, 905,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_dequeue_last() { let mut state = PlaybackState::default(); state.queue(song("1")); state.queue(song("2")); state.queue(song("3")); state.play("3"); assert!(state.is_playing()); state.dequeue("3"); assert_eq!(state.song_id(), Some("2")); }
rust_cleaned_test_functions.jsonl/20830
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 164 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2259, 4584, 12195, 368, 341, 286, 1077, 5206, 1584, 284, 95301, 1397, 486, 2258, 543, 286, 1584, 29598, 60873, 445, 16, 4010, 286, 1584, 29598, 60873, 445, 17, 4010, 286, 1584, 29598, 60873, 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_inte() { let v = vec![1, 2, 3, 4]; let v_iter = v.iter(); let total: i32 = v_iter.sum(); assert_eq!(10, total); }
rust_cleaned_test_functions.jsonl/51243
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 99 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4042, 68, 368, 341, 286, 1077, 348, 284, 7486, 20703, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 4821, 286, 1077, 348, 11723, 284, 348, 19471, 1428, 286, 1077, 2790, 25, 600, 18, 17, 284, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_response_for_balance() { let mock_transport = MockRequest::new( "{\"status\":\"success\",\"data\":[{\"available\":\"120347\",\"wallet\":\"CLP\",\"balance\":\"120347\"},{\"available\":\"10.3399\",\"wallet\":\"ETH\",\"balance\":\"11.3399\"}]}", "" ); let api = Api::<MockRequest>::new(API_KEY, SECRET_KEY, Box::new(mock_transport)); let expected = json!({ "status":"success", "data":[ {"available":"120347","wallet":"CLP","balance":"120347"},{"available":"10.3399","wallet":"ETH","balance":"11.3399"} ] }); let params = HashMap::new(); let resp = api .get_edge::<BalanceResponse>("balance", params, false) .unwrap(); for it in 1..resp.data.len() { assert_eq!( resp.data[it].available, expected["data"][it]["available"], "Los datos no coinciden: Valor respondido {:?} Valor esperado: {:?}", resp, expected ); assert_eq!( resp.data[it].wallet, expected["data"][it]["wallet"], "Los datos no coinciden: Valor respondido {:?} Valor esperado: {:?}", resp, expected ); assert_eq!( resp.data[it].balance, expected["data"][it]["balance"], "Los datos no coinciden: Valor respondido {:?} Valor esperado: {:?}", resp, expected ); } }
rust_cleaned_test_functions.jsonl/75239
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 770 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9655, 5478, 29396, 368, 341, 286, 1077, 7860, 46398, 284, 14563, 1900, 486, 931, 1006, 310, 54734, 2829, 23488, 5630, 34333, 691, 59, 8899, 64238, 10334, 23488, 16, 17, 15, 18, 19, 22, 34333, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_invalid_json() { let geojson_str = r#"{ "type": "FeatureCollection", "features": [ !INTENTIONAL_TYPO! { "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [ -0.13583511114120483, 51.5218870403801 ] } } ] }"#; assert!(matches!( GeoJson::from_str(geojson_str), Err(Error::MalformedJson(_)) )) }
rust_cleaned_test_functions.jsonl/95321
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 406 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31433, 9455, 368, 341, 286, 1077, 27581, 2236, 2895, 284, 435, 55543, 515, 1843, 330, 1313, 788, 330, 13859, 6482, 756, 1843, 330, 20304, 788, 2278, 1797, 753, 3221, 71883, 969, 1139, 56, 2045, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_signature_offset() { let offsets = Ed25519SignatureOffsets { signature_offset: std::u16::MAX, ..Ed25519SignatureOffsets::default() }; assert_eq!( test_case(1, &offsets), Err(Ed25519Error::InvalidDataOffsets) ); let offsets = Ed25519SignatureOffsets { signature_offset: 100 - SIGNATURE_SERIALIZED_SIZE as u16 + 1, ..Ed25519SignatureOffsets::default() }; assert_eq!( test_case(1, &offsets), Err(Ed25519Error::InvalidDataOffsets) ); }
rust_cleaned_test_functions.jsonl/44028
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 319 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 39859, 6917, 368, 341, 286, 1077, 35046, 284, 3199, 17, 20, 20, 16, 24, 25088, 81095, 341, 310, 11957, 6917, 25, 1460, 486, 84, 16, 21, 486, 10586, 345, 310, 5241, 2715, 17, 20, 20, 16, 24, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_and_or_not_complex_case_to_string() { let name1 = _random_vector(10); let value1 = _random_string(10); let name2 = _random_vector(10); let value2 = _random_string(10); let name3 = _random_vector(10); let value3 = _random_string(10); let name4 = _random_vector(10); let value4 = _random_string(10); let name5 = _random_vector(10); let value5 = _random_string(10); let name6 = _random_vector(10); let value6 = _random_string(10); let name7 = _random_vector(10); let value7 = _random_string(10); let name8 = _random_vector(10); let value8 = _random_string(10); let query = Operator::Not( Box::new( Operator::And( vec![ Operator::Eq( TagName::PlainTagName(name1.clone()), TargetValue::Unencrypted(value1.clone()) ), Operator::Or( vec![ Operator::Gt( TagName::PlainTagName(name2.clone()), TargetValue::Unencrypted(value2.clone()) ), Operator::Not( Box::new( Operator::Lte( TagName::PlainTagName(name3.clone()), TargetValue::Unencrypted(value3.clone()) ) ) ), Operator::And( vec![ Operator::Lt( TagName::PlainTagName(name4.clone()), TargetValue::Unencrypted(value4.clone()) ), Operator::Not( Box::new( Operator::Gte( TagName::PlainTagName(name5.clone()), TargetValue::Unencrypted(value5.clone()) ) ) ), ] ) ] ), Operator::Not( Box::new( Operator::Like( TagName::PlainTagName(name6.clone()), TargetValue::Unencrypted(value6.clone()) ) ) ), Operator::And( vec![ Operator::Eq( TagName::PlainTagName(name7.clone()), TargetValue::Unencrypted(value7.clone()) ), Operator::Not( Box::new( Operator::Neq( TagName::PlainTagName(name8.clone()), TargetValue::Unencrypted(value8.clone()) ) ) ), ] ) ] ) ) ); let json = query.to_string(); let expected = format!(r#"{{"$not":{{"$and":[{{"~{}":"{}"}},{{"$or":[{{"~{}":{{"$gt":"{}"}}}},{{"$not":{{"~{}":{{"$lte":"{}"}}}}}},{{"$and":[{{"~{}":{{"$lt":"{}"}}}},{{"$not":{{"~{}":{{"$gte":"{}"}}}}}}]}}]}},{{"$not":{{"~{}":{{"$like":"{}"}}}}}},{{"$and":[{{"~{}":"{}"}},{{"$not":{{"~{}":{{"$neq":"{}"}}}}}}]}}]}}}}"#, base64::encode(&name1), value1, base64::encode(&name2), value2, base64::encode(&name3), value3, base64::encode(&name4), value4, base64::encode(&name5), value5, base64::encode(&name6), value6, base64::encode(&name7), value7, base64::encode(&name8), value8, ); assert_eq!(json, expected); }
rust_cleaned_test_functions.jsonl/11935
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 3467 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8378, 8734, 7913, 41522, 19096, 2346, 3904, 368, 341, 286, 1077, 829, 16, 284, 716, 11463, 12247, 7, 16, 15, 317, 286, 1077, 897, 16, 284, 716, 11463, 3904, 7, 16, 15, 317, 286, 1077, 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...
1
#[test] fn test_is_complete_into_packets() { let cmd = Command::IsComplete { code: "a = 10".to_string(), }; assert_packets(PacketsTestData { command: cmd, expected_header_type: "is_complete_request", expected_content: json!({ "code": "a = 10", }), }); }
rust_cleaned_test_functions.jsonl/53206
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 202 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6892, 27675, 45514, 63569, 368, 341, 286, 1077, 5439, 284, 7348, 486, 3872, 12548, 341, 310, 2038, 25, 330, 64, 284, 220, 16, 15, 3263, 983, 3904, 3148, 286, 2605, 286, 2060, 63569, 5304, 18382,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_hextstr_to_u64() { assert_eq!(hexstr_to_u64("0x0100000000000000".to_string()), Ok(1u64)); assert_eq!(hexstr_to_u64("0x01000000".to_string()), Ok(1u64)); assert_eq!(hexstr_to_u64("null".to_string()), Ok(0u64)); assert_eq!(hexstr_to_u64("0x010000000000000000".to_string()), Err(hex::FromHexError::InvalidStringLength)); assert_eq!(hexstr_to_u64("0x0q".to_string()), Err(hex::FromHexError::InvalidHexCharacter{c: 'q', index:1})); }
rust_cleaned_test_functions.jsonl/1828
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 237 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 1523, 427, 495, 2346, 7300, 21, 19, 368, 341, 286, 2060, 10714, 10297, 17308, 495, 2346, 7300, 21, 19, 445, 15, 87, 15, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 3263, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_writer_gff3() { let mut reader = Reader::new(GFF_FILE_ONE_ATTRIB, GffType::GFF3); let mut writer = Writer::new(vec![], GffType::GFF3); for r in reader.records() { writer .write(&r.ok().expect("Error reading record")) .ok() .expect("Error writing record"); } assert_eq!(writer.inner.into_inner().unwrap(), GFF_FILE_ONE_ATTRIB) }
rust_cleaned_test_functions.jsonl/74495
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 236 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28908, 1889, 542, 18, 368, 341, 286, 1077, 5206, 6604, 284, 25166, 486, 931, 6699, 1748, 8087, 34727, 99043, 11, 479, 542, 929, 486, 38, 1748, 18, 317, 286, 1077, 5206, 6916, 284, 29404, 486, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_node_compact_size_limit() { let count = 5; let mut cluster = new_node_cluster(0, count); test_compact_size_limit(&mut cluster); }
rust_cleaned_test_functions.jsonl/80554
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 70 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5084, 18177, 531, 2368, 14763, 368, 341, 262, 1077, 1760, 284, 220, 20, 280, 262, 1077, 5206, 10652, 284, 501, 5084, 28441, 7, 15, 11, 1760, 317, 262, 1273, 18177, 531, 2368, 14763, 2099, 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
#[test] fn test_vault() { let path = diem_temppath::TempPath::new(); path.create_as_file().unwrap(); let mut file = File::create(path.path()).unwrap(); file.write_all(b"disk_token").unwrap(); let path_str = path.path().to_str().unwrap(); let vault = format!( "backend=vault;server=http://127.0.0.1:8080;token={}", path_str ); storage(&vault).unwrap(); let vault = format!( "backend=vault;server=http://127.0.0.1:8080;token={};namespace=test", path_str ); storage(&vault).unwrap(); let vault = "backend=vault"; storage(vault).unwrap_err(); }
rust_cleaned_test_functions.jsonl/32311
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 360 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2273, 945, 368, 341, 286, 1077, 1815, 284, 1853, 336, 28613, 602, 587, 486, 12151, 1820, 486, 931, 543, 286, 1815, 2520, 11898, 2458, 1005, 15454, 543, 286, 1077, 5206, 1034, 284, 2887, 486, 318...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_gc() { test_gc_imp(b"k1", b"v1", b"v2", b"v3", b"v4"); let v1 = "x".repeat(SHORT_VALUE_MAX_LEN + 1).into_bytes(); let v2 = "y".repeat(SHORT_VALUE_MAX_LEN + 1).into_bytes(); let v3 = "z".repeat(SHORT_VALUE_MAX_LEN + 1).into_bytes(); let v4 = "v".repeat(SHORT_VALUE_MAX_LEN + 1).into_bytes(); test_gc_imp(b"k2", &v1, &v2, &v3, &v4); }
rust_cleaned_test_functions.jsonl/61091
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 228 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 49423, 368, 341, 286, 1273, 49423, 36788, 1883, 62911, 16, 497, 293, 1, 85, 16, 497, 293, 1, 85, 17, 497, 293, 1, 85, 18, 497, 293, 1, 85, 19, 3071, 286, 1077, 348, 16, 284, 330, 87, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_failed_name_server() { let mut options = ResolverOpts::default(); options.timeout = Duration::from_millis(1); let config = NameServerConfig { socket_addr: SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 252)), 252), protocol: Protocol::Udp, }; let mut io_loop = Core::new().unwrap(); let mut name_server = NameServer::<_, StandardConnection>::new(config, options, &io_loop.handle()); let name = Name::parse("www.example.com.", None).unwrap(); assert!( io_loop .run(name_server.lookup(Query::query(name.clone(), RecordType::A))) .is_err() ); }
rust_cleaned_test_functions.jsonl/104490
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 350 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35060, 1269, 12015, 368, 341, 286, 1077, 5206, 2606, 284, 81854, 43451, 486, 2258, 543, 286, 2606, 36110, 284, 21045, 486, 1499, 717, 56212, 7, 16, 1215, 715, 286, 1077, 2193, 284, 3988, 5475, 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_find_path(){ let json_value = Json::from_str("{\"dog\":{\"cat\": {\"mouse\" : \"cheese\"}}}").unwrap(); let found_str = json_value.find_path(&["dog", "cat", "mouse"]); assert!(found_str.unwrap().as_string().unwrap() == "cheese"); }
rust_cleaned_test_functions.jsonl/22736
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 126 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21814, 2638, 3032, 286, 1077, 2951, 3142, 284, 8308, 486, 1499, 2895, 99141, 18457, 92729, 4616, 11693, 314, 2105, 13237, 2105, 549, 7245, 1528, 2367, 2105, 75542, 1827, 15454, 543, 286, 1077, 1730,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_sha256() { let expected_hex = "09ca7e4eaa6e8ae9c7d261167129184883644d07dfba7cbfbc4c8a2e08360d5b"; let expected: Vec<u8> = ring::test::from_hex(expected_hex).unwrap(); assert_eq!( sha256(b"hello, world"), [ 9, 202, 126, 78, 170, 110, 138, 233, 199, 210, 97, 22, 113, 41, 24, 72, 131, 100, 77, 7, 223, 186, 124, 191, 188, 76, 138, 46, 8, 54, 13, 91 ] ); assert_eq!(sha256(b"hello, world"), expected[..]); }
rust_cleaned_test_functions.jsonl/17833
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 303 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 48836, 17, 20, 21, 368, 341, 286, 1077, 3601, 32655, 284, 330, 15, 24, 924, 22, 68, 19, 68, 5305, 21, 68, 23, 5918, 24, 66, 22, 67, 17, 21, 16, 16, 21, 22, 16, 17, 24, 16, 23, 19, 23...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_push_exact_zeros() { let mut bitmap = MutableBitmap::new(); for _ in 0..8 { bitmap.push(false) } let bitmap: Option<Bitmap> = bitmap.into(); let bitmap = bitmap.unwrap(); assert_eq!(bitmap.len(), 8); assert_eq!(bitmap.as_slice().len(), 1); }
rust_cleaned_test_functions.jsonl/64517
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 176 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 14218, 71084, 83761, 368, 341, 286, 1077, 5206, 19746, 284, 31143, 16773, 486, 931, 543, 286, 369, 716, 304, 220, 15, 496, 23, 341, 310, 19746, 2552, 3576, 340, 286, 456, 286, 1077, 19746, 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_read_var_uint() { let var_uint = VarUInt::read(&mut Cursor::new(&[0b0111_1001, 0b0000_1111, 0b1000_0001])) .expect(ERROR_MESSAGE); assert_eq!(3, var_uint.size_in_bytes()); assert_eq!(1_984_385, var_uint.value()); }
rust_cleaned_test_functions.jsonl/116127
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 146 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 4612, 15807, 368, 341, 286, 1077, 762, 15807, 284, 8735, 18777, 486, 878, 2099, 6984, 28067, 486, 931, 2099, 58, 15, 65, 15, 16, 16, 16, 62, 16, 15, 15, 16, 11, 220, 15, 65, 15, 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_transaction_txid() { clear_mocks(); let raw_tx = hex::decode(&sample_example_real_rawtx()).unwrap(); let transaction = parse_transaction(&raw_tx).unwrap(); let expected_txid = H256Le::from_hex_be(&sample_example_real_txid()); assert_eq!(transaction.tx_id(), expected_txid); }
rust_cleaned_test_functions.jsonl/90672
{ "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, 28884, 17805, 307, 368, 341, 286, 2797, 717, 25183, 543, 286, 1077, 7112, 17805, 284, 12371, 486, 18196, 2099, 13611, 39304, 15266, 16067, 3998, 6011, 15454, 543, 286, 1077, 7745, 284, 4715, 28884, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_sjog() { let mut reader = ACKReader::new(); // Test de SJOG // [H1][H2][psize][pid][cmd][chk1][chk2][status_error][status_detail] let packet_sjog = [ 0xFF, 0xFF, 0x09, 0xFD, 0x46, /*0xF2*/ 0xB2, /*0x0C*/ 0x4C, 0x08, 0x08, ]; reader.parse(&packet_sjog); assert_eq!( reader.pop_ack_packet().unwrap(), ACKPacket { pid: 0xFD, cmd: Command::SJog, error: StatusError::InvalidPacket, detail: StatusDetail::UnknownCommand, } ); }
rust_cleaned_test_functions.jsonl/70800
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 372 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 643, 73, 538, 368, 341, 286, 1077, 5206, 6604, 284, 53763, 5062, 486, 931, 1428, 286, 442, 3393, 409, 68223, 12223, 198, 286, 442, 508, 39, 16, 1457, 39, 17, 1457, 1690, 551, 1457, 10412, 1457...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_recent_blockhash() { let rpc_client = RpcClient::new_mock("succeeds".to_string()); let expected_blockhash: Hash = PUBKEY.parse().unwrap(); let (blockhash, _fee_calculator) = rpc_client.get_recent_blockhash().expect("blockhash ok"); assert_eq!(blockhash, expected_blockhash); let rpc_client = RpcClient::new_mock("fails".to_string()); assert!(rpc_client.get_recent_blockhash().is_err()); }
rust_cleaned_test_functions.jsonl/2732
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 202 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 62361, 7113, 8296, 368, 341, 286, 1077, 35596, 8179, 284, 79961, 2959, 486, 931, 34134, 445, 82, 29264, 82, 3263, 983, 3904, 5231, 286, 1077, 3601, 7113, 8296, 25, 6531, 284, 76744, 4784, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_keywords_in_function() { check( r"fn quux() { <|> }", expect![[r#" kw fn kw use kw impl kw trait kw match kw while kw loop kw if kw if let kw let kw mod kw const kw type kw static kw extern kw unsafe kw return "#]], ); }
rust_cleaned_test_functions.jsonl/126827
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 428 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 51354, 1243, 9174, 368, 341, 286, 1779, 1006, 310, 435, 1, 8822, 922, 2200, 368, 314, 82639, 29, 335, 756, 310, 1720, 0, 15505, 81, 2, 698, 394, 29525, 5168, 198, 394, 29525, 990, 198, 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_increment_keep_prerelease() { let mut release = Version::parse("1.0.0-alpha").unwrap(); release.increment_patch(); assert_eq!(release, Version::parse("1.0.1").unwrap()); release.increment_minor(); assert_eq!(release, Version::parse("1.1.0").unwrap()); release.increment_major(); assert_eq!(release, Version::parse("2.0.0").unwrap()); }
rust_cleaned_test_functions.jsonl/43098
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 185 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 51482, 50293, 5294, 485, 1623, 368, 341, 286, 1077, 5206, 4879, 284, 6079, 486, 6400, 445, 16, 13, 15, 13, 15, 64538, 1827, 15454, 543, 286, 4879, 56936, 39643, 1428, 286, 2060, 10714, 10297, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_x_then_y() { let vec = vec3(0.0, 1.0, 0.0); let rot = Quaternion::from(Euler::new(Deg(90.0), Deg(90.0), Deg(0.0))); assert_ulps_eq!(vec3(0.0f32, 0.0f32, 1.0f32), rot * vec); }
rust_cleaned_test_functions.jsonl/38262
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 135 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3212, 68367, 4178, 368, 341, 286, 1077, 7486, 284, 7486, 18, 7, 15, 13, 15, 11, 220, 16, 13, 15, 11, 220, 15, 13, 15, 626, 286, 1077, 5749, 284, 24801, 486, 1499, 10722, 8479, 486, 931, 54...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_match_nested() { let mut ss = SimpleStore::new(); let tup1 = tuple![E::I(123), E::T(tuple![E::str("hello")])]; ss.out(tup1.clone()).unwrap(); assert_eq!(ss.inp(&tup1).unwrap(), Some(tup1.clone())); }
rust_cleaned_test_functions.jsonl/74952
{ "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, 10708, 66279, 368, 341, 262, 1077, 5206, 10870, 284, 8993, 6093, 486, 931, 543, 262, 1077, 57385, 16, 284, 14405, 20703, 36, 486, 40, 7, 16, 17, 18, 701, 468, 486, 51, 58602, 20703, 36, 486, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_encode_read_write() { let keystore_location = PathBuf::from("/tmp/forest-db"); let mut ks = KeyStore::new(KeyStoreConfig::Persistent(keystore_location.clone())).unwrap(); let key = wallet::generate_key(SignatureType::BLS).unwrap(); let addr = format!("wallet-{}", key.address); ks.put(addr.clone(), key.key_info).unwrap(); ks.flush().unwrap(); let default = ks.get(&addr).unwrap(); let mut keystore_file = keystore_location; keystore_file.push("keystore.json"); let reader = BufReader::new(File::open(keystore_file).unwrap()); let persisted_keystore: HashMap<String, PersistentKeyInfo> = serde_json::from_reader(reader).unwrap(); let default_key_info = persisted_keystore.get(&addr).unwrap(); let actual = base64::decode(default_key_info.private_key.clone()).unwrap(); assert_eq!( default.private_key, actual, "persisted key matches key from key store" ); }
rust_cleaned_test_functions.jsonl/83901
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 448 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11224, 6443, 9165, 368, 341, 286, 1077, 1962, 63373, 13126, 284, 7933, 15064, 486, 1499, 4283, 5173, 14, 50655, 60399, 797, 286, 1077, 5206, 41282, 284, 5309, 6093, 486, 931, 21358, 6093, 2648, 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_range2cellrange() { let ranges: Vec<Range<u64>> = vec![2..8]; let ranges = MocRanges::<u64, Hpx<u64>>::new_unchecked(ranges); let rm = RangeMOC::new(29, ranges); let res: Vec<CellOrCellRange<u64>> = (&rm).into_range_moc_iter().cells().cellranges().collect(); assert_eq!(res, vec![ CellOrCellRange::CellRange(CellRange::new(29, 2, 4)), CellOrCellRange::Cell(Cell::new(28, 1)), ]); }
rust_cleaned_test_functions.jsonl/14833
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 197 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9698, 17, 5873, 9669, 368, 341, 262, 1077, 21283, 25, 11312, 27, 6046, 34837, 21, 19, 2452, 284, 7486, 20703, 17, 496, 23, 935, 262, 1077, 21283, 284, 386, 509, 74902, 27638, 84, 21, 19, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_can_print_warnings() { rustc_ast::with_default_globals(|| { let matches = optgroups().parse(&["-Awarnings".to_string()]).unwrap(); let (sess, _) = mk_session(matches); assert!(!sess.diagnostic().can_emit_warnings()); }); rustc_ast::with_default_globals(|| { let matches = optgroups().parse(&["-Awarnings".to_string(), "-Dwarnings".to_string()]).unwrap(); let (sess, _) = mk_session(matches); assert!(sess.diagnostic().can_emit_warnings()); }); rustc_ast::with_default_globals(|| { let matches = optgroups().parse(&["-Adead_code".to_string()]).unwrap(); let (sess, _) = mk_session(matches); assert!(sess.diagnostic().can_emit_warnings()); }); }
rust_cleaned_test_functions.jsonl/16046
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 353 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 27421, 10064, 87658, 368, 341, 262, 23071, 66, 48019, 486, 4197, 9993, 58775, 79453, 341, 286, 1077, 9071, 284, 3387, 16753, 1005, 6400, 2099, 1183, 12, 22600, 14857, 3263, 983, 3904, 368, 10697, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_recognize_three() { let tail: &[u8] = &[0x61, 0x61, 0xE0, 0xA1, 0x98, 0x0d, 0x0a, 0x0d, 0x0a]; let mut full = AsyncBuffer::new(format!("GET /first HTTP/1.1\r\n{}", std::str::from_utf8(tail).unwrap())); let result = block_on(async { recognize(&mut full).await }); assert!(result.is_ok()) }
rust_cleaned_test_functions.jsonl/48183
{ "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, 7080, 3934, 551, 50016, 368, 341, 220, 1077, 9787, 25, 44590, 84, 23, 60, 284, 44590, 15, 87, 21, 16, 11, 220, 15, 87, 21, 16, 11, 220, 15, 12606, 15, 11, 220, 15, 14673, 16, 11, 220, 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_long_wall() { let size = Size::new(7, 7); let radius = 10; let mut original = Vec2d::new(size, '.'); for x in 0..size.width { original.set(Point::new(x, 1), '#'); } let actual = visit_tiles(&original, size, radius); let expected = "\n???????\n#######\n.......\n...x...\n.......\n.......\n......."; assert_eq!(actual, expected); }
rust_cleaned_test_functions.jsonl/108554
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 209 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17799, 50731, 368, 341, 286, 1077, 1379, 284, 8478, 486, 931, 7, 22, 11, 220, 22, 317, 286, 1077, 10578, 284, 220, 16, 15, 280, 286, 1077, 5206, 4024, 284, 11312, 17, 67, 486, 931, 6856, 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_from_absolute_path_str() { let s = "m/44/19165"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::default() ); let s = "m/44'/19165'"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::default() ); let s = "m/44'/19165'/1/2"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::new_bip44(Some(1), Some(2)) ); let s = "m/44'/19165'/1'/2'"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::new_bip44(Some(1), Some(2)) ); // Test non-Safecoin Bip44 let s = "m/44'/999'/1/2"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::new_bip44_with_coin(TestCoin, Some(1), Some(2)) ); let s = "m/44'/999'/1'/2'"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::new_bip44_with_coin(TestCoin, Some(1), Some(2)) ); // Test non-bip44 paths let s = "m/19165'/0'/0/0"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::new(vec![ ChildIndex::Hardened(501), ChildIndex::Hardened(0), ChildIndex::Hardened(0), ChildIndex::Hardened(0), ]) ); let s = "m/19165'/0'/0'/0'"; assert_eq!( DerivationPath::from_absolute_path_str(s).unwrap(), DerivationPath::new(vec![ ChildIndex::Hardened(501), ChildIndex::Hardened(0), ChildIndex::Hardened(0), ChildIndex::Hardened(0), ]) ); }
rust_cleaned_test_functions.jsonl/132678
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1079 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 50874, 2638, 2895, 368, 341, 286, 1077, 274, 284, 330, 76, 14, 19, 19, 14, 16, 24, 16, 21, 20, 876, 286, 2060, 10714, 33673, 310, 12741, 39127, 1820, 486, 1499, 50874, 2638, 2895, 1141, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_description() { let ih = Kron::new(I::new(), H::new()); assert_eq!(ih.description(), "I⊗H"); let hh = Kron::new(H::new(), H::new()); assert_eq!(hh.description(), "H⊗H"); let hih = Kron::new(H::new(), Kron::new(I::new(), H::new())); assert_eq!(hih.description(), "H⊗I⊗H"); }
rust_cleaned_test_functions.jsonl/34665
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 184 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11448, 741, 262, 341, 286, 1077, 13305, 284, 96560, 486, 931, 8972, 486, 931, 1507, 472, 486, 931, 1423, 286, 2060, 10714, 10297, 6996, 13178, 1507, 330, 40, 146549, 39, 797, 286, 1077, 37914, 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_iter() { let xs = vec![(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]; let map: VecMap<_> = xs.iter().cloned().collect(); for &(k, v) in &xs { assert_eq!(map.get(&k), Some(&v)); } }
rust_cleaned_test_functions.jsonl/53282
{ "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, 5673, 11723, 368, 341, 286, 1077, 11943, 284, 7486, 0, 9697, 16, 11, 364, 64, 4567, 320, 17, 11, 364, 65, 4567, 320, 18, 11, 364, 66, 4567, 320, 19, 11, 364, 67, 4567, 320, 20, 11, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_rb_insert_remove_rand() { let mut t: TreeRb<isize, isize> = TreeRb::new(); let bounds = Uniform::from(-300..301); let mut rng = rand::thread_rng(); let mut hm = HashMap::new(); for i in 0..10000 { let r = bounds.sample(&mut rng); t.insert(r, i); hm.insert(r, i); } t.check_nodes(); assert!(t.len() == hm.len()); for _ in 0..30000 { let r = bounds.sample(&mut rng); match hm.remove(&r) { Some(v_check) => { let v = t.remove(&r).expect("remove unsuccessful"); assert!(v == v_check); assert!(hm.len() == t.len()); t.check_nodes(); } _ => match t.remove(&r) { Some(_v) => { panic!("remove unsuccessful"); } _ => {} }, } } }
rust_cleaned_test_functions.jsonl/78805
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 616 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 68544, 17678, 18193, 33864, 368, 341, 262, 1077, 5206, 259, 25, 8942, 49, 65, 27, 285, 551, 11, 91373, 29, 284, 8942, 49, 65, 486, 931, 1428, 262, 1077, 14262, 284, 47889, 486, 1499, 4080, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
#[test] fn test_enqueue_dequeue_parallel() { // Generate data: let dataset = data_lots_of_data().take(100_000).collect::<Vec<_>>(); let arc_sender = Arc::new(dataset); let arc_receiver = arc_sender.clone(); let enqueue = std::thread::spawn(move || { futures::executor::block_on(async { let mut sender = Sender::open("data/enqueue-dequeue-parallel").unwrap(); for data in &*arc_sender { sender.send(data).await.unwrap(); } }); }); // Dequeue: let dequeue = std::thread::spawn(move || { futures::executor::block_on(async { let mut receiver = Receiver::open("data/enqueue-dequeue-parallel").unwrap(); let dataset_iter = arc_receiver.iter(); let mut i = 0u64; for should_be in dataset_iter { let data = receiver.recv().await.unwrap(); assert_eq!(&*data, should_be, "at sample {}", i); i += 1; data.commit().unwrap(); } }); }); enqueue.join().expect("enqueue thread panicked"); dequeue.join().expect("dequeue thread panicked"); }
rust_cleaned_test_functions.jsonl/95819
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 687 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28395, 2259, 4584, 60625, 368, 341, 286, 442, 19813, 821, 510, 286, 1077, 10337, 284, 821, 907, 2412, 3575, 1769, 1005, 22769, 7, 16, 15, 15, 62, 15, 15, 15, 568, 17384, 27638, 10050, 32399, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
#[test] fn test_part1() { let numbers = (1..=25).chain(vec![26, 49, 100, 50].into_iter()).collect(); assert_eq!(Day09::part1(&numbers).unwrap(), 100); }
rust_cleaned_test_functions.jsonl/110995
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 87 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10495, 16, 368, 341, 286, 1077, 5109, 284, 320, 16, 496, 28, 17, 20, 568, 8819, 25592, 20703, 17, 21, 11, 220, 19, 24, 11, 220, 16, 15, 15, 11, 220, 20, 15, 936, 18122, 11723, 6011, 17384,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_binary() { assert_eq!(binary("0b0101"), Ok(("", 0b0101))); assert_eq!(binary("0b01_10"), Ok(("", 0b0110))); assert_eq!(binary("0b01___10"), Ok(("", 0b0110))); assert_eq!(binary("0b0110_"), Ok(("", 0b0110))); assert!(binary("0b_0110").is_err()); assert!(binary("0b20").is_err()); assert!(binary("0bb").is_err()); }
rust_cleaned_test_functions.jsonl/116073
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 209 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31761, 368, 341, 286, 2060, 10714, 10297, 25891, 445, 15, 65, 15, 16, 15, 16, 3975, 7622, 7, 19814, 220, 15, 65, 15, 16, 15, 16, 4945, 286, 2060, 10714, 10297, 25891, 445, 15, 65, 15, 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_convert_from_string() { assert_eq!( dr::Operand::LiteralString("wow".to_string()), dr::Operand::from("wow") ); assert_eq!( dr::Operand::LiteralString("wow".to_string()), dr::Operand::from("wow".to_string()) ); }
rust_cleaned_test_functions.jsonl/49202
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 175 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 34910, 5673, 3904, 368, 341, 286, 2060, 10714, 33673, 310, 1353, 486, 29940, 486, 17350, 703, 445, 57454, 3263, 983, 3904, 14702, 310, 1353, 486, 29940, 486, 1499, 445, 57454, 1138, 286, 1439, 286...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_insert_only_semiglobal() { let x = b"TTTT"; let y = b"AAAA"; let score = |a: u8, b: u8| if a == b { 1i32 } else { -3i32 }; let mut aligner = banded::Aligner::new(-5, -1, &score, 10, 10); let alignment = aligner.semiglobal(x, y); assert_eq!(alignment.operations, [Ins, Ins, Ins, Ins]); }
rust_cleaned_test_functions.jsonl/126757
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 181 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17678, 18410, 30442, 343, 2042, 368, 341, 286, 1077, 856, 284, 293, 1, 14903, 14903, 876, 286, 1077, 379, 284, 293, 1, 25699, 3302, 286, 1077, 5456, 284, 760, 64, 25, 575, 23, 11, 293, 25, 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_read_blob_123() -> IonResult<()> { let mut cursor = ion_cursor_for(&[0xA3, 0x01, 0x02, 0x03]); assert_eq!(cursor.next()?, Some(Value(IonType::Blob, false))); assert_eq!(cursor.read_blob_bytes()?, Some(vec![1u8, 2, 3])); Ok(()) }
rust_cleaned_test_functions.jsonl/82748
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 152 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 45908, 62, 16, 17, 18, 368, 1464, 44805, 2077, 71698, 341, 286, 1077, 5206, 8128, 284, 27672, 28601, 5478, 2099, 58, 15, 14673, 18, 11, 220, 15, 87, 15, 16, 11, 220, 15, 87, 15, 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...
3
#[test] fn test_apply_mask() { let mask = [0x6d, 0xb6, 0xb2, 0x80]; let mask_u32 = u32::from_le_bytes(mask); let unmasked = vec![ 0xf3, 0x00, 0x01, 0x02, 0x03, 0x80, 0x81, 0x82, 0xff, 0xfe, 0x00, 0x17, 0x74, 0xf9, 0x12, 0x03, ]; // Check masking with proper alignment. { let mut masked = unmasked.clone(); apply_mask_fallback(&mut masked, &mask); let mut masked_fast = unmasked.clone(); apply_mask(&mut masked_fast, mask_u32); assert_eq!(masked, masked_fast); } // Check masking without alignment. { let mut masked = unmasked.clone(); apply_mask_fallback(&mut masked[1..], &mask); let mut masked_fast = unmasked; apply_mask(&mut masked_fast[1..], mask_u32); assert_eq!(masked, masked_fast); } }
rust_cleaned_test_functions.jsonl/12129
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 503 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 36551, 9999, 368, 341, 286, 1077, 6911, 284, 508, 15, 87, 21, 67, 11, 220, 15, 7929, 21, 11, 220, 15, 7929, 17, 11, 220, 15, 87, 23, 15, 935, 286, 1077, 6911, 7300, 18, 17, 284, 575, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_datetime() { let start_date = dt(2015, 1, 24, 22, 0, 0); assert_eq!(gigasecond::after(start_date), dt(2046, 10, 2, 23, 46, 40)); }
rust_cleaned_test_functions.jsonl/111678
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 80 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28943, 368, 341, 262, 1077, 1191, 4164, 284, 7594, 7, 17, 15, 16, 20, 11, 220, 16, 11, 220, 17, 19, 11, 220, 17, 17, 11, 220, 15, 11, 220, 15, 626, 262, 2060, 10714, 10297, 70, 343, 519,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_timeout() { let mut executor = fuchsia_async::TestExecutor::new_with_fake_time().expect("Failed to create executor"); let fut = async move { let setting_type = SettingType::Unknown; let environment = TestEnvironmentBuilder::new(setting_type) .set_timeout(SETTING_PROXY_TIMEOUT_MS.millis(), true) .build() .await; let mut event_receptor = service::build_event_listener(&environment.delegate).await; // Queue up to ignore resquests for _ in 0..SETTING_PROXY_MAX_ATTEMPTS { environment .setting_handler .lock() .await .queue_action(Request::Get, HandlerAction::Ignore); } let request = Request::Get; // Send request. let mut receptor = environment .delegate .create(MessengerType::Unbound) .await .expect("messenger should be created") .0 .message( HandlerPayload::Request(request.clone()).into(), Audience::Address(service::Address::Handler(setting_type)), ) .send(); assert_matches!( receptor.next_of::<HandlerPayload>().await.expect("should receive response").0, HandlerPayload::Response(Err(HandlerError::TimeoutError)) ); for _ in 0..SETTING_PROXY_MAX_ATTEMPTS { verify_handler_event( setting_type, event_receptor .next_of::<event::Payload>() .await .expect("should be notified of execute") .0, event::handler::Event::Request(event::handler::Action::Execute, request.clone()), ); verify_handler_event( setting_type, event_receptor .next_of::<event::Payload>() .await .expect("should be notified of timeout") .0, event::handler::Event::Request(event::handler::Action::Timeout, request.clone()), ); verify_handler_event( setting_type, event_receptor .next_of::<event::Payload>() .await .expect("should be notified of reattempt") .0, event::handler::Event::Request(event::handler::Action::Retry, request.clone()), ); } // Ensure that the final event reports that attempts were exceeded verify_handler_event( setting_type, event_receptor .next_of::<event::Payload>() .await .expect("should be notified of exceeded attempts") .0, event::handler::Event::Request( event::handler::Action::AttemptsExceeded, request.clone(), ), ); }; pin_utils::pin_mut!(fut); let _result = loop { executor.wake_main_future(); let new_time = fuchsia_async::Time::from_nanos( executor.now().into_nanos() + fuchsia_zircon::Duration::from_millis(SETTING_PROXY_TIMEOUT_MS).into_nanos(), ); match executor.run_one_step(&mut fut) { Some(Poll::Ready(x)) => break x, None => panic!("Executor stalled"), Some(Poll::Pending) => { executor.set_fake_time(new_time); } } }; }
rust_cleaned_test_functions.jsonl/89528
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1920 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 20537, 368, 341, 262, 1077, 5206, 31558, 4035, 286, 282, 73391, 28346, 486, 2271, 25255, 486, 931, 6615, 56881, 3009, 1005, 17119, 445, 9408, 311, 1855, 31558, 3071, 262, 1077, 17645, 284, 3312, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
#[test] fn test_doc_comment_multi_line_block_strips_suffix() { let file = SourceFile::parse( r#" /** this is mod foo */ mod foo {} "#, ) .ok() .unwrap(); let module = file.syntax().descendants().find_map(Module::cast).unwrap(); assert_eq!( " this\n is\n mod foo\n ", module.doc_comment_text().unwrap() ); }
rust_cleaned_test_functions.jsonl/50916
{ "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, 18869, 17638, 25133, 6528, 7113, 1261, 75716, 37151, 368, 341, 262, 1077, 1034, 284, 8748, 1703, 486, 6400, 1006, 286, 435, 2, 698, 286, 1554, 286, 419, 198, 286, 374, 198, 286, 1463, 15229, 198...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_renaming_of_barrier_instruction() { // Given: barrier let mut instruction = Instruction::barrier(); let mut versioning = VariableVersioning::new(); versioning.start_new_scope(); instruction.rename_variables(&mut versioning).unwrap(); // Expected: barrier assert_eq!(instruction, Instruction::barrier()); }
rust_cleaned_test_functions.jsonl/13493
{ "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, 1288, 77, 6469, 3575, 82355, 54923, 368, 341, 286, 442, 16246, 25, 22103, 198, 286, 1077, 5206, 7600, 284, 29051, 486, 2257, 7253, 1428, 286, 1077, 5206, 2319, 287, 284, 12407, 5637, 287, 486, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_scalar_inverse() { assert!(Scalar::zero().inverse().is_none()); let mut rng = XorShiftRng::from_seed([ 0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc, 0xe5, ]); let one = Scalar::one(); for i in 0..1000 { // Ensure that a * a^-1 = 1 let mut a = Scalar::random(&mut rng); let ainv = a.inverse().unwrap(); a.mul_assign(&ainv); assert_eq!(a, one, "round {}", i); } }
rust_cleaned_test_functions.jsonl/56400
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 337 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 41652, 63333, 368, 341, 286, 2060, 10297, 20639, 486, 14154, 1005, 61482, 1005, 285, 31488, 5231, 286, 1077, 5206, 28422, 284, 1599, 269, 24841, 49, 968, 486, 1499, 33809, 8956, 310, 220, 15, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_iter_product_generic() { let data = vec![1001, -1002, 1003, -1004, 1005]; let result = data[0].to_bigint().unwrap() * data[1].to_bigint().unwrap() * data[2].to_bigint().unwrap() * data[3].to_bigint().unwrap() * data[4].to_bigint().unwrap(); assert_eq!(result, data.iter().product()); assert_eq!(result, data.into_iter().product()); }
rust_cleaned_test_functions.jsonl/56652
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 188 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11723, 9840, 41232, 368, 341, 262, 1077, 821, 284, 7486, 20703, 16, 15, 15, 16, 11, 481, 16, 15, 15, 17, 11, 220, 16, 15, 15, 18, 11, 481, 16, 15, 15, 19, 11, 220, 16, 15, 15, 20, 935,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_gpu_devices() { unsafe { let resp = get_gpu_devices(); let strings = std::slice::from_raw_parts_mut( (*resp).devices_ptr as *mut *mut libc::c_char, (*resp).devices_len as usize, ); let devices: Vec<String> = strings .into_iter() .map(|s| { std::ffi::CStr::from_ptr(*s) .to_str() .unwrap_or("Unknown") .to_owned() }) .collect(); assert_eq!(devices.len(), (*resp).devices_len); destroy_gpu_device_response(resp); } }
rust_cleaned_test_functions.jsonl/30875
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 441 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 35628, 41334, 368, 341, 286, 19860, 341, 310, 1077, 9039, 284, 633, 35628, 41334, 1428, 310, 1077, 9069, 284, 1460, 486, 24963, 486, 1499, 16067, 33217, 29523, 1006, 394, 4609, 18243, 568, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_ts_filter_lost_delete() { let dir = tempfile::Builder::new() .prefix("test_ts_filter_lost_deletion") .tempdir() .unwrap(); let path = dir.path().to_str().unwrap(); let region = make_region(1, vec![0], vec![]); let db = open_db(&path, true); let mut engine = RegionEngine::new(&db, &region); let key1 = &[1]; engine.put(key1, 2, 3); engine.flush(); engine.compact(); let key2 = &[2]; engine.put(key2, 6, 7); engine.delete(key1, 4, 5); engine.gc(key1, 6); engine.flush(); let mut iopt = IterOption::default(); iopt.set_hint_min_ts(Bound::Included(1)); iopt.set_hint_max_ts(Bound::Included(6)); let snap = RegionSnapshot::<RocksEngine>::from_raw(db, region); let mut iter = snap.iter_cf(CF_WRITE, iopt).unwrap(); // Must not omit the latest deletion of key1 to prevent seeing outdated record. assert_eq!(iter.seek_to_first().unwrap(), true); assert_eq!( Key::from_encoded_slice(iter.key()) .to_raw() .unwrap() .as_slice(), key2 ); assert_eq!(iter.next().unwrap(), false); }
rust_cleaned_test_functions.jsonl/14865
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 689 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 25023, 8727, 88661, 11353, 368, 341, 286, 1077, 5419, 284, 54819, 486, 3297, 486, 931, 741, 310, 659, 11849, 445, 1944, 25023, 8727, 88661, 2259, 52625, 1138, 310, 659, 3888, 3741, 741, 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_generic_class() { ok("class A[T]"); ok("class A[X, Y]"); err( "class A[T, T]", pos(1, 12), SemError::TypeParamNameNotUnique("T".into()), ); err("class A[]", pos(1, 1), SemError::TypeParamsExpected); }
rust_cleaned_test_functions.jsonl/84184
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 171 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 41232, 4790, 368, 341, 286, 5394, 445, 1040, 362, 20340, 37389, 286, 5394, 445, 1040, 362, 50044, 11, 809, 37389, 286, 1848, 1006, 310, 330, 1040, 362, 20340, 11, 350, 45016, 310, 1133, 7, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_no_ignore_parent() { let dirs = &["inner"]; let files = &[ "inner/parent-ignored", "inner/child-ignored", "inner/not-ignored", ]; let te = TestEnv::new(dirs, files); // Ignore 'parent-ignored' in root fs::File::create(te.test_root().join(".gitignore")) .unwrap() .write_all(b"parent-ignored") .unwrap(); // Ignore 'child-ignored' in inner fs::File::create(te.test_root().join("inner/.gitignore")) .unwrap() .write_all(b"child-ignored") .unwrap(); te.assert_output_subdirectory("inner", &[], "not-ignored"); te.assert_output_subdirectory( "inner", &["--no-ignore-parent"], "parent-ignored not-ignored", ); }
rust_cleaned_test_functions.jsonl/65594
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 373 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6536, 58493, 15960, 368, 341, 262, 1077, 42248, 284, 609, 1183, 4382, 6332, 262, 1077, 3542, 284, 609, 9640, 286, 330, 4382, 14, 3765, 12, 58471, 756, 286, 330, 4382, 14, 3048, 12, 58471, 756, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_cidr() { let cidr = Cidr::new(LINK_LOCAL_ADDR, 64); let inside_subnet = [ [0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02], [0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88], [0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], [0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff] ]; let outside_subnet = [ [0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], [0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], [0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02] ]; let subnets = [ ([0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], 65), ([0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], 128), ([0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x34, 0x56, 0x78], 96) ]; let not_subnets = [ ([0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], 63), ([0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], 64), ([0xfe, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff], 65), ([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01], 128) ]; for addr in inside_subnet.iter().map(|a| Address::from_bytes(a)) { assert!(cidr.contains_addr(&addr)); } for addr in outside_subnet.iter().map(|a| Address::from_bytes(a)) { assert!(!cidr.contains_addr(&addr)); } for subnet in subnets.iter().map( |&(a, p)| Cidr::new(Address(a), p)) { assert!(cidr.contains_subnet(&subnet)); } for subnet in not_subnets.iter().map( |&(a, p)| Cidr::new(Address(a), p)) { assert!(!cidr.contains_subnet(&subnet)); } let cidr_without_prefix = Cidr::new(LINK_LOCAL_ADDR, 0); assert!(cidr_without_prefix.contains_addr(&Address::LOOPBACK)); }
rust_cleaned_test_functions.jsonl/91030
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1952 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 68699, 81, 368, 341, 286, 1077, 32141, 81, 284, 356, 307, 81, 486, 931, 4957, 11637, 28399, 16058, 11, 220, 21, 19, 626, 286, 1077, 4766, 95681, 284, 2278, 310, 508, 15, 31469, 11, 220, 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...
5
#[test] fn test_build_i32() { let mut builder = PlainPrimitiveNullableBlockBuilder::<i32>::new(128); builder.append(Some(&1)); builder.append(None); builder.append(Some(&3)); builder.append(Some(&4)); assert_eq!(builder.estimated_size(), 17); assert!(!builder.should_finish(&Some(&5))); let data = builder.finish(); let expected_data: Vec<u8> = vec![1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 13]; assert_eq!(data, expected_data); }
rust_cleaned_test_functions.jsonl/62262
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 262 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 20801, 5318, 18, 17, 368, 341, 286, 1077, 5206, 7363, 284, 43199, 33313, 15703, 4713, 3297, 27638, 72, 18, 17, 6831, 931, 7, 16, 17, 23, 317, 286, 7363, 2057, 65405, 2099, 16, 1106, 286, 7363,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_expr_key() { assert_parse_length_expr("key", &["key"], "_self.get_key() as usize"); assert_parse_length_expr( "another_key", &["another_key"], "_self.get_another_key() as usize", ); assert_parse_length_expr( "get_something", &["get_something"], "_self.get_get_something() as usize", ); }
rust_cleaned_test_functions.jsonl/114321
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 229 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 21915, 3097, 368, 341, 286, 2060, 21039, 5118, 21915, 445, 792, 497, 609, 1183, 792, 7914, 9000, 721, 670, 3097, 368, 438, 22301, 797, 286, 2060, 21039, 5118, 21915, 1006, 310, 330, 41963, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bencode_map() { let mut m1 = HashMap::new(); m1.insert(Value::Str("bar".to_string()), Value::Str("baz".to_string())); let m1_c = m1.clone(); let left1 = Value::Map(HMap::new(m1)); let mut m2 = HashMap::new(); m2.insert(Value::Str("foo".to_string()), Value::Map(HMap::new(m1_c))); let left2 = Value::Map(HMap::new(m2)); let sright1 = "d3:bar3:baze".to_string(); let mut right1 = BufReader::new(sright1.as_bytes()); assert_eq!(left1, parse_bencode(&mut right1).unwrap().unwrap()); assert_eq!(left1.to_bencode(), sright1); let sright2 = "d3:food3:bar3:bazee".to_string(); let mut right2 = BufReader::new(sright2.as_bytes()); assert_eq!(left2, parse_bencode(&mut right2).unwrap().unwrap()); assert_eq!(left2.to_bencode(), sright2); }
rust_cleaned_test_functions.jsonl/107903
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 429 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 880, 6180, 5376, 368, 341, 286, 1077, 5206, 296, 16, 284, 10528, 486, 931, 543, 286, 296, 16, 7030, 25346, 486, 2580, 445, 2257, 3263, 983, 3904, 11858, 5162, 486, 2580, 445, 42573, 3263,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_canonicalize_idents_different_protocls() { let ident1 = ident(&Remote(url("https://github.com/PistonDevelopers/piston"))); let ident2 = ident(&Remote(url("git://github.com/PistonDevelopers/piston"))); assert_eq!(ident1, ident2); }
rust_cleaned_test_functions.jsonl/29923
{ "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, 27421, 22391, 551, 842, 805, 82741, 22357, 509, 4730, 368, 341, 286, 1077, 3524, 16, 284, 3524, 2099, 24703, 6522, 445, 2428, 1110, 5204, 905, 16341, 58819, 20444, 388, 4322, 58819, 17621, 286, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_reference_vector_l3_nonstandard_compl_sideinfo_size() { let test_vector = include_bytes!("../vectors/l3-nonstandard-compl-sideinfo-size.bit"); test_vs_minimp3(test_vector); }
rust_cleaned_test_functions.jsonl/69849
{ "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, 25433, 12247, 907, 18, 21637, 20270, 2965, 500, 30862, 2733, 2368, 368, 341, 262, 1077, 1273, 12247, 284, 2924, 12524, 17223, 1244, 85, 10605, 13328, 18, 98700, 20270, 11476, 500, 24067, 2733, 7174,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_spec() { assert!(matches!(parse_spec(":", ':'), Ok((None, None)))); assert!(matches!(parse_spec(".", ':'), Ok((None, None)))); assert!(matches!(parse_spec(".", '.'), Ok((None, None)))); assert!(format!("{}", parse_spec("::", ':').err().unwrap()).starts_with("invalid group: ")); assert!(format!("{}", parse_spec("..", ':').err().unwrap()).starts_with("invalid group: ")); }
rust_cleaned_test_functions.jsonl/36087
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 202 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 13594, 368, 341, 286, 2060, 10297, 19914, 10297, 6400, 13594, 445, 12147, 13592, 4567, 7622, 1188, 4064, 11, 2240, 38776, 286, 2060, 10297, 19914, 10297, 6400, 13594, 64217, 13592, 4567, 7622, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_bpf_loader_non_terminating_program() { #[rustfmt::skip] let program = &[ 0x07, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // r6 + 1 0x05, 0x00, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, // goto -2 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exit ]; let input = &mut [0x00]; let mut vm = EbpfVm::<BPFError>::new(None).unwrap(); vm.set_verifier(bpf_verifier::check).unwrap(); let instruction_meter = TestInstructionMeter { remaining: 10 }; vm.set_program(program).unwrap(); vm.execute_program_metered(input, &[], &[], instruction_meter) .unwrap(); }
rust_cleaned_test_functions.jsonl/127042
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 374 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 15897, 22139, 21637, 62, 22969, 1095, 25096, 368, 341, 286, 11506, 35788, 12501, 486, 20599, 921, 286, 1077, 2025, 284, 609, 9640, 310, 220, 15, 87, 15, 22, 11, 220, 15, 87, 15, 16, 11, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_block_builder_panics() { let mut d = get_data(); // Identical key as d[3]. d[4].0 = b"prefix_key1"; let mut builder = BlockBuilder::new(options::for_test()); for &(k, v) in d.iter() { builder.add(k, v); assert_eq!(k, builder.last_key()); } }
rust_cleaned_test_functions.jsonl/132373
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 179 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7113, 28532, 71099, 1211, 368, 341, 286, 1077, 5206, 294, 284, 633, 1769, 543, 286, 442, 22507, 938, 1376, 438, 294, 58, 18, 26126, 286, 294, 58, 19, 936, 15, 284, 293, 1, 11849, 3097, 16, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_extra_feature_args() { let cargo_extra_args = "--no-default-features --features a b --target x86_64-unknown-linux-musl --features=c --lib"; let cargo_extra_args = split_extra_args(&[cargo_extra_args.to_string()]).unwrap(); let cargo_metadata_extra_args = extra_feature_args(&cargo_extra_args); assert_eq!( cargo_metadata_extra_args, vec![ "--no-default-features", "--features", "a", "b", "--features=c" ] ); }
rust_cleaned_test_functions.jsonl/4515
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 313 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31858, 17069, 8384, 368, 341, 286, 1077, 25652, 31858, 8384, 284, 14482, 2152, 13672, 12, 20304, 1177, 20304, 264, 293, 1177, 5657, 856, 23, 21, 62, 21, 19, 12, 16088, 46375, 1448, 355, 75, 1177...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_256() { assert_eq!(Some(Colour::Fixed(115).normal()), LsColors::parse_style("38;5;115")); assert_eq!(Some(Colour::Fixed(115).normal()), LsColors::parse_style("00;38;5;115")); assert_eq!(Some(Colour::Fixed(119).bold()), LsColors::parse_style("01;38;5;119")); assert_eq!(Some(Colour::Fixed(119).bold()), LsColors::parse_style("38;5;119;01")); }
rust_cleaned_test_functions.jsonl/90576
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 235 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 62, 17, 20, 21, 368, 341, 262, 2060, 10714, 10297, 8373, 3025, 337, 413, 486, 13520, 7, 16, 16, 20, 568, 8252, 14702, 2290, 444, 82, 13108, 486, 6400, 15117, 445, 18, 23, 26, 20, 26, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_load_image() { // Read and write back image. let image = Image::read_from_file(&testdata!("test_image.bin")).unwrap(); image .write_to_file(&testdata!("test_image_out.bin")) .unwrap(); // Ensure the result is identical to the original. let (mut orig_bytes, mut res_bytes) = (Vec::<u8>::new(), Vec::<u8>::new()); File::open(&testdata!("test_image.bin")) .unwrap() .read_to_end(&mut orig_bytes) .unwrap(); File::open(&testdata!("test_image_out.bin")) .unwrap() .read_to_end(&mut res_bytes) .unwrap(); assert_eq!(orig_bytes, res_bytes); }
rust_cleaned_test_functions.jsonl/12334
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 366 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12411, 4954, 368, 341, 286, 442, 4457, 323, 3270, 1182, 2168, 624, 286, 1077, 2168, 284, 4654, 486, 878, 5673, 2458, 2099, 92425, 17223, 1944, 4954, 29394, 15197, 15454, 543, 286, 2168, 198, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_extract_link_at_end_of_line() { let link = "http://www.apache.org/licenses/LICENSE-2.0"; let input = format!("{}\n", link); let found = extract_links_from_markdown(&input); assert_eq!(vec![link], found); let found = extract_links_from_plaintext(&input); assert_eq!(vec![link], found); let found = extract_links_from_html(&input); assert_eq!(vec![link], found); }
rust_cleaned_test_functions.jsonl/93885
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 209 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 39123, 7233, 3752, 6213, 3575, 6528, 368, 341, 286, 1077, 2656, 284, 330, 1254, 1110, 2136, 5096, 2659, 6971, 10845, 12, 17, 13, 15, 876, 286, 1077, 1946, 284, 3561, 17223, 87963, 77, 497, 2656,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_emit_and_read_header() { let mut message = Message::new(); message .set_id(10) .set_message_type(MessageType::Response) .set_op_code(OpCode::Update) .set_authoritative(true) .set_truncated(false) .set_recursion_desired(true) .set_recursion_available(true) .set_response_code(ResponseCode::ServFail); test_emit_and_read(message); }
rust_cleaned_test_functions.jsonl/23868
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 204 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 69082, 8378, 6443, 8757, 368, 341, 262, 1077, 5206, 1943, 284, 4856, 486, 931, 543, 262, 1943, 198, 286, 659, 746, 842, 7, 16, 15, 340, 286, 659, 746, 6462, 1819, 29359, 929, 486, 2582, 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_mul_assign() { let mut x = Number128::from(10_u64); let y = Number128::from(2_u64); x.try_mul_assign(y).unwrap(); assert_eq!(x, Number128::from(20_u64)); }
rust_cleaned_test_functions.jsonl/53699
{ "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, 24944, 20688, 368, 341, 286, 1077, 5206, 856, 284, 5624, 16, 17, 23, 486, 1499, 7, 16, 15, 7300, 21, 19, 317, 286, 1077, 379, 284, 5624, 16, 17, 23, 486, 1499, 7, 17, 7300, 21, 19, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_validate_transaction_fee() { { // Zero fees gets rejected let (tx, _ledger) = create_test_tx_with_amount(INITIALIZE_LEDGER_AMOUNT, 0); assert_eq!( validate_transaction_fee(&tx), Err(TransactionValidationError::TxFeeError) ); } { // Off by one fee gets rejected let fee = MINIMUM_FEE - 1; let (tx, _ledger) = create_test_tx_with_amount(INITIALIZE_LEDGER_AMOUNT - fee, fee); assert_eq!( validate_transaction_fee(&tx), Err(TransactionValidationError::TxFeeError) ); } { // Exact fee amount is okay let (tx, _ledger) = create_test_tx_with_amount(INITIALIZE_LEDGER_AMOUNT - MINIMUM_FEE, MINIMUM_FEE); assert_eq!(validate_transaction_fee(&tx), Ok(())); } { // Overpaying fees is okay let fee = MINIMUM_FEE + 1; let (tx, _ledger) = create_test_tx_with_amount(INITIALIZE_LEDGER_AMOUNT - fee, fee); assert_eq!(validate_transaction_fee(&tx), Ok(())); } }
rust_cleaned_test_functions.jsonl/78566
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 657 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 42681, 28884, 34305, 368, 341, 286, 341, 310, 442, 18306, 12436, 5221, 17551, 198, 310, 1077, 320, 3998, 11, 716, 50704, 8, 284, 1855, 4452, 17805, 6615, 13471, 23515, 952, 6208, 3282, 37604, 8738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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 a: EdwardsAffine = rand::random(); let b: EdwardsAffine = rand::random(); let a_b = { use crate::groups::Group; (a + &b).double().double() }; let a_b2 = (a.into_projective() + &b.into_projective()) .double() .double(); assert_eq!(a_b, a_b2.into_affine()); assert_eq!(a_b.into_projective(), a_b2); }
rust_cleaned_test_functions.jsonl/128406
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 193 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 64132, 368, 341, 262, 1077, 264, 25, 36763, 25841, 482, 284, 10382, 486, 11463, 543, 262, 1077, 293, 25, 36763, 25841, 482, 284, 10382, 486, 11463, 543, 262, 1077, 264, 880, 284, 341, 286, 990, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_overhangs1() { let x = b"CGCTATACAGTAAGTAGTAGTACACGTGTCACAGTTGTACTAGCATGAC"; let y = b"AGCACAAGTGTGAGCACAAGTGTGCGCTATACAGGAAGTAGGAGTACACGTGTCACATTTGTACTAGCATGAC"; compare_to_full_alignment_local(x, y); compare_to_full_alignment_global(x, y); compare_to_full_alignment_semiglobal(x, y); }
rust_cleaned_test_functions.jsonl/126731
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 191 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15431, 20658, 82, 16, 368, 341, 286, 1077, 856, 284, 293, 1, 8798, 1162, 828, 1706, 1890, 15204, 1890, 32144, 32144, 51, 1706, 1706, 25388, 38, 7749, 1706, 1890, 14903, 25388, 6823, 1890, 28196, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_index() { let mut map: VecMap<int> = VecMap::new(); map.insert(1, 2); map.insert(2, 1); map.insert(3, 4); assert_eq!(map[3], 4); }
rust_cleaned_test_functions.jsonl/108803
{ "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, 3560, 368, 341, 286, 1077, 5206, 2415, 25, 11312, 2227, 4159, 29, 284, 11312, 2227, 486, 931, 1428, 286, 2415, 7030, 7, 16, 11, 220, 17, 317, 286, 2415, 7030, 7, 17, 11, 220, 16, 317, 286, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_hash_idempotent() { let val64 = 0xdeadbeef_deadbeef_u64; assert_eq!(hash(&val64), hash(&val64)); let val32 = 0xdead_beef_u32; assert_eq!(hash(&val32), hash(&val32)); }
rust_cleaned_test_functions.jsonl/35428
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 119 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8950, 842, 3262, 63532, 368, 341, 286, 1077, 1044, 21, 19, 284, 220, 15, 87, 33754, 1371, 823, 53427, 1371, 823, 7300, 21, 19, 280, 286, 2060, 10714, 10297, 8296, 2099, 831, 21, 19, 701, 5175,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_create_tx_public_key() { run_with_several_seeds(|mut rng| { let r = Scalar::random(&mut rng); let D = RistrettoPoint::random(&mut rng); let expected = RistrettoPublic::from(r * D); let tx_private_key = RistrettoPrivate::from(r); let recipient_spend_key = RistrettoPublic::from(D); assert_eq!( expected, create_tx_out_public_key(&tx_private_key, &recipient_spend_key) ); }) }
rust_cleaned_test_functions.jsonl/56127
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 287 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8657, 17805, 27074, 3097, 368, 341, 286, 1598, 6615, 3453, 17539, 3453, 6767, 22428, 6984, 28422, 91, 341, 310, 1077, 435, 284, 35176, 486, 11463, 2099, 6984, 28422, 317, 310, 1077, 422, 284, 431,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1