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_rollback_past_genesis() { let (_, handler) = init_handler(Height(4)); let err = request::delete( "http://localhost:3000/v1/blocks/0", Headers::new(), &handler, ).unwrap_err(); assert!( response::extract_body_to_string(err.response) .contains("Cannot rollback past genesis block") ); }
rust_cleaned_test_functions.jsonl/14768
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 212 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 62, 33559, 93019, 16322, 13774, 368, 341, 286, 1077, 39464, 7013, 8, 284, 2930, 10183, 7, 3640, 7, 19, 3237, 286, 1077, 1848, 284, 1681, 486, 4542, 1006, 310, 330, 1254, 1110, 8301, 25, 18, 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_read_header_with_invalid_line_comment_prefix() { let data = [ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, // col_seq = 1 0x04, 0x00, 0x00, 0x00, // col_beg = 4 0x05, 0x00, 0x00, 0x00, // col_end = 5 0x5c, 0xf3, 0x01, 0x00, // meta = '🍜' 0x00, 0x00, 0x00, 0x00, // skip = 0 ]; let mut reader = &data[..]; assert!(read_header(&mut reader).is_err()); }
rust_cleaned_test_functions.jsonl/83485
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 296 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 8757, 6615, 31433, 6528, 17638, 13974, 368, 341, 286, 1077, 821, 284, 2278, 310, 220, 15, 87, 15, 15, 11, 220, 15, 87, 15, 15, 11, 220, 15, 87, 15, 15, 11, 220, 15, 87, 15, 15, 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_convert_monotype_int() { let monotype = Parser::new("int").parse_monotype(); let mut m = BTreeMap::<String, types::Tvar>::new(); let got = convert_monotype(&monotype, &mut m, &mut sub::Substitution::default()).unwrap(); let want = MonoType::INT; assert_eq!(want, got); }
rust_cleaned_test_functions.jsonl/131388
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 149 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 34910, 20737, 4156, 4042, 368, 341, 286, 1077, 1615, 4156, 284, 21102, 486, 931, 445, 396, 1827, 6400, 20737, 4156, 543, 286, 1077, 5206, 296, 284, 425, 6533, 2227, 27638, 703, 11, 4494, 486, 51...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_memory_context() { test_in_db("memory_context", |mut conn| { let result = conn.query("SELECT allocate()", &[]).expect("query failed"); assert_eq!(result.len(), 1); }); }
rust_cleaned_test_functions.jsonl/10800
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 92 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19195, 8467, 368, 341, 262, 1273, 1243, 8685, 445, 17269, 8467, 497, 760, 6984, 4534, 91, 341, 286, 1077, 1102, 284, 4534, 4786, 445, 4858, 22089, 50514, 609, 1294, 568, 17119, 445, 1631, 4641, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_file_stem() { assert_eq!(file_stem(Path::new("foo")).unwrap(), "foo"); assert_eq!(file_stem(Path::new("foo.tar")).unwrap(), "foo"); assert_eq!(file_stem(Path::new("foo.tar.gz")).unwrap(), "foo"); assert_eq!(file_stem(Path::new("foo.bar.tar")).unwrap(), "foo.bar"); }
rust_cleaned_test_functions.jsonl/66597
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 156 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2458, 1261, 336, 368, 341, 286, 2060, 10714, 10297, 1192, 1261, 336, 33030, 486, 931, 445, 7975, 15197, 15454, 1507, 330, 7975, 797, 286, 2060, 10714, 10297, 1192, 1261, 336, 33030, 486, 931, 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_pair() { let (mut a, my_env) = test_env(); let syntax = new_apply( new_apply(new_identifier("pair"), new_apply(new_identifier("f"), new_identifier("4"))), new_apply(new_identifier("f"), new_identifier("true"))); let _ = analyse(&mut a, &syntax, &my_env, &hashset![]); }
rust_cleaned_test_functions.jsonl/127652
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 145 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 14445, 368, 341, 262, 1077, 320, 6984, 264, 11, 847, 15879, 8, 284, 1273, 15879, 1428, 1066, 262, 1077, 19482, 284, 501, 36551, 1006, 286, 501, 36551, 1755, 33176, 445, 12670, 3975, 501, 36551, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_adjust_lockouts_after_replay_out_of_order() { use solana_sdk::slot_history::MAX_ENTRIES; let mut tower = Tower::new_for_tests(10, 0.9); tower .vote_state .votes .push_back(Lockout::new(MAX_ENTRIES - 1)); tower.vote_state.votes.push_back(Lockout::new(0)); tower.vote_state.votes.push_back(Lockout::new(1)); let vote = Vote::new(vec![1], Hash::default()); tower.last_vote = vote; let mut slot_history = SlotHistory::default(); slot_history.add(MAX_ENTRIES); let result = tower.adjust_lockouts_after_replay(MAX_ENTRIES, &slot_history); assert_eq!( format!("{}", result.unwrap_err()), "The tower is fatally inconsistent with blockstore: not too old once after got too old?" ); }
rust_cleaned_test_functions.jsonl/61175
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 402 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 44153, 9818, 11672, 19844, 1288, 1363, 6068, 3575, 7869, 368, 341, 286, 990, 2048, 3362, 61783, 486, 21537, 19802, 486, 10586, 87695, 401, 286, 1077, 5206, 21271, 284, 21938, 486, 931, 5478, 32509, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_stdout_not_matches_fail() { let res = CmdResult { tmpd: None, code: None, success: true, stdout: "This is a likely error message\n".into(), stderr: "This is a likely error message\n".into(), }; let positive = regex::Regex::new(".*likely.*").unwrap(); res.stdout_does_not_match(&positive); }
rust_cleaned_test_functions.jsonl/74689
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 205 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 67416, 7913, 38344, 22121, 368, 341, 286, 1077, 592, 284, 40210, 2077, 341, 310, 4174, 67, 25, 2240, 345, 310, 2038, 25, 2240, 345, 310, 2393, 25, 830, 345, 310, 20075, 25, 330, 1986, 374, 264...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_intent() { // Given let classifier = get_sample_log_reg_classifier(); // When let classification_result = classifier.get_intent("Make me two cups of tea", None); let actual_result = classification_result.unwrap(); let expected_result = IntentClassifierResult { intent_name: Some("MakeTea".to_string()), confidence_score: 0.9088109819597295, }; // Then assert_eq!(expected_result, actual_result); }
rust_cleaned_test_functions.jsonl/76920
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 226 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 94249, 368, 341, 286, 442, 16246, 198, 286, 1077, 33365, 284, 633, 17491, 5224, 4920, 63329, 1428, 286, 442, 3197, 198, 286, 1077, 23850, 5287, 284, 33365, 670, 94249, 445, 8078, 752, 1378, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_1() { let mut trie = Trie::new(); trie.insert("apple".to_string()); assert!(trie.search("apple".to_string())); // return True assert!(!trie.search("app".to_string())); // return False assert!(trie.starts_with("app".to_string())); // return True trie.insert("app".to_string()); assert!(trie.search("app".to_string())); // return True }
rust_cleaned_test_functions.jsonl/17498
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 186 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 62, 16, 368, 341, 286, 1077, 5206, 59067, 284, 62783, 486, 931, 543, 286, 59067, 7030, 445, 22377, 3263, 983, 3904, 1423, 286, 2060, 10297, 8927, 9288, 445, 22377, 3263, 983, 3904, 76122, 442, 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_load_valid_configs() { for (name, val) in [("ignore", Mode::Ignore), ("reboot_on_failure", Mode::RebootOnFailure)].iter() { verify_load( json!({ "blobfs": name, }), Config::builder().blobfs(val.clone()).build(), ); } }
rust_cleaned_test_functions.jsonl/62754
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 223 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12411, 8337, 59150, 368, 341, 286, 369, 320, 606, 11, 1044, 8, 304, 198, 310, 84019, 13130, 497, 14562, 486, 12497, 701, 3489, 265, 4619, 4470, 43618, 497, 14562, 486, 693, 4619, 1925, 17507, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_should_retransmit() { let poh_slot = 4; let mut last_retransmit_slot = 4; assert!(!ReplayStage::should_retransmit( poh_slot, &mut last_retransmit_slot )); assert_eq!(last_retransmit_slot, 4); for poh_slot in 4..4 + NUM_CONSECUTIVE_LEADER_SLOTS { assert!(!ReplayStage::should_retransmit( poh_slot, &mut last_retransmit_slot )); assert_eq!(last_retransmit_slot, 4); } let poh_slot = 4 + NUM_CONSECUTIVE_LEADER_SLOTS; last_retransmit_slot = 4; assert!(ReplayStage::should_retransmit( poh_slot, &mut last_retransmit_slot )); assert_eq!(last_retransmit_slot, poh_slot); let poh_slot = 3; last_retransmit_slot = 4; assert!(ReplayStage::should_retransmit( poh_slot, &mut last_retransmit_slot )); assert_eq!(last_retransmit_slot, poh_slot); }
rust_cleaned_test_functions.jsonl/11058
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 595 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 43378, 1288, 1458, 1763, 368, 341, 286, 1077, 281, 2267, 27563, 284, 220, 19, 280, 286, 1077, 5206, 1537, 1288, 1458, 1763, 27563, 284, 220, 19, 280, 16885, 286, 2060, 0, 3471, 693, 1363, 19398,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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() { let s = "The %d'th word %% is: `%.*s` %!\n"; let subs: Vec<_> = iter_subs(s).map(|sub| sub.translate()).collect(); assert_eq!( subs.iter().map(|ms| ms.as_ref().map(|s| &s[..])).collect::<Vec<_>>(), vec![Some("{}"), None, Some("{:.*}"), None] ); }
rust_cleaned_test_functions.jsonl/22161
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 216 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11723, 368, 341, 310, 1077, 274, 284, 330, 785, 1018, 67, 944, 71, 3409, 23277, 374, 25, 61400, 4908, 82, 63, 1018, 14771, 77, 876, 310, 1077, 5147, 25, 11312, 32399, 29, 284, 5367, 82767, 114...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_wallet_token_info_real() { init!("ledger"); let wallet_info = get_wallet_token_info().unwrap(); assert_eq!(wallet_info.balance, 50000000000); }
rust_cleaned_test_functions.jsonl/10474
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 91 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 62308, 6458, 3109, 15266, 368, 341, 286, 2930, 17223, 50704, 797, 286, 1077, 15085, 3109, 284, 633, 62308, 6458, 3109, 1005, 15454, 543, 286, 2060, 10714, 10297, 35735, 3109, 39078, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_extend_ref() { let mut v = vec![1, 2]; v.extend(&[3, 4, 5]); assert_eq!(v.len(), 5); assert_eq!(v, [1, 2, 3, 4, 5]); let w = vec![6, 7]; v.extend(&w); assert_eq!(v.len(), 7); assert_eq!(v, [1, 2, 3, 4, 5, 6, 7]); }
rust_cleaned_test_functions.jsonl/24393
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 156 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 70265, 7793, 368, 341, 262, 1077, 5206, 348, 284, 7486, 20703, 16, 11, 220, 17, 935, 262, 348, 15831, 2099, 58, 18, 11, 220, 19, 11, 220, 20, 10149, 262, 2060, 10714, 10297, 85, 19406, 1507, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_report_attempts_to_successful_install_does_not_report_for_no_update() { block_on(async { let response = json!({"response":{ "server": "prod", "protocol": "3.0", "app": [{ "appid": "{00000000-0000-0000-0000-000000000001}", "status": "ok", "updatecheck": { "status": "noupdate", "info": "no update for you" } }], }}); let response = serde_json::to_vec(&response).unwrap(); let http = MockHttpRequest::new(HttpResponse::new(response.clone())); let storage = Rc::new(Mutex::new(MemStorage::new())); let mock_time = MockTimeSource::new_from_now(); let mut state_machine = StateMachineBuilder::new_stub() .http(http) .installer(TestInstaller::builder(mock_time.clone()).build()) .policy_engine(StubPolicyEngine::new(mock_time.clone())) .metrics_reporter(MockMetricsReporter::new()) .storage(Rc::clone(&storage)) .build() .await; state_machine.run_once().await; // patterns yet. #[rustfmt::skip] assert_matches!( state_machine.metrics_reporter.metrics.as_slice(), [ Metrics::UpdateCheckResponseTime { response_time: _, successful: true }, Metrics::RequestsPerCheck { count: 1, successful: true }, Metrics::AttemptsToSuccessfulCheck(1), ] ); }); }
rust_cleaned_test_functions.jsonl/59709
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 939 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 14813, 79490, 2346, 92951, 34245, 96374, 7913, 14813, 5478, 6536, 8882, 368, 341, 286, 2504, 4470, 18285, 341, 310, 1077, 2033, 284, 2951, 0, 16864, 2322, 12602, 1060, 330, 4030, 788, 330, 19748, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_base58check() { let key = String::from("P1hn3JnJXcdx8USijBcgZHLgvZywH5PbjQK5G1iZaEu9obHiH"); assert_eq!( decodebase58check(&key), [ 49, 251, 48, 224, 136, 182, 49, 247, 149, 81, 107, 110, 171, 235, 247, 240, 41, 195, 59, 34, 112, 140, 205, 205, 96, 12, 98, 243, 187, 230, 36, 51 ] ); assert_eq!(to_base58check(&decodebase58check(&key)), key); }
rust_cleaned_test_functions.jsonl/82847
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 233 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7651, 20, 23, 2028, 368, 341, 262, 1077, 1376, 284, 923, 486, 1499, 445, 47, 16, 24134, 18, 41, 77, 41, 55, 4385, 87, 23, 2034, 3172, 33, 27446, 57, 13485, 21404, 57, 84414, 39, 20, 47, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_empty_protobuf_message() { let dir = tempfile::Builder::new() .prefix("test_empty_protobuf_message") .tempdir() .unwrap(); let cfg = Config { dir: dir.path().to_str().unwrap().to_owned(), ..Default::default() }; let engine = RaftLogEngine::open(cfg).unwrap(); let mut log_batch = LogBatch::default(); let empty_entry = Entry::new(); assert_eq!(empty_entry.compute_size(), 0); log_batch .add_entries::<Entry>(0, &[empty_entry.clone()]) .unwrap(); engine.write(&mut log_batch, false).unwrap(); let empty_state = RaftLocalState::new(); assert_eq!(empty_state.compute_size(), 0); log_batch .put_message(1, b"key".to_vec(), &empty_state) .unwrap(); engine.write(&mut log_batch, false).unwrap(); log_batch .add_entries::<Entry>(2, &[empty_entry.clone()]) .unwrap(); log_batch .put_message(2, b"key".to_vec(), &empty_state) .unwrap(); engine.write(&mut log_batch, true).unwrap(); let engine = engine.reopen(); assert_eq!( engine.get_entry::<Entry>(0, 0).unwrap().unwrap(), empty_entry ); assert_eq!( engine.get_entry::<Entry>(2, 0).unwrap().unwrap(), empty_entry ); assert_eq!( engine .get_message::<RaftLocalState>(1, b"key") .unwrap() .unwrap(), empty_state ); assert_eq!( engine .get_message::<RaftLocalState>(2, b"key") .unwrap() .unwrap(), empty_state ); }
rust_cleaned_test_functions.jsonl/91527
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1000 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15124, 22357, 18464, 6462, 368, 341, 286, 1077, 5419, 284, 54819, 486, 3297, 486, 931, 741, 310, 659, 11849, 445, 1944, 15124, 22357, 18464, 6462, 1138, 310, 659, 3888, 3741, 741, 310, 659, 15454,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_hash() { assert!(::hash(&_0) != ::hash(&_1)); assert!(::hash(&_0) != ::hash(&_3_2)); let a = Rational::new_raw(4, 2); let b = Rational::new_raw(6, 3); assert_eq!(a, b); assert_eq!(::hash(&a), ::hash(&b)); let a = Rational::new_raw(123456789, 1000); let b = Rational::new_raw(123456789 * 5, 5000); assert_eq!(a, b); assert_eq!(::hash(&a), ::hash(&b)); }
rust_cleaned_test_functions.jsonl/842
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 253 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8950, 368, 341, 286, 2060, 10297, 486, 8296, 49038, 15, 8, 961, 3504, 8296, 49038, 16, 1106, 286, 2060, 10297, 486, 8296, 49038, 15, 8, 961, 3504, 8296, 49038, 18, 62, 17, 3237, 1789, 286, 107...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_deserializer_from_json_nested_quotes() { let input = r#"{ "t": "DOESNT_MATTER", "s": 5144, "op": 0, "d": { "name": "a \"t\"role" } }"#; let deserializer = GatewayEventDeserializer::from_json(input).unwrap(); assert_eq!(deserializer.event_type, Some("DOESNT_MATTER")); assert_eq!(deserializer.op, 0); }
rust_cleaned_test_functions.jsonl/78647
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 254 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15768, 41939, 5673, 9455, 66279, 75637, 368, 341, 286, 1077, 1946, 284, 435, 55543, 515, 310, 330, 83, 788, 330, 5865, 1570, 6408, 1245, 49683, 756, 310, 330, 82, 788, 220, 20, 16, 19, 19, 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_send_truncated() { let mut socket = ipv4_locals::socket(buffer(0), buffer(1)); assert_eq!(socket.send_slice(&[0; 32][..]), Err(Error::Truncated)); }
rust_cleaned_test_functions.jsonl/51526
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 89 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13565, 3547, 38007, 368, 341, 286, 1077, 5206, 7575, 284, 45475, 19, 94552, 486, 9556, 12584, 7, 15, 701, 4147, 7, 16, 1106, 286, 2060, 10714, 10297, 9556, 5219, 26488, 2099, 58, 15, 26, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_check_vhd_footer() { with_file(&valid_fixed_vhd_footer(), |mut file: File| { let vhd_footer = VhdFooter::new(&mut file).expect("Failed to create VHD footer"); assert_eq!(vhd_footer.cookie(), 0x636f_6e65_6374_6978); assert_eq!(vhd_footer.features(), 0x0000_0002); assert_eq!(vhd_footer.file_format_version(), 0x0001_0000); assert_eq!(vhd_footer.data_offset(), 0xffff_ffff_ffff_ffff); assert_eq!(vhd_footer.time_stamp(), 0x27a6_a65d); assert_eq!(vhd_footer.creator_application(), 0x7165_6d75); assert_eq!(vhd_footer.creator_version(), 0x0005_0003); assert_eq!(vhd_footer.creator_host_os(), 0x5769_326b); assert_eq!(vhd_footer.original_size(), 0x0000_0000_1000_0000); assert_eq!(vhd_footer.current_size(), 0x0000_0000_1000_0000); assert_eq!(vhd_footer.disk_geometry(), 0x11e0_103f); assert_eq!(vhd_footer.disk_type(), 0x0000_0002); assert_eq!(vhd_footer.checksum(), 0x0000_0000); assert_eq!( vhd_footer.unique_id(), 0x987b_b1cd_8414_41fc_a4ab_d069_452b_f223 ); assert_eq!(vhd_footer.saved_state(), 0x00); }); }
rust_cleaned_test_functions.jsonl/81579
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 705 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7200, 2273, 15990, 25966, 368, 341, 286, 448, 2458, 2099, 1891, 37839, 2273, 15990, 25966, 1507, 760, 6984, 1034, 25, 2887, 91, 341, 310, 1077, 348, 15990, 25966, 284, 647, 15990, 19445, 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_requested_transport_add_to() -> Result<()> { let mut m = Message::new(); let r = RequestedTransport { protocol: PROTO_UDP, }; r.add_to(&mut m)?; m.write_header(); //"GetFrom" { let mut decoded = Message::new(); decoded.write(&m.raw)?; let mut req = RequestedTransport { protocol: PROTO_UDP, }; req.get_from(&decoded)?; assert_eq!(req, r, "Decoded {}, expected {}", req, r); //"HandleErr" { let mut m = Message::new(); let mut handle = RequestedTransport::default(); if let Err(err) = handle.get_from(&m) { assert!( stun::error::Error::ErrAttributeNotFound.equal(&err), "{} should be not found", err ); } else { assert!(false, "expected error, got ok"); } m.add(ATTR_REQUESTED_TRANSPORT, &[1, 2, 3]); if let Err(err) = handle.get_from(&m) { assert!( is_attr_size_invalid(&err), "IsAttrSizeInvalid should be true" ); } else { assert!(false, "expected error, got ok"); } } } Ok(()) }
rust_cleaned_test_functions.jsonl/15706
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 751 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 72709, 46398, 2891, 2346, 368, 1464, 5714, 71698, 341, 262, 1077, 5206, 296, 284, 4856, 486, 931, 543, 262, 1077, 435, 284, 6145, 291, 27560, 341, 286, 11507, 25, 5308, 5207, 75201, 345, 262, 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...
6
#[test] fn test_hint_ts() { let mut ops = IterOptions::default(); assert_eq!(ops.hint_min_ts(), None); assert_eq!(ops.hint_max_ts(), None); ops.set_hint_min_ts(Bound::Included(1)); ops.set_hint_max_ts(Bound::Included(10)); assert_eq!(ops.hint_min_ts(), Some(1)); assert_eq!(ops.hint_max_ts(), Some(10)); ops.set_hint_min_ts(Bound::Excluded(1)); ops.set_hint_max_ts(Bound::Excluded(10)); assert_eq!(ops.hint_min_ts(), Some(2)); assert_eq!(ops.hint_max_ts(), Some(9)); }
rust_cleaned_test_functions.jsonl/45830
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 298 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 45825, 25023, 368, 341, 286, 1077, 5206, 27132, 284, 13704, 3798, 486, 2258, 543, 286, 2060, 10714, 10297, 3721, 860, 396, 7260, 25023, 1507, 2240, 317, 286, 2060, 10714, 10297, 3721, 860, 396, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_strings() { let mut g = Graph::new(); let x_op = { let mut nd = g.new_operation("Placeholder", "x").unwrap(); nd.set_attr_type("dtype", DataType::String).unwrap(); nd.set_attr_shape("shape", &Shape(Some(vec![]))).unwrap(); nd.finish().unwrap() }; let y_op = { let mut nd = g.new_operation("EncodeBase64", "y").unwrap(); nd.add_input(x_op.clone()); nd.finish().unwrap() }; let options = SessionOptions::new(); let session = Session::new(&options, &g).unwrap(); let mut x = <Tensor<String>>::new(&[2]); x[0] = "This is a long string.".to_string(); x[1] = "This is another long string.".to_string(); let mut step = SessionRunArgs::new(); step.add_feed(&x_op, 0, &x); let output_ix = step.request_fetch(&y_op, 0); session.run(&mut step).unwrap(); let output_tensor = step.fetch::<String>(output_ix).unwrap(); assert_eq!(output_tensor.len(), 2); assert_eq!(output_tensor[0], "VGhpcyBpcyBhIGxvbmcgc3RyaW5nLg"); assert_eq!(output_tensor[1], "VGhpcyBpcyBhbm90aGVyIGxvbmcgc3RyaW5nLg"); }
rust_cleaned_test_functions.jsonl/69009
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 627 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 33500, 368, 341, 286, 1077, 5206, 342, 284, 12165, 486, 931, 543, 286, 1077, 856, 10287, 284, 341, 310, 1077, 5206, 15581, 284, 342, 4618, 32565, 445, 48305, 497, 330, 87, 1827, 15454, 543, 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_local_empty() { let x = b"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"; let y = b"AACGTACGATACGTGGGTTGTCACACGTGTCGCGCGGCAACACATCAGACTCTAACAGCATCATCAGCACGTGACA"; let score = |a: u8, b: u8| if a == b { 1i32 } else { -3i32 }; let mut aligner = banded::Aligner::with_capacity(x.len(), y.len(), -5, -1, &score, 10, 10); let alignment = aligner.local(x, y); println!("aln:\n{}", alignment.pretty(x, y)); assert_eq!(alignment.x_aln_len(), 0); assert_eq!(alignment.y_aln_len(), 0); }
rust_cleaned_test_functions.jsonl/126742
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 309 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13564, 15124, 368, 341, 286, 1077, 856, 284, 293, 1, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745, 9745,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_t_cache() { init_default_config(); let c = parse_args_from(&[ "audioserve", "--no-authentication", "--t-cache-dir", "test_data", "--t-cache-size", "999", "--t-cache-max-files", "999", "--t-cache-save-often", "test_data", ]) .unwrap(); assert_eq!(PathBuf::from("test_data"), c.transcoding.cache.root_dir); assert_eq!(999, c.transcoding.cache.max_size); assert_eq!(999, c.transcoding.cache.max_files); assert!(!c.transcoding.cache.disabled); assert!(c.transcoding.cache.save_often); }
rust_cleaned_test_functions.jsonl/51091
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 395 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 528, 11529, 368, 341, 286, 2930, 9993, 5332, 543, 286, 1077, 272, 284, 4715, 8384, 5673, 2099, 9640, 310, 330, 7880, 3530, 5852, 756, 310, 14482, 2152, 33503, 7164, 756, 310, 14482, 83, 36680, 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_figure() { let font = FIGfont::standard().unwrap(); let mut figure = FIGure::new(&font, 80); figure .add("Ciao ciao ciao ciao ciao ciao ciao ciao ciao ciao") .unwrap(); println!("{}", figure); }
rust_cleaned_test_functions.jsonl/41937
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 139 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 82731, 368, 341, 286, 1077, 3301, 284, 37599, 4026, 486, 20270, 1005, 15454, 543, 286, 1077, 5206, 7071, 284, 37599, 552, 486, 931, 2099, 4026, 11, 220, 23, 15, 626, 286, 7071, 198, 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_core_text_to_css_font_weight() { // Exact matches assert_eq!(super::core_text_to_css_font_weight(-0.7), Weight(100.0)); assert_eq!(super::core_text_to_css_font_weight(0.0), Weight(400.0)); assert_eq!(super::core_text_to_css_font_weight(0.4), Weight(700.0)); assert_eq!(super::core_text_to_css_font_weight(0.8), Weight(900.0)); // Linear interpolation assert_eq!(super::core_text_to_css_font_weight(0.1), Weight(450.0)); }
rust_cleaned_test_functions.jsonl/98160
{ "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, 15467, 4326, 2346, 25924, 17451, 15876, 368, 341, 286, 442, 74480, 9071, 198, 286, 2060, 10714, 10297, 9522, 486, 2153, 4326, 2346, 25924, 17451, 15876, 4080, 15, 13, 22, 701, 16516, 7, 16, 15, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_deletes() -> crate::Result<()> { let mut schema_builder = Schema::builder(); let name = schema_builder.add_u64_field("name", INDEXED); let schema = schema_builder.build(); let index = Index::create_in_ram(schema); { let mut index_writer = index.writer_for_tests()?; index_writer.add_document(doc!(name => 1u64)); index_writer.add_document(doc!(name => 2u64)); index_writer.add_document(doc!(name => 3u64)); index_writer.add_document(doc!(name => 4u64)); index_writer.commit()?; } { let mut index_writer2 = index.writer(50_000_000)?; index_writer2.delete_term(Term::from_field_u64(name, 2u64)); index_writer2.delete_term(Term::from_field_u64(name, 3u64)); index_writer2.commit()?; } let searcher = index.searcher()?; let searcher_space_usage = searcher.space_usage()?; assert!(searcher_space_usage.total() > 0); assert_eq!(1, searcher_space_usage.segments().len()); let segment_space_usage = &searcher_space_usage.segments()[0]; assert!(segment_space_usage.total() > 0); assert_eq!(2, segment_space_usage.num_docs()); expect_single_field(segment_space_usage.termdict(), &name, 1, 512); expect_single_field(segment_space_usage.postings(), &name, 1, 512); assert_eq!(0, segment_space_usage.positions().total()); assert_eq!(0, segment_space_usage.fast_fields().total()); expect_single_field(segment_space_usage.fieldnorms(), &name, 1, 512); assert!(segment_space_usage.deletes() > 0); Ok(()) }
rust_cleaned_test_functions.jsonl/62191
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 808 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2259, 13881, 368, 1464, 17717, 486, 2077, 71698, 341, 286, 1077, 5206, 10802, 28532, 284, 12539, 486, 17850, 543, 286, 1077, 829, 284, 10802, 28532, 1364, 7300, 21, 19, 5013, 445, 606, 497, 39300,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
7
#[test] fn test_add_builtin_loader_no_overwrite() { let (genesis_config, _mint_keypair) = create_genesis_config(100_000); #[allow(clippy::unnecessary_wraps)] fn mock_ix_processor( _pubkey: &Pubkey, _data: &[u8], _context: &mut dyn InvokeContext, ) -> std::result::Result<(), InstructionError> { Ok(()) } let slot = 123; let loader_id = solana_sdk::pubkey::new_rand(); let mut bank = Arc::new(Bank::new_from_parent( &Arc::new(Bank::new(&genesis_config)), &Pubkey::default(), slot, )); assert_eq!(bank.get_account_modified_slot(&loader_id), None); Arc::get_mut(&mut bank) .unwrap() .add_builtin("mock_program", loader_id, mock_ix_processor); assert_eq!(bank.get_account_modified_slot(&loader_id).unwrap().1, slot); let mut bank = Arc::new(new_from_parent(&bank)); Arc::get_mut(&mut bank) .unwrap() .add_builtin("mock_program", loader_id, mock_ix_processor); assert_eq!(bank.get_account_modified_slot(&loader_id).unwrap().1, slot); }
rust_cleaned_test_functions.jsonl/2642
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 591 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2891, 73829, 22139, 6536, 15431, 4934, 368, 341, 286, 1077, 320, 77894, 5332, 11, 716, 67791, 3097, 12670, 8, 284, 1855, 16322, 13774, 5332, 7, 16, 15, 15, 62, 15, 15, 15, 626, 286, 11506, 718...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_double_assign_binary() { let mut d = BinaryDigit(0_u8); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(1)); assert!(!carry); let mut d = BinaryDigit(0x23_u8); let carry = d.double_carry_assign(false); assert_eq!(d, BinaryDigit(0x46)); assert!(!carry); let mut d = BinaryDigit(0x23_u8); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(0x47)); assert!(!carry); let mut d = BinaryDigit(0x83_u8); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(0x07)); assert!(carry); let mut d = BinaryDigit(0x83_u16); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(0x107)); assert!(!carry); let mut d = BinaryDigit(0xfc83_u16); let carry = d.double_carry_assign(false); assert_eq!(d, BinaryDigit(0xf906)); assert!(carry); let mut d = BinaryDigit(0xfc83_u32); let carry = d.double_carry_assign(false); assert_eq!(d, BinaryDigit(0x1f906)); assert!(!carry); let mut d = BinaryDigit(0x3524fc83_u32); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(0x6a49f907)); assert!(!carry); let mut d = BinaryDigit(0xc524fc83_u32); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(0x8a49f907)); assert!(carry); let mut d = BinaryDigit(0xc524fc83_u64); let carry = d.double_carry_assign(true); assert_eq!(d, BinaryDigit(0x18a49f907)); assert!(!carry); let mut d = BinaryDigit(0x4287645fc524fc83_u64); let carry = d.double_carry_assign(false); assert_eq!(d, BinaryDigit(0x850ec8bf8a49f906)); assert!(!carry); let mut d = BinaryDigit(0x9287645fc524fc83_u64); let carry = d.double_carry_assign(false); assert_eq!(d, BinaryDigit(0x250ec8bf8a49f906)); assert!(carry); }
rust_cleaned_test_functions.jsonl/26410
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1066 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 24598, 20688, 31761, 741, 262, 341, 286, 1077, 5206, 294, 284, 17718, 36420, 7, 15, 7300, 23, 317, 286, 1077, 6777, 284, 294, 43089, 666, 11433, 20688, 3715, 317, 286, 2060, 10714, 10297, 67, 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_functional_store() -> crate::Result<()> { let mut schema_builder = Schema::builder(); let id_field = schema_builder.add_u64_field("id", INDEXED | STORED); let schema = schema_builder.build(); let index = Index::create_in_ram(schema); let reader = index.reader()?; let mut rng = thread_rng(); let mut index_writer = index.writer_with_num_threads(3, 12_000_000)?; let mut doc_set: Vec<u64> = Vec::new(); let mut doc_id = 0u64; for iteration in 0..get_num_iterations() { dbg!(iteration); let num_docs: usize = rng.gen_range(0..4); if !doc_set.is_empty() { let doc_to_remove_id = rng.gen_range(0..doc_set.len()); let removed_doc_id = doc_set.swap_remove(doc_to_remove_id); index_writer.delete_term(Term::from_field_u64(id_field, removed_doc_id)); } for _ in 0..num_docs { doc_set.push(doc_id); index_writer.add_document(doc!(id_field=>doc_id)); doc_id += 1; } index_writer.commit()?; reader.reload()?; let searcher = reader.searcher(); check_index_content(&searcher, &doc_set)?; } Ok(()) }
rust_cleaned_test_functions.jsonl/2776
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 574 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9174, 278, 14809, 368, 1464, 17717, 486, 2077, 71698, 341, 262, 1077, 5206, 10802, 28532, 284, 12539, 486, 17850, 1428, 262, 1077, 877, 5013, 284, 10802, 28532, 1364, 7300, 21, 19, 5013, 445, 307,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
9
#[test] fn test_string() { let s = "\0 a 'b \" c".to_string(); let tokens = quote!(#s); let expected = r#""\u{0} a 'b \" c""#; assert_eq!(expected, tokens.to_string()); }
rust_cleaned_test_functions.jsonl/3600
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 91 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3904, 368, 341, 262, 1077, 274, 284, 2917, 15, 264, 364, 65, 7245, 272, 3263, 983, 3904, 543, 262, 1077, 11211, 284, 12641, 10297, 2, 82, 317, 262, 1077, 3601, 284, 435, 2, 3014, 59, 84, 90,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_e2e_64xp() { let ir_buffer = UnlimitedBuffer::new(b"window 22 len 64\ninsert 64 58585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858585858 01fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe01010101fe01fefe010101\n"); let mut dv_buffer = UnlimitedBuffer::new(&[]); let mut buf_ir = BufReader::new(ir_buffer); let mut opts = DivansCompressorOptions::default(); opts.literal_adaptation = Some([Speed::FAST, Speed::SLOW, Speed::FAST, Speed::FAST]); opts.use_context_map = true; opts.dynamic_context_mixing = Some(1); match super::compress_ir(&mut buf_ir, &mut dv_buffer, opts) { Ok(_) => assert_eq!(EXTERNAL_PROB_FEATURE, true), Err(_) => assert_eq!(EXTERNAL_PROB_FEATURE, false), }; //let a = rt_buffer.data; //let b = raw_text_buffer.data; }
rust_cleaned_test_functions.jsonl/19835
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 875 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2204, 17, 68, 62, 21, 19, 35725, 368, 341, 5872, 256, 1077, 6216, 7776, 284, 48505, 4095, 486, 931, 1883, 1, 5507, 220, 17, 17, 2422, 220, 21, 19, 1699, 4208, 220, 21, 19, 220, 20, 23, 20,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_int_totalord() { assert_eq!(5.cmp(&10), Less); assert_eq!(10.cmp(&5), Greater); assert_eq!(5.cmp(&5), Equal); assert_eq!((-5).cmp(&12), Less); assert_eq!(12.cmp(-5), Greater); }
rust_cleaned_test_functions.jsonl/117302
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 131 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4042, 10784, 539, 368, 341, 286, 2060, 10714, 10297, 20, 520, 1307, 2099, 16, 15, 701, 9668, 317, 286, 2060, 10714, 10297, 16, 15, 520, 1307, 2099, 20, 701, 32281, 317, 286, 2060, 10714, 10297, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_none() { let mut r = AnyResult::new::<String>(); r.add(|| 1); assert_eq!(r.result_ref::<String>(), None); assert_eq!(r.result::<String>(), None); }
rust_cleaned_test_functions.jsonl/99957
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 106 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31488, 368, 341, 286, 1077, 5206, 435, 284, 5765, 2077, 486, 931, 27638, 703, 3913, 286, 435, 1364, 79453, 220, 16, 317, 286, 2060, 10714, 10297, 81, 12071, 7793, 27638, 703, 39019, 2240, 317, 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 ]
2
#[test] fn test_simple_clone() { { let x = Cc::new(5); let y = x.clone(); assert_eq!(*x, 5); assert_eq!(*y, 5); } collect_cycles(); }
rust_cleaned_test_functions.jsonl/110846
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 137 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30015, 54742, 368, 341, 286, 341, 310, 1077, 856, 284, 356, 66, 486, 931, 7, 20, 317, 310, 1077, 379, 284, 856, 15997, 543, 310, 2060, 10714, 0, 4071, 87, 11, 220, 20, 317, 310, 2060, 10714,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_array() { // Construct an array using `Row::push_array` and verify that it unpacks // correctly. const DIM: ArrayDimension = ArrayDimension { lower_bound: 2, length: 2, }; let mut row = Row::default(); row.push_array(&[DIM], vec![Datum::Int32(1), Datum::Int32(2)]) .unwrap(); let arr1 = row.unpack_first().unwrap_array(); assert_eq!(arr1.dims().into_iter().collect::<Vec<_>>(), vec![DIM]); assert_eq!( arr1.elements().into_iter().collect::<Vec<_>>(), vec![Datum::Int32(1), Datum::Int32(2)] ); // Pack a previously-constructed `Datum::Array` and verify that it // unpacks correctly. let row = Row::pack_slice(&[Datum::Array(arr1)]); let arr2 = row.unpack_first().unwrap_array(); assert_eq!(arr1, arr2); }
rust_cleaned_test_functions.jsonl/56495
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 446 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3858, 368, 341, 286, 442, 18678, 458, 1334, 1667, 1565, 3102, 486, 9077, 3858, 63, 323, 10146, 429, 432, 31065, 82, 198, 286, 442, 12440, 624, 286, 733, 50859, 25, 2910, 26121, 284, 2910, 26121,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_ser_de_small_array_box_empty() { let tokens = [Token::Seq { len: Some(0) }, Token::SeqEnd]; let array = SmallArrayBox::new([]); assert_tokens(&array, &tokens); let array = SmallArrayBox::new_empty(); assert_tokens(&array, &tokens); }
rust_cleaned_test_functions.jsonl/126585
{ "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, 75861, 2259, 31966, 3858, 10194, 15124, 368, 341, 286, 1077, 11211, 284, 508, 3323, 486, 20183, 314, 2422, 25, 4329, 7, 15, 8, 2470, 9660, 486, 20183, 3727, 4821, 286, 1077, 1334, 284, 14994, 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_create_list_table_patient_columns() { test_list_table_patient( &["PatientID", "Number of Studies"], &["PatientID"], false, include_str!("../tests/data/unit/list_patients_columns").trim_end(), ); }
rust_cleaned_test_functions.jsonl/76475
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 148 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8657, 2019, 5237, 70310, 22590, 368, 341, 286, 1273, 2019, 5237, 70310, 1006, 310, 609, 1183, 36592, 915, 497, 330, 2833, 315, 18720, 8097, 310, 609, 1183, 36592, 915, 8097, 310, 895, 345, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_simple_app() { #[api_v2_operation] fn echo_pet(body: web::Json<Pet>) -> impl Future<Output = Result<web::Json<Pet>, Error>> { fut_ok(body) } #[api_v2_operation] async fn echo_pet_async(body: web::Json<Pet>) -> Result<web::Json<Pet>, actix_web::Error> { Ok(body) } async fn inner_async_func(body: web::Json<Pet>) -> Pet { body.into_inner() } #[api_v2_operation] async fn echo_pet_async_2(body: web::Json<Pet>) -> Result<web::Json<Pet>, actix_web::Error> { let pet = inner_async_func(body).await; Ok(web::Json(pet)) } #[api_v2_operation] fn some_pet(_data: web::Data<String>) -> impl Future<Output = Result<web::Json<Pet>, Error>> { #[allow(unreachable_code)] fut_ok(unimplemented!()) } #[api_v2_operation] async fn adopt_pet() -> Result<CreatedJson<Pet>, ()> { let pet: Pet = Pet::default(); Ok(CreatedJson(pet)) } #[api_v2_operation] async fn nothing() -> NoContent { NoContent } fn config(cfg: &mut web::ServiceConfig) { cfg.service(web::resource("/echo").route(web::post().to(echo_pet))) .service(web::resource("/async_echo").route(web::post().to(echo_pet_async))) .service(web::resource("/async_echo_2").route(web::post().to(echo_pet_async_2))) .service(web::resource("/adopt").route(web::post().to(adopt_pet))) .service(web::resource("/nothing").route(web::get().to(nothing))) .service(web::resource("/random").to(some_pet)); } run_and_check_app( || { App::new() .wrap_api() .with_json_spec_at("/api/spec") .service(web::scope("/api").configure(config)) .build() }, |addr| { let resp = CLIENT .get(&format!("http://{}/api/spec", addr)) .send() .expect("request failed?"); check_json( resp, json!({ "info":{"title":"","version":""}, "definitions": { "Pet": { "properties": { "class": { "enum": ["dog", "cat", "other"], "type": "string" }, "id": { "format": "int64", "type": "integer" }, "name": { "description": "Pick a good one.", "type": "string" }, "birthday": { "format": "date", "type": "string" }, "updatedOn": { "format": "date-time", "type": "string" }, "uuid": { "format": "uuid", "type": "string" } }, "required":["birthday", "class", "name"], "type":"object" } }, "paths": { "/api/echo": { "post": { "parameters": [{ "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/Pet" } }], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } } }, "/api/async_echo": { "post": { "parameters": [{ "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/Pet" } }], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } } }, "/api/async_echo_2": { "post": { "parameters": [{ "in": "body", "name": "body", "required": true, "schema": { "$ref": "#/definitions/Pet" } }], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } } }, "/api/random": { "delete": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } }, "get": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } }, "head": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } }, "options": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } }, "patch": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } }, "post": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } }, "put": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } } }, "/api/adopt": { "post": { "responses": { "201": { "description": "Created", "schema": { "$ref": "#/definitions/Pet" } } } } }, "/api/nothing": { "get": { "responses": { "204": { "description": "No Content" } } } }, }, "swagger": "2.0" }), ); }, ); }
rust_cleaned_test_functions.jsonl/128117
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 6618 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30015, 8191, 368, 341, 262, 11506, 2068, 2273, 17, 32565, 921, 262, 5168, 1687, 75963, 15225, 25, 3482, 486, 5014, 21604, 295, 9231, 1464, 11605, 12498, 27, 5097, 284, 5714, 27, 2911, 486, 5014, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_crypto_box_assert_default_salsa() { let default_box_primitive = unsafe { let c = std::ffi::CStr::from_ptr(libsodium_sys::crypto_box_primitive()); c.to_str().unwrap() }; assert_eq!("curve25519xsalsa20poly1305", default_box_primitive); }
rust_cleaned_test_functions.jsonl/125447
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 168 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 78298, 10194, 16553, 9993, 643, 41826, 368, 341, 286, 1077, 1638, 10194, 84087, 284, 19860, 341, 310, 1077, 272, 4035, 394, 1460, 486, 53799, 486, 34, 2580, 486, 1499, 4348, 44828, 82, 46776, 2034...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_aggregate_combinator_function_on_empty_data() -> Result<()> { struct Test { name: &'static str, params: Vec<DataValue>, args: Vec<DataField>, display: &'static str, arrays: Vec<Series>, error: &'static str, func_name: &'static str, input_array: Box<dyn MutableArrayBuilder>, expect_array: Box<dyn MutableArrayBuilder>, } let arrays: Vec<Series> = vec![ DFInt64Array::new_from_slice(&[]).into_series(), DFBooleanArray::new_from_slice(&[]).into_series(), ]; let args = vec![ DataField::new("a", DataType::Int64, true), DataField::new("b", DataType::Boolean, true), ]; let tests = vec![ Test { name: "count-distinct-passed", params: vec![], args: vec![args[0].clone()], display: "count", func_name: "countdistinct", arrays: vec![arrays[0].clone()], error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<u64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<u64, true>::from_data( DataType::UInt64, Vec::from([0u64]), Some(MutableBitmap::from([true])), )), }, Test { name: "sum-distinct-passed", params: vec![], args: vec![args[0].clone()], display: "sum", func_name: "sumdistinct", arrays: vec![arrays[0].clone()], error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::from_data( DataType::Int64, Vec::from([0i64]), Some(MutableBitmap::from([false])), )), }, Test { name: "count-if-passed", params: vec![], args: args.clone(), display: "count", func_name: "countif", arrays: arrays.clone(), error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<u64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<u64, true>::from_data( DataType::UInt64, Vec::from([0u64]), Some(MutableBitmap::from([true])), )), }, Test { name: "min-if-passed", params: vec![], args: args.clone(), display: "min", func_name: "minif", arrays: arrays.clone(), error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::from_data( DataType::Int64, Vec::from([0i64]), Some(MutableBitmap::from([false])), )), }, Test { name: "max-if-passed", params: vec![], args: args.clone(), display: "max", func_name: "maxif", arrays: arrays.clone(), error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::from_data( DataType::Int64, Vec::from([0i64]), Some(MutableBitmap::from([false])), )), }, Test { name: "sum-if-passed", params: vec![], args: args.clone(), display: "sum", func_name: "sumif", arrays: arrays.clone(), error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<i64, true>::from_data( DataType::Int64, Vec::from([0i64]), Some(MutableBitmap::from([false])), )), }, Test { name: "avg-if-passed", params: vec![], args: args.clone(), display: "avg", func_name: "avgif", arrays: arrays.clone(), error: "", input_array: Box::new(MutablePrimitiveArrayBuilder::<f64, true>::default()), expect_array: Box::new(MutablePrimitiveArrayBuilder::<f64, true>::from_data( DataType::Float64, Vec::from([0f64]), Some(MutableBitmap::from([false])), )), }, ]; for mut t in tests { let rows = t.arrays[0].len(); let arena = Bump::new(); let mut func = || -> Result<()> { // First. let factory = AggregateFunctionFactory::instance(); let func = factory.get(t.func_name, t.params.clone(), t.args.clone())?; let addr1 = arena.alloc_layout(func.state_layout()); func.init_state(addr1.into()); func.accumulate(addr1.into(), &t.arrays, rows)?; // Second. let addr2 = arena.alloc_layout(func.state_layout()); func.init_state(addr2.into()); func.accumulate(addr2.into(), &t.arrays, rows)?; func.merge(addr1.into(), addr2.into())?; let array: &mut dyn MutableArrayBuilder = t.input_array.borrow_mut(); let _ = func.merge_result(addr1.into(), array)?; let datatype = t.input_array.data_type(); with_match_primitive_type!(datatype, |$T| { let array = t .input_array .as_mut_any() .downcast_ref::<MutablePrimitiveArrayBuilder<$T, true>>() .unwrap(); let expect = t .expect_array .as_mut_any() .downcast_ref::<MutablePrimitiveArrayBuilder<$T, true>>() .unwrap(); assert_eq!(array.data_type(), expect.data_type(), "{}", t.name); assert_eq!(array.values(), expect.values(), "{}", t.name); }, { panic!("shoud never reach this way"); }); assert_eq!(t.display, format!("{:}", func), "{}", t.name); Ok(()) }; if let Err(e) = func() { assert_eq!(t.error, e.to_string()); } } Ok(()) }
rust_cleaned_test_functions.jsonl/101368
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 3599 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 20587, 14240, 34454, 17272, 9174, 4470, 15124, 1769, 368, 1464, 5714, 71698, 341, 262, 2036, 3393, 341, 286, 829, 25, 30136, 1978, 607, 345, 286, 3628, 25, 11312, 44395, 1130, 12520, 286, 2827, 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...
9
#[test] fn test_const_evaluator_scalar_functions() { let expr = call_fn("concat", vec![lit("foo"), lit("bar")]).unwrap(); test_evaluate(expr, lit("foobar")); // ensure arguments are also constant folded let concat1 = call_fn("concat", vec![lit("bar"), lit("baz")]).unwrap(); let expr = call_fn("concat", vec![lit("foo"), concat1]).unwrap(); test_evaluate(expr, lit("foobarbaz")); // Check non string arguments let expr = call_fn("to_timestamp", vec![lit("2020-09-08T12:00:00+00:00")]).unwrap(); test_evaluate(expr, lit_timestamp_nano(1599566400000000000i64)); // check that non foldable arguments are folded let expr = call_fn("to_timestamp", vec![col("a")]).unwrap(); test_evaluate(expr.clone(), expr); // check that non foldable arguments are folded let expr = call_fn("to_timestamp", vec![col("a")]).unwrap(); test_evaluate(expr.clone(), expr); // volatile / stable functions should not be evaluated let fun = BuiltinScalarFunction::Random; assert_eq!(fun.volatility(), Volatility::Volatile); let rand = Expr::ScalarFunction { args: vec![], fun }; let expr = rand.clone() + (lit(1) + lit(2)); let expected = rand + lit(3); test_evaluate(expr, expected); // parenthesization matters: can't rewrite let fun = BuiltinScalarFunction::Random; let rand = Expr::ScalarFunction { args: vec![], fun }; let expr = (rand + lit(1)) + lit(2); test_evaluate(expr.clone(), expr); }
rust_cleaned_test_functions.jsonl/77805
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 739 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13610, 21296, 45162, 41652, 31708, 368, 341, 1789, 286, 1077, 15169, 284, 1618, 15246, 445, 20164, 497, 7486, 20703, 31635, 445, 7975, 3975, 13020, 445, 2257, 899, 10697, 15454, 543, 286, 1273, 2204...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_empty_iter() { let mut m: HashMap<isize, bool> = HashMap::new(); assert_eq!(m.par_drain().count(), 0); assert_eq!(m.par_keys().count(), 0); assert_eq!(m.par_values().count(), 0); assert_eq!(m.par_values_mut().count(), 0); assert_eq!(m.par_iter().count(), 0); assert_eq!(m.par_iter_mut().count(), 0); assert_eq!(m.len(), 0); assert!(m.is_empty()); assert_eq!(m.into_par_iter().count(), 0); }
rust_cleaned_test_functions.jsonl/45212
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 254 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15124, 11723, 368, 341, 286, 1077, 5206, 296, 25, 10528, 27, 285, 551, 11, 1807, 29, 284, 10528, 486, 931, 543, 286, 2060, 10714, 10297, 76, 33277, 26680, 466, 1005, 1830, 1507, 220, 15, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_abandon_circuit() { let store = setup_admin_service_store(); let event_store = store.clone_boxed(); let (mesh, cm, pm, peer_connector) = setup_peer_connector(None); let orchestrator = setup_orchestrator(); let context = Secp256k1Context::new(); let private_key = context.new_random_private_key(); let pub_key = context .get_public_key(&private_key) .expect("Unable to get corresponding public key"); let signer = context.new_signer(private_key); let signature_verifier = context.new_verifier(); let table = RoutingTable::default(); let writer: Box<dyn RoutingTableWriter> = Box::new(table.clone()); let mut admin_shared = AdminServiceShared::new( "node_a".into(), Arc::new(Mutex::new(orchestrator)), HashMap::new(), peer_connector, store, signature_verifier, Box::new(MockAdminKeyVerifier::default()), Box::new(AllowAllKeyPermissionManager), writer, event_store, vec![], ); // Add the circuit to be abandoned admin_shared .admin_store .add_circuit( store_circuit(CIRCUIT_PROTOCOL_VERSION, StoreCircuitStatus::Active), store_circuit_nodes(), ) .expect("unable to add circuit to store"); // Make `CircuitAbandon` and corresponding payload let mut abandon = admin::CircuitAbandon::new(); abandon.set_circuit_id("01234-ABCDE".to_string()); let mut header = admin::CircuitManagementPayload_Header::new(); header.set_action(admin::CircuitManagementPayload_Action::CIRCUIT_ABANDON); header.set_requester(pub_key.into_bytes()); header.set_requester_node_id("node_a".to_string()); let mut payload = admin::CircuitManagementPayload::new(); payload.set_header(protobuf::Message::write_to_bytes(&header).unwrap()); payload.set_signature(signer.sign(&payload.header).unwrap().take_bytes()); payload.set_circuit_abandon(abandon); // Submit `CircuitAbandon` payload if let Err(err) = admin_shared.submit(payload) { panic!("Should have been valid: {}", err); } let abandoned_circuit = admin_shared .admin_store .get_circuit(&"01234-ABCDE".to_string()) .expect("Unable to get circuit") .unwrap(); assert_eq!( &StoreCircuitStatus::Abandoned, abandoned_circuit.circuit_status() ); shutdown(mesh, cm, pm); }
rust_cleaned_test_functions.jsonl/47906
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1247 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22885, 11037, 666, 37268, 368, 341, 286, 1077, 3553, 284, 6505, 12207, 12267, 14809, 543, 286, 1077, 1538, 14809, 284, 3553, 15997, 10194, 291, 543, 286, 1077, 320, 23506, 11, 9961, 11, 8836, 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_xor_keystream_block_invalid_blocksize_ietf() { let mut chacha_state_ietf = ChaCha20::new(&[0u8; CHACHA_KEYSIZE], &[0u8; IETF_CHACHA_NONCESIZE], true).unwrap(); let mut ietf_keystream_block = [0u8; CHACHA_BLOCKSIZE]; let mut hchacha_keystream_block = [0u8; HCHACHA_OUTSIZE]; chacha_state_ietf.keystream_block(0, &mut ietf_keystream_block); chacha_state_ietf.keystream_block(0, &mut hchacha_keystream_block); }
rust_cleaned_test_functions.jsonl/44716
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 271 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 76462, 45476, 597, 1237, 7113, 31433, 7113, 2141, 62, 74068, 368, 341, 310, 1077, 5206, 521, 51576, 4387, 62, 74068, 4035, 394, 27721, 95971, 17, 15, 486, 931, 2099, 58, 15, 84, 23, 26, 6826, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_chmod_recursive() { let _guard = UMASK_MUTEX.lock(); let original_umask = unsafe { umask(0) }; let (at, mut ucmd) = at_and_ucmd!(); at.mkdir("a"); at.mkdir("a/b"); at.mkdir("a/b/c"); at.mkdir("z"); make_file(&at.plus_as_string("a/a"), 0o100444); make_file(&at.plus_as_string("a/b/b"), 0o100444); make_file(&at.plus_as_string("a/b/c/c"), 0o100444); make_file(&at.plus_as_string("z/y"), 0o100444); ucmd.arg("-R") .arg("--verbose") .arg("-r,a+w") .arg("a") .arg("z") .succeeds() .stderr_contains(&"to 333 (-wx-wx-wx)") .stderr_contains(&"to 222 (-w--w--w-)"); assert_eq!(at.metadata("z/y").permissions().mode(), 0o100222); assert_eq!(at.metadata("a/a").permissions().mode(), 0o100222); assert_eq!(at.metadata("a/b/b").permissions().mode(), 0o100222); assert_eq!(at.metadata("a/b/c/c").permissions().mode(), 0o100222); println!("mode {:o}", at.metadata("a").permissions().mode()); assert_eq!(at.metadata("a").permissions().mode(), 0o40333); assert_eq!(at.metadata("z").permissions().mode(), 0o40333); unsafe { umask(original_umask); } }
rust_cleaned_test_functions.jsonl/127210
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 589 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4138, 2593, 66242, 368, 341, 262, 1077, 716, 26098, 284, 547, 49863, 66994, 21003, 1428, 262, 1077, 4024, 72063, 1073, 284, 19860, 314, 4443, 1073, 7, 15, 8, 2605, 262, 1077, 320, 266, 11, 5206,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_icmp_error_port_unreachable() { static UDP_PAYLOAD: [u8; 12] = [ 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57, 0x6f, 0x6c, 0x64, 0x21 ]; let (iface, mut socket_set) = create_loopback(); let mut udp_bytes_unicast = vec![0u8; 20]; let mut udp_bytes_broadcast = vec![0u8; 20]; let mut packet_unicast = UdpPacket::new_unchecked(&mut udp_bytes_unicast); let mut packet_broadcast = UdpPacket::new_unchecked(&mut udp_bytes_broadcast); let udp_repr = UdpRepr { src_port: 67, dst_port: 68, payload: &UDP_PAYLOAD }; let ip_repr = IpRepr::Ipv4(Ipv4Repr { src_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x02]), dst_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x01]), protocol: IpProtocol::Udp, payload_len: udp_repr.buffer_len(), hop_limit: 64 }); // Emit the representations to a packet udp_repr.emit(&mut packet_unicast, &ip_repr.src_addr(), &ip_repr.dst_addr(), &ChecksumCapabilities::default()); let data = packet_unicast.into_inner(); // The expected Destination Unreachable ICMPv4 error response due // to no sockets listening on the destination port. let icmp_repr = Icmpv4Repr::DstUnreachable { reason: Icmpv4DstUnreachable::PortUnreachable, header: Ipv4Repr { src_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x02]), dst_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x01]), protocol: IpProtocol::Udp, payload_len: udp_repr.buffer_len(), hop_limit: 64 }, data: &data }; let expected_repr = IpPacket::Icmpv4(( Ipv4Repr { src_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x01]), dst_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x02]), protocol: IpProtocol::Icmp, payload_len: icmp_repr.buffer_len(), hop_limit: 64 }, icmp_repr )); // Ensure that the unknown protocol triggers an error response. // And we correctly handle no payload. assert_eq!(iface.inner.process_udp(&mut socket_set, ip_repr, false, data), Ok(Some(expected_repr))); let ip_repr = IpRepr::Ipv4(Ipv4Repr { src_addr: Ipv4Address([0x7f, 0x00, 0x00, 0x02]), dst_addr: Ipv4Address::BROADCAST, protocol: IpProtocol::Udp, payload_len: udp_repr.buffer_len(), hop_limit: 64 }); // Emit the representations to a packet udp_repr.emit(&mut packet_broadcast, &ip_repr.src_addr(), &IpAddress::Ipv4(Ipv4Address::BROADCAST), &ChecksumCapabilities::default()); // Ensure that the port unreachable error does not trigger an // ICMP error response when the destination address is a // broadcast address and no socket is bound to the port. assert_eq!(iface.inner.process_udp(&mut socket_set, ip_repr, false, packet_broadcast.into_inner()), Ok(None)); }
rust_cleaned_test_functions.jsonl/100740
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1785 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 32747, 1307, 4096, 8716, 4907, 46550, 368, 341, 286, 1099, 42394, 79493, 25, 508, 84, 23, 26, 220, 16, 17, 60, 284, 2278, 310, 220, 15, 87, 19, 23, 11, 220, 15, 87, 21, 20, 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_str_add() { let a = String::from("12345"); let b = a + "2"; let b = b + "2"; assert_eq!(b.len(), 7); assert_eq!(b, "1234522"); }
rust_cleaned_test_functions.jsonl/3177
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 90 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2895, 2891, 368, 341, 262, 1077, 264, 284, 923, 486, 1499, 445, 16, 17, 18, 19, 20, 797, 262, 1077, 293, 284, 264, 488, 330, 17, 876, 262, 1077, 293, 284, 293, 488, 330, 17, 876, 262, 2060...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_error() { let errors = [ Error::OutOfMemory, Error::UnknownCapstoneError, Error::CustomError("custom error"), Error::from(cs_err::CS_ERR_ARCH), Error::from(500 as cs_err::Type), ]; for error in errors.iter() { println!("{}", error); } }
rust_cleaned_test_functions.jsonl/102144
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 196 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4096, 368, 341, 286, 1077, 5975, 284, 2278, 310, 4600, 486, 31731, 10642, 345, 310, 4600, 486, 13790, 12903, 10812, 1454, 345, 310, 4600, 486, 10268, 1454, 445, 9163, 1465, 4461, 310, 4600, 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_update_fields() { let mut cfg = TestConfig::default(); let mut updated_cfg = cfg.clone(); { // update fields updated_cfg.field1 = 100; updated_cfg.field2 = "1".to_owned(); updated_cfg.submodule_field.field1 = 1000; updated_cfg.submodule_field.field2 = true; } let diff = cfg.diff(&updated_cfg); { let mut diff = diff.clone(); assert_eq!(diff.len(), 3); assert_eq!(diff.remove("field1").map(Into::into), Some(100usize)); assert_eq!(diff.remove("field2").map(Into::into), Some("1".to_owned())); // submodule should also be updated let sub_m = diff.remove("submodule_field").map(Into::into); assert!(sub_m.is_some()); let mut sub_diff: ConfigChange = sub_m.unwrap(); assert_eq!(sub_diff.len(), 2); assert_eq!(sub_diff.remove("field1").map(Into::into), Some(1000u64)); assert_eq!(sub_diff.remove("field2").map(Into::into), Some(true)); } cfg.update(diff); assert_eq!(cfg, updated_cfg, "cfg should be updated"); }
rust_cleaned_test_functions.jsonl/3708
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 595 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8882, 12132, 368, 341, 286, 1077, 5206, 13286, 284, 3393, 2648, 486, 2258, 543, 286, 1077, 5206, 6049, 18343, 284, 13286, 15997, 543, 286, 341, 310, 442, 2647, 5043, 198, 310, 6049, 18343, 16454, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_aes_siv_empty_additional_data() { let key_str = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f00112233445566778899aabbccddeefff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff"; let key = hex::decode(key_str).unwrap(); let a = tink_daead::subtle::AesSiv::new(&key).unwrap(); let ct = a .encrypt_deterministically(&[], &[]) .expect("Unexpected encryption error"); let pt = a .decrypt_deterministically(&ct, &[]) .expect("Unexpected decryption error"); assert!(pt.is_empty(), "Mismatched plaintexts"); }
rust_cleaned_test_functions.jsonl/131300
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 293 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 90958, 643, 344, 15124, 81742, 1769, 368, 341, 262, 1077, 1376, 2895, 4035, 286, 330, 15, 15, 15, 16, 15, 17, 15, 18, 15, 19, 15, 20, 15, 21, 15, 22, 15, 23, 15, 24, 15, 64, 15, 65, 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_valid_claim_no_vesting() { with_rewards(DEFAULT_NB_OF_CONTRIBUTORS, DEFAULT_REWARD, 0, |_, accounts| { assert_ok!(CrowdloanRewards::initialize(Origin::root())); // Initial payment = full reward for (picasso_account, remote_account) in accounts.into_iter() { assert_ok!(remote_account.associate(picasso_account)); } assert_eq!(CrowdloanRewards::claimed_rewards(), CrowdloanRewards::total_rewards()); }); }
rust_cleaned_test_functions.jsonl/41097
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 173 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8337, 84969, 6536, 2273, 59855, 368, 341, 46948, 77997, 43175, 80107, 14234, 4307, 2378, 15954, 9821, 11, 11955, 2192, 28166, 11, 220, 15, 11, 760, 6878, 9618, 91, 341, 197, 6948, 19817, 10297, 93...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_parsing_exact() { let r = req("=1.0.0"); assert!(r.to_string() == "=1.0.0".to_string()); assert_eq!(r.to_string(), "=1.0.0".to_string()); assert_match(&r, &["1.0.0"]); assert_not_match(&r, &["1.0.1", "0.9.9", "0.10.0", "0.1.0", "1.0.0-pre"]); let r = req("=0.9.0"); assert_eq!(r.to_string(), "=0.9.0".to_string()); assert_match(&r, &["0.9.0"]); assert_not_match(&r, &["0.9.1", "1.9.0", "0.0.9"]); let r = req("=0.1.0-beta2.a"); assert_eq!(r.to_string(), "=0.1.0-beta2.a".to_string()); assert_match(&r, &["0.1.0-beta2.a"]); assert_not_match(&r, &["0.9.1", "0.1.0", "0.1.1-beta2.a", "0.1.0-beta2"]); }
rust_cleaned_test_functions.jsonl/6420
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 442 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 620, 28598, 71084, 368, 341, 286, 1077, 435, 284, 4232, 445, 28, 16, 13, 15, 13, 15, 3071, 286, 2060, 10297, 81, 2389, 3904, 368, 621, 37827, 16, 13, 15, 13, 15, 3263, 983, 3904, 1423, 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_get_token_account_mint() { let mint_pubkey = SafeTokenPubkey::new(&[2; 32]); let mut account_data = vec![0; Account::get_packed_len()]; let mut account = Account::unpack_unchecked(&account_data).unwrap(); account.mint = mint_pubkey; Account::pack(account, &mut account_data).unwrap(); let expected_mint_pubkey = Pubkey::new(&[2; 32]); assert_eq!( get_token_account_mint(&account_data), Some(expected_mint_pubkey) ); }
rust_cleaned_test_functions.jsonl/32071
{ "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, 3062, 6458, 13500, 717, 396, 368, 341, 286, 1077, 28337, 34014, 792, 284, 22291, 3323, 29162, 792, 486, 931, 2099, 58, 17, 26, 220, 18, 17, 2558, 286, 1077, 5206, 2692, 1769, 284, 7486, 20703, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_state_to_bytes() { let state = 0b0011000001000001000000000000000000000000000000000000000000000000u64; let bytes = state_to_bytes(state); let expected = [48, 65, 0, 0, 0, 0, 0, 0]; assert_eq!(expected[..], bytes[..]); }
rust_cleaned_test_functions.jsonl/34950
{ "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, 4387, 2346, 12524, 368, 341, 286, 1077, 1584, 284, 220, 15, 65, 15, 15, 16, 16, 15, 15, 15, 15, 15, 16, 15, 15, 15, 15, 15, 16, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 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_broadcasting_bools() { let a = BooleanChunked::from_slice("", &[true, false, true]); let true_ = BooleanChunked::from_slice("", &[true]); let false_ = BooleanChunked::from_slice("", &[false]); let out = a.equal(&true_); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = true_.equal(&a); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = a.equal(&false_); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = false_.equal(&a); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = a.not_equal(&true_); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = true_.not_equal(&a); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = a.not_equal(&false_); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = false_.not_equal(&a); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = a.gt(&true_); assert_eq!(Vec::from(&out), &[Some(false), Some(false), Some(false)]); let out = true_.gt(&a); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = a.gt(&false_); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = false_.gt(&a); assert_eq!(Vec::from(&out), &[Some(false), Some(false), Some(false)]); let out = a.gt_eq(&true_); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = true_.gt_eq(&a); assert_eq!(Vec::from(&out), &[Some(true), Some(true), Some(true)]); let out = a.gt_eq(&false_); assert_eq!(Vec::from(&out), &[Some(true), Some(true), Some(true)]); let out = false_.gt_eq(&a); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = a.lt(&true_); assert_eq!(Vec::from(&out), &[Some(false), Some(true), Some(false)]); let out = true_.lt(&a); assert_eq!(Vec::from(&out), &[Some(false), Some(false), Some(false)]); let out = a.lt(&false_); assert_eq!(Vec::from(&out), &[Some(false), Some(false), Some(false)]); let out = false_.lt(&a); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = a.lt_eq(&true_); assert_eq!(Vec::from(&out), &[Some(true), Some(true), Some(true)]); let out = true_.lt_eq(&a); assert_eq!(Vec::from(&out), &[Some(true), Some(false), Some(true)]); let out = a.lt_eq(&false_); assert_eq!(Vec::from(&out), &[Some(false), Some(false), Some(false)]); let out = false_.lt_eq(&a); assert_eq!(Vec::from(&out), &[Some(true), Some(true), Some(true)]); }
rust_cleaned_test_functions.jsonl/96372
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1391 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 74923, 287, 22159, 82, 368, 341, 286, 1077, 264, 284, 6992, 28304, 291, 486, 1499, 26488, 19814, 44590, 1866, 11, 895, 11, 830, 2558, 286, 1077, 830, 62, 284, 6992, 28304, 291, 486, 1499, 26488,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_noserversessionstorage_drops_put() { let c = NoServerSessionStorage {}; assert_eq!(c.put(vec![0x01], vec![0x02]), false); }
rust_cleaned_test_functions.jsonl/8729
{ "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, 1089, 436, 18729, 1338, 16172, 814, 3702, 15557, 368, 341, 286, 1077, 272, 284, 2308, 5475, 5283, 5793, 9321, 286, 2060, 10714, 10297, 66, 3597, 25592, 20703, 15, 87, 15, 16, 1125, 7486, 20703, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_zero_capacities() { type HM = HashMap<i32, i32>; let m = HM::new(); assert_eq!(m.capacity(), 0); let m = HM::default(); assert_eq!(m.capacity(), 0); let m = HM::with_hasher(RandomState::new()); assert_eq!(m.capacity(), 0); let m = HM::with_capacity(0); assert_eq!(m.capacity(), 0); let m = HM::with_capacity_and_hasher(0, RandomState::new()); assert_eq!(m.capacity(), 0); let mut m = HM::new(); m.insert(1, 1); m.insert(2, 2); m.remove(&1); m.remove(&2); m.shrink_to_fit(); assert_eq!(m.capacity(), 0); let mut m = HM::new(); m.reserve(0); assert_eq!(m.capacity(), 0); }
rust_cleaned_test_functions.jsonl/8493
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 405 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19359, 16388, 580, 1361, 368, 341, 286, 943, 45414, 284, 10528, 21897, 18, 17, 11, 600, 18, 17, 19421, 286, 1077, 296, 284, 45414, 486, 931, 543, 286, 2060, 10714, 10297, 76, 59168, 1507, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_write_int_operand() { assert_eq!(write_int_operand(0), &[0x8b]); assert_eq!(write_int_operand(100), &[0xef]); assert_eq!(write_int_operand(-100), &[0x27]); assert_eq!(write_int_operand(1000), &[0xfa, 0x7c]); assert_eq!(write_int_operand(-1000), &[0xfe, 0x7c]); assert_eq!(write_int_operand(10000), &[0x1c, 0x27, 0x10]); assert_eq!(write_int_operand(-10000), &[0x1c, 0xd8, 0xf0]); assert_eq!(write_int_operand(100000), &[0x1d, 0x00, 0x01, 0x86, 0xa0]); assert_eq!(write_int_operand(-100000), &[0x1d, 0xff, 0xfe, 0x79, 0x60]); }
rust_cleaned_test_functions.jsonl/85341
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 343 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9165, 4042, 69259, 368, 341, 286, 2060, 10714, 10297, 4934, 4042, 69259, 7, 15, 701, 44590, 15, 87, 23, 65, 2558, 286, 2060, 10714, 10297, 4934, 4042, 69259, 7, 16, 15, 15, 701, 44590, 15, 475...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_nested_path() { equal_tokens! { <nodes> r#"( $it.is."great news".right yep $yep )."world""# -> b::token_list( vec![ b::parens(vec![ b::sp(), b::var("it"), b::op("."), b::bare("is"), b::op("."), b::string("great news"), b::op("."), b::bare("right"), b::sp(), b::bare("yep"), b::sp(), b::var("yep"), b::sp() ]), b::op("."), b::string("world")] ) } equal_tokens! { <nodes> r#"$it."are PAS".0"# -> b::token_list( vec![ b::var("it"), b::op("."), b::string("are PAS"), b::op("."), b::int(0), ] ) } }
rust_cleaned_test_functions.jsonl/5870
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 863 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 66279, 2638, 368, 341, 286, 6144, 28838, 0, 341, 310, 366, 20008, 397, 310, 435, 2, 29209, 400, 275, 2079, 1189, 46891, 3669, 3263, 1291, 379, 747, 400, 88, 747, 7457, 1, 14615, 3014, 2, 1464,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_for_loop_with_negative_step() { let input = " FOR i% = 7 TO -6 STEP -3 PRINT i% NEXT "; assert_prints!(input, "7", "4", "1", "-2", "-5"); }
rust_cleaned_test_functions.jsonl/64157
{ "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, 5478, 17198, 6615, 53865, 11946, 368, 341, 262, 1077, 1946, 284, 6228, 262, 4613, 600, 4, 284, 220, 22, 5146, 481, 21, 48356, 481, 18, 198, 286, 35893, 600, 13744, 262, 45011, 198, 262, 7620, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_peer_gaps() { let converge = |peers: &mut Vec<DhtArc>| { let strat: PeerStrat = PeerStratAlpha { check_gaps: true, ..Default::default() } .into(); let mut gaps = true; for _ in 0..40 { for i in 0..peers.len() { let p = peers.clone(); let arc = peers.get_mut(i).unwrap(); let view = strat.view(*arc, p.as_slice()); arc.update_length(view); } if gaps { gaps = check_for_gaps(peers.clone()); } else { let bucket = DhtArcBucket::new(peers[0].clone(), peers.clone()); assert!(!check_for_gaps(peers.clone()), "{}", bucket.to_ascii(64)); } } }; let mut peers = even_dist_peers(DEFAULT_MIN_PEERS * 10, &[MAX_HALF_LENGTH / 4]); converge(&mut peers); for arc in peers { assert_between((arc.coverage() * 100.0).round() / 100.0, 0.1, 0.15); } let mut peers = even_dist_peers(DEFAULT_MIN_PEERS, &[20]); converge(&mut peers); for arc in peers { assert_eq!((arc.coverage() * 10.0).round() / 10.0, 1.0); } }
rust_cleaned_test_functions.jsonl/75434
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 645 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 45159, 1889, 2625, 368, 341, 262, 1077, 79767, 284, 760, 375, 388, 25, 609, 6984, 11312, 29061, 426, 36809, 69844, 341, 286, 1077, 43297, 25, 45147, 2580, 266, 284, 45147, 2580, 266, 19384, 341, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
#[test] fn test_complete_data_payload_f_port() { let data = data_payload(); let phy = PhyPayload::new(&data[..]); assert!(phy.is_ok()); if let MacPayload::Data(data_payload) = phy.unwrap().mac_payload() { assert_eq!(data_payload.f_port(), Some(1)) } else { panic!("failed to parse DataPayload"); } }
rust_cleaned_test_functions.jsonl/81599
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 158 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 27675, 1769, 32813, 761, 8716, 368, 341, 262, 1077, 821, 284, 821, 32813, 543, 262, 1077, 36455, 284, 92582, 29683, 486, 931, 2099, 691, 95874, 10149, 262, 2060, 10297, 12700, 2079, 19817, 1423, 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...
2
#[test] fn test_read_corrupted_header() -> Result<(), Error> { let mut file = NamedTempFile::new()?; file.write(&[0; HEADER_SIZE])?; let result = Pager::open(file.path()); assert!(matches!(result, Err(Error::CorruptedFile))); Ok(()) }
rust_cleaned_test_functions.jsonl/127403
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 132 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 14734, 85954, 8757, 368, 1464, 5714, 68843, 4600, 29, 341, 286, 1077, 5206, 1034, 284, 40459, 12151, 1703, 486, 931, 94136, 286, 1034, 3836, 2099, 58, 15, 26, 39665, 4098, 2467, 37445, 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...
3
#[test] fn test_confirm_slot_entries_with_fix() { const HASHES_PER_TICK: u64 = 10; const TICKS_PER_SLOT: u64 = 2; let collector_id = Pubkey::new_unique(); let GenesisConfigInfo { mut genesis_config, mint_keypair, .. } = create_genesis_config(10_000); genesis_config.poh_config.hashes_per_tick = Some(HASHES_PER_TICK); genesis_config.ticks_per_slot = TICKS_PER_SLOT; let genesis_hash = genesis_config.hash(); let slot_0_bank = Arc::new(Bank::new_for_tests(&genesis_config)); assert_eq!(slot_0_bank.slot(), 0); assert_eq!(slot_0_bank.tick_height(), 0); assert_eq!(slot_0_bank.max_tick_height(), 2); assert_eq!(slot_0_bank.last_blockhash(), genesis_hash); assert_eq!(slot_0_bank.get_hash_age(&genesis_hash), Some(0)); let slot_0_entries = entry::create_ticks(TICKS_PER_SLOT, HASHES_PER_TICK, genesis_hash); let slot_0_hash = slot_0_entries.last().unwrap().hash; confirm_slot_entries_for_tests(&slot_0_bank, slot_0_entries, true, genesis_hash).unwrap(); assert_eq!(slot_0_bank.tick_height(), slot_0_bank.max_tick_height()); assert_eq!(slot_0_bank.last_blockhash(), slot_0_hash); assert_eq!(slot_0_bank.get_hash_age(&genesis_hash), Some(1)); assert_eq!(slot_0_bank.get_hash_age(&slot_0_hash), Some(0)); let slot_2_bank = Arc::new(Bank::new_from_parent(&slot_0_bank, &collector_id, 2)); assert_eq!(slot_2_bank.slot(), 2); assert_eq!(slot_2_bank.tick_height(), 2); assert_eq!(slot_2_bank.max_tick_height(), 6); assert_eq!(slot_2_bank.last_blockhash(), slot_0_hash); let slot_1_entries = entry::create_ticks(TICKS_PER_SLOT, HASHES_PER_TICK, slot_0_hash); let slot_1_hash = slot_1_entries.last().unwrap().hash; confirm_slot_entries_for_tests(&slot_2_bank, slot_1_entries, false, slot_0_hash).unwrap(); assert_eq!(slot_2_bank.tick_height(), 4); assert_eq!(slot_2_bank.last_blockhash(), slot_0_hash); assert_eq!(slot_2_bank.get_hash_age(&genesis_hash), Some(1)); assert_eq!(slot_2_bank.get_hash_age(&slot_0_hash), Some(0)); struct TestCase { recent_blockhash: Hash, expected_result: result::Result<(), BlockstoreProcessorError>, } let test_cases = [ TestCase { recent_blockhash: slot_1_hash, expected_result: Err(BlockstoreProcessorError::InvalidTransaction( TransactionError::BlockhashNotFound, )), }, TestCase { recent_blockhash: slot_0_hash, expected_result: Ok(()), }, ]; // Check that slot 2 transactions can only use hashes for completed blocks. for TestCase { recent_blockhash, expected_result, } in test_cases { let slot_2_entries = { let to_pubkey = Pubkey::new_unique(); let mut prev_entry_hash = slot_1_hash; let mut remaining_entry_hashes = HASHES_PER_TICK; let tx = system_transaction::transfer(&mint_keypair, &to_pubkey, 1, recent_blockhash); remaining_entry_hashes = remaining_entry_hashes.checked_sub(1).unwrap(); let mut entries = vec![next_entry_mut(&mut prev_entry_hash, 1, vec![tx])]; entries.push(next_entry_mut( &mut prev_entry_hash, remaining_entry_hashes, vec![], )); entries.push(next_entry_mut( &mut prev_entry_hash, HASHES_PER_TICK, vec![], )); entries }; let slot_2_hash = slot_2_entries.last().unwrap().hash; let result = confirm_slot_entries_for_tests(&slot_2_bank, slot_2_entries, true, slot_1_hash); match (result, expected_result) { (Ok(()), Ok(())) => { assert_eq!(slot_2_bank.tick_height(), slot_2_bank.max_tick_height()); assert_eq!(slot_2_bank.last_blockhash(), slot_2_hash); assert_eq!(slot_2_bank.get_hash_age(&genesis_hash), Some(2)); assert_eq!(slot_2_bank.get_hash_age(&slot_0_hash), Some(1)); assert_eq!(slot_2_bank.get_hash_age(&slot_2_hash), Some(0)); } ( Err(BlockstoreProcessorError::InvalidTransaction(err)), Err(BlockstoreProcessorError::InvalidTransaction(expected_err)), ) => { assert_eq!(err, expected_err); } (result, expected_result) => { panic!( "actual result {:?} != expected result {:?}", result, expected_result ); } } } }
rust_cleaned_test_functions.jsonl/91509
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2711 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 23800, 27563, 26092, 6615, 36060, 368, 341, 286, 733, 58857, 1570, 10617, 57260, 25, 575, 21, 19, 284, 220, 16, 15, 280, 286, 733, 75711, 50, 10617, 53047, 25, 575, 21, 19, 284, 220, 17, 401, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_infinite_recursion_arrays() { #[derive(Deserialize, Debug)] struct S { x: Option<Box<S>>, } let yaml = "&a [*a]"; let expected = "recursion limit exceeded"; test_error::<S>(yaml, expected); }
rust_cleaned_test_functions.jsonl/45580
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 114 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 1243, 25722, 7080, 34280, 68983, 368, 341, 262, 11506, 27098, 7, 64465, 11, 11091, 5563, 262, 2036, 328, 341, 286, 856, 25, 6959, 79852, 18858, 61340, 262, 555, 262, 1077, 32246, 284, 13399, 64, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_txn_store_rawkv() { let store = AssertionStorage::default(); store.raw_get_ok("".to_string(), b"key".to_vec(), None); store.raw_put_ok("".to_string(), b"key".to_vec(), b"value".to_vec()); store.raw_get_ok("".to_string(), b"key".to_vec(), Some(b"value".to_vec())); store.raw_put_ok("".to_string(), b"key".to_vec(), b"v2".to_vec()); store.raw_get_ok("".to_string(), b"key".to_vec(), Some(b"v2".to_vec())); store.raw_delete_ok("".to_string(), b"key".to_vec()); store.raw_get_ok("".to_string(), b"key".to_vec(), None); store.raw_put_ok("".to_string(), b"k1".to_vec(), b"v1".to_vec()); store.raw_put_ok("".to_string(), b"k2".to_vec(), b"v2".to_vec()); store.raw_put_ok("".to_string(), b"k3".to_vec(), b"v3".to_vec()); store.raw_scan_ok("".to_string(), b"".to_vec(), 1, vec![(b"k1", b"v1")]); store.raw_scan_ok("".to_string(), b"k1".to_vec(), 1, vec![(b"k1", b"v1")]); store.raw_scan_ok("".to_string(), b"k10".to_vec(), 1, vec![(b"k2", b"v2")]); store.raw_scan_ok( "".to_string(), b"".to_vec(), 2, vec![(b"k1", b"v1"), (b"k2", b"v2")], ); store.raw_scan_ok( "".to_string(), b"k1".to_vec(), 5, vec![(b"k1", b"v1"), (b"k2", b"v2"), (b"k3", b"v3")], ); store.raw_scan_ok("".to_string(), b"".to_vec(), 0, vec![]); store.raw_scan_ok("".to_string(), b"k5".to_vec(), 1, vec![]); }
rust_cleaned_test_functions.jsonl/63408
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 746 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 92299, 14809, 16067, 43408, 368, 341, 262, 1077, 3553, 284, 46730, 5793, 486, 2258, 543, 262, 3553, 18152, 3062, 19817, 445, 3263, 983, 3904, 1507, 293, 1, 792, 3263, 983, 13251, 1507, 2240, 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_serialize_options() { let reference: Element = "<options xmlns='http://jabber.org/protocol/pubsub' jid='juliet@capulet.lit/balcony'><x xmlns='jabber:x:data' type='submit'/></options>" .parse() .unwrap(); let elem: Element = "<x xmlns='jabber:x:data' type='submit'/>".parse().unwrap(); let form = DataForm::try_from(elem).unwrap(); let options = Options { jid: Jid::Full(FullJid::new("juliet", "capulet.lit", "balcony")), node: None, subid: None, form: Some(form), }; let serialized: Element = options.into(); assert_eq!(serialized, reference); }
rust_cleaned_test_functions.jsonl/125431
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 326 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 88686, 8743, 368, 341, 286, 1077, 5785, 25, 8543, 284, 4055, 2875, 24967, 1131, 1254, 1110, 38916, 652, 2659, 14, 17014, 59492, 1966, 6, 502, 307, 1131, 73, 360, 3891, 31, 11346, 48418, 918, 275...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_str_to_variable() { let case1 = "@1"; assert_eq!( common_pb::Variable { tag: Some(common_pb::NameOrId::from(1)), property: None }, common_pb::Variable::from(case1.to_string()) ); let case2 = "@a"; assert_eq!( common_pb::Variable { tag: Some(common_pb::NameOrId::from("a".to_string())), property: None }, common_pb::Variable::from(case2.to_string()) ); let case3 = "@1.~id"; assert_eq!( common_pb::Variable { tag: Some(common_pb::NameOrId::from(1)), property: Some(common_pb::Property { item: Some(common_pb::property::Item::Id(common_pb::IdKey {})) }) }, common_pb::Variable::from(case3.to_string()) ); let case4 = "@1.~label"; assert_eq!( common_pb::Variable { tag: Some(common_pb::NameOrId::from(1)), property: Some(common_pb::Property { item: Some(common_pb::property::Item::Label(common_pb::LabelKey {})) }) }, common_pb::Variable::from(case4.to_string()) ); let case5 = "@1.name"; assert_eq!( common_pb::Variable { tag: Some(common_pb::NameOrId::from(1)), property: Some(common_pb::Property { item: Some(common_pb::property::Item::Key("name".to_string().into())) }) }, common_pb::Variable::from(case5.to_string()) ); let case6 = "@.name"; assert_eq!( common_pb::Variable { tag: None, property: Some(common_pb::Property { item: Some(common_pb::property::Item::Key("name".to_string().into())) }) }, common_pb::Variable::from(case6.to_string()) ); let case7 = "@"; assert_eq!( common_pb::Variable { tag: None, property: None }, common_pb::Variable::from(case7.to_string()) ); }
rust_cleaned_test_functions.jsonl/121611
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1171 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2895, 2346, 14635, 368, 341, 286, 1077, 1142, 16, 284, 8428, 16, 876, 286, 2060, 10714, 33673, 310, 4185, 31409, 486, 7827, 314, 4772, 25, 4329, 57802, 31409, 486, 675, 2195, 764, 486, 1499, 7, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_primitive_array_raise_power_scalar() { let a = Float64Array::from(vec![1.0, 2.0, 3.0]); let actual = powf_scalar(&a, 2.0).unwrap(); let expected = Float64Array::from(vec![1.0, 4.0, 9.0]); assert_eq!(expected, actual); let a = Float64Array::from(vec![Some(1.0), None, Some(3.0)]); let actual = powf_scalar(&a, 2.0).unwrap(); let expected = Float64Array::from(vec![Some(1.0), None, Some(9.0)]); assert_eq!(expected, actual); }
rust_cleaned_test_functions.jsonl/120286
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 255 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 84087, 3858, 55383, 20421, 41652, 368, 341, 286, 1077, 264, 284, 13001, 21, 19, 1857, 486, 1499, 25592, 20703, 16, 13, 15, 11, 220, 17, 13, 15, 11, 220, 18, 13, 15, 2558, 286, 1077, 5042, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_kdf_kbkdf_6803_128() { let input_key: [u8; 16] = [ 0x57, 0xD0, 0x29, 0x72, 0x98, 0xFF, 0xD9, 0xD3, 0x5D, 0xE5, 0xA4, 0x7F, 0xB4, 0xBD, 0xE2, 0x4B, ]; let iv: [u8; 16] = [0; 16]; let in_out: [([u8; 5], [u8; 16]); 3] = [ ( [0x00, 0x00, 0x00, 0x02, 0x99], [ 0xD1, 0x55, 0x77, 0x5A, 0x20, 0x9D, 0x05, 0xF0, 0x2B, 0x38, 0xD4, 0x2A, 0x38, 0x9E, 0x5A, 0x56, ], ), ( [0x00, 0x00, 0x00, 0x02, 0xaa], [ 0x64, 0xDF, 0x83, 0xF8, 0x5A, 0x53, 0x2F, 0x17, 0x57, 0x7D, 0x8C, 0x37, 0x03, 0x57, 0x96, 0xAB, ], ), ( [0x00, 0x00, 0x00, 0x02, 0x55], [ 0x3E, 0x4F, 0xBD, 0xF3, 0x0F, 0xB8, 0x25, 0x9C, 0x42, 0x5C, 0xB6, 0xC9, 0x6F, 0x1F, 0x46, 0x35, ], ), ]; for (constant, output) in in_out { let args = [ &KdfArgument::KbMode(KdfKbMode::Feedback), &KdfArgument::Mac(KdfMacType::Cmac( Cipher::from_nid(Nid::CAMELLIA_128_CBC).unwrap(), )), &KdfArgument::Key(&input_key), &KdfArgument::Salt(&constant), &KdfArgument::KbSeed(&iv), ]; let key_out = crate::perform_kdf(KdfType::KeyBased, &args, 16).unwrap(); assert_eq!(key_out, output,); } }
rust_cleaned_test_functions.jsonl/93743
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1183 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4698, 2940, 4698, 40029, 2940, 62, 21, 23, 15, 18, 62, 16, 17, 23, 368, 341, 286, 1077, 1946, 3097, 25, 508, 84, 23, 26, 220, 16, 21, 60, 284, 2278, 310, 220, 15, 87, 20, 22, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_hashmap_example_old() { let mut map = HashMap::<i32, i32>::new(); map.insert(1, 100); map.insert(2, 200); map.remove(&2); assert_eq!(map.get(&2), None); }
rust_cleaned_test_functions.jsonl/109514
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 101 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8950, 2186, 39304, 21108, 368, 341, 262, 1077, 5206, 2415, 284, 10528, 27638, 72, 18, 17, 11, 600, 18, 17, 6831, 931, 543, 262, 2415, 7030, 7, 16, 11, 220, 16, 15, 15, 317, 262, 2415, 7030, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_filter_const_data_block() -> Result<()> { let schema = DataSchemaRefExt::create(vec![ DataField::new("a", i8::to_data_type()), DataField::new("b", Vu8::to_data_type()), ]); let block = DataBlock::create(schema, vec![ Series::from_data(vec![1i8, 1, 2, 1, 2, 3]), Arc::new(ConstColumn::new( Series::from_data(vec![vec![b'x', b'1']]), 6, )), ]); let predicate = Series::from_data(vec![true, false, true, true, false, false]); let block = DataBlock::filter_block(&block, &predicate)?; common_datablocks::assert_blocks_eq( vec![ "+---+----+", "| a | b |", "+---+----+", "| 1 | x1 |", "| 2 | x1 |", "| 1 | x1 |", "+---+----+", ], &[block], ); Ok(()) }
rust_cleaned_test_functions.jsonl/132728
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 477 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8727, 13610, 1769, 7113, 368, 1464, 5714, 71698, 341, 262, 1077, 10802, 284, 2885, 8632, 3945, 6756, 486, 3182, 25592, 90515, 286, 2885, 1877, 486, 931, 445, 64, 497, 600, 23, 486, 983, 1769, 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...
2
#[test] fn test_rendez_vous_new_client() { let mut protocol = Protocol::new(get_default_fl_settings()); let client_id = ClientId::new(); let resp = protocol.rendez_vous(client_id, ClientState::Unknown); let counters = protocol.counters(); let expected = Counters { waiting: 1, ..Default::default() }; assert_eq!(counters, expected); assert_eq!(RendezVousResponse::Accept, resp); assert_eq!(protocol.next_event().unwrap(), Event::Accept(client_id)); assert_eq!(protocol.next_event().unwrap(), Event::RunSelection(1)); assert!(protocol.next_event().is_none()); }
rust_cleaned_test_functions.jsonl/97762
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 295 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 1288, 303, 10125, 2273, 782, 5921, 8179, 368, 341, 286, 1077, 5206, 11507, 284, 24572, 486, 931, 5433, 9993, 5081, 10853, 1423, 286, 1077, 2943, 842, 284, 8423, 764, 486, 931, 1428, 286, 1077, 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_raw_node_restart_from_snapshot() { setup_for_test(); let snap = new_snapshot(2, 1, vec![1, 2]); let entries = vec![new_entry(1, 3, Some("foo"))]; let st = hard_state(1, 3, 0); let s = new_storage(); s.wl().set_hardstate(st); s.wl().apply_snapshot(snap).expect(""); s.wl().append(&entries).expect(""); let mut raw_node = new_raw_node(1, vec![], 10, 1, s, vec![]); let rd = raw_node.ready(); assert!(cmp_ready(&rd, &None, &None, &[], entries.clone(), false)); raw_node.advance(rd); assert!(!raw_node.has_ready()); }
rust_cleaned_test_functions.jsonl/2062
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 267 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16067, 5084, 69392, 5673, 53265, 368, 341, 262, 6505, 5478, 4452, 543, 262, 1077, 10658, 284, 501, 53265, 7, 17, 11, 220, 16, 11, 7486, 20703, 16, 11, 220, 17, 2558, 262, 1077, 10695, 284, 748...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_write() { let tap_ip_guard = TAP_IP_LOCK.lock().unwrap(); let mut tap = Tap::new(1).unwrap(); tap.set_ip_addr((*tap_ip_guard).parse().unwrap()).unwrap(); tap.set_netmask(SUBNET_MASK.parse().unwrap()).unwrap(); tap.enable().unwrap(); let (mac, _, mut rx) = pnet_get_mac_tx_rx(tap_name_to_string(&tap)); let payload = DATA_STRING.as_bytes(); // vnet hdr + eth hdr + ip hdr + udp hdr + payload len let buf_size = 10 + 14 + 20 + 8 + payload.len(); let mut buf = vec![0u8; buf_size]; // leave the vnet hdr as is pnet_build_packet(&mut buf[10..], mac, payload); assert!(tap.write(&buf[..]).is_ok()); assert!(tap.flush().is_ok()); let (channel_tx, channel_rx) = mpsc::channel(); // We use a separate thread to wait for the test packet because the API exposed by pnet is let _handle = thread::spawn(move || loop { let buf = rx.next().unwrap(); let p = ParsedPkt::new(buf); p.print(); if let Some(ref udp) = p.udp { if payload == udp.payload() { channel_tx.send(true).unwrap(); break; } } }); // We wait for at most SLEEP_MILLIS * SLEEP_ITERS milliseconds for the reception of the // test packet to be detected. static SLEEP_MILLIS: u64 = 500; static SLEEP_ITERS: u32 = 6; let mut found_test_packet = false; for _ in 0..SLEEP_ITERS { thread::sleep(Duration::from_millis(SLEEP_MILLIS)); if let Ok(true) = channel_rx.try_recv() { found_test_packet = true; break; } } assert!(found_test_packet); }
rust_cleaned_test_functions.jsonl/55548
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 932 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9165, 368, 341, 286, 1077, 15239, 10385, 36796, 284, 350, 2537, 16607, 27661, 21003, 1005, 15454, 1428, 286, 1077, 5206, 15239, 284, 36134, 486, 931, 7, 16, 568, 15454, 543, 286, 15239, 980, 10385...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
#[test] fn test_block_param() { let mut handlebars = Registry::new(); assert!(handlebars .register_template_string("t0", "{{#each a as |i|}}{{i}}{{/each}}") .is_ok()); let m1 = btreemap! { "a".to_string() => vec![1,2,3,4,5] }; let r0 = handlebars.render("t0", &m1).unwrap(); assert_eq!(r0, "12345"); }
rust_cleaned_test_functions.jsonl/127939
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 218 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 7113, 4090, 368, 341, 286, 1077, 5206, 3705, 24950, 284, 32112, 486, 931, 543, 286, 2060, 10297, 8192, 24950, 198, 310, 659, 6343, 8693, 3904, 445, 83, 15, 497, 47219, 2, 9547, 264, 438, 760, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_bisection() { let debugger = AptosDebugger::new(Box::new(TestInterface::empty(100))); let check = |v: Vec<bool>, result| { assert_eq!( debugger .bisect_transaction_impl( |version| { if v[version as usize] { Ok(()) } else { bail!("Err") } }, 0, v.len() as u64 ) .unwrap(), result ); }; check(vec![true, true, true, true], None); check(vec![true, true, true, false], Some(3)); check(vec![true, true, false, false], Some(2)); check(vec![false, false, false, false], Some(0)); }
rust_cleaned_test_functions.jsonl/96206
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 505 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 1064, 407, 368, 341, 262, 1077, 44473, 284, 96987, 436, 67239, 486, 931, 67758, 486, 931, 31159, 5051, 486, 3194, 7, 16, 15, 15, 4945, 262, 1077, 1779, 284, 760, 85, 25, 11312, 17028, 806...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_package_split_untractable() { let txid = Txid::from_hex("c2d4449afa8d26140898dd54d3390b057ba2a5afcf03ba29d7dc0d8b9ffe966e").unwrap(); let htlc_outp_one = dumb_htlc_output!(); let mut package_one = PackageTemplate::build_package(txid, 0, htlc_outp_one, 1000, true, 100); let ret_split = package_one.split_package(&BitcoinOutPoint { txid, vout: 0}); assert!(ret_split.is_none()); }
rust_cleaned_test_functions.jsonl/35571
{ "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, 26328, 17052, 4907, 2144, 480, 368, 341, 197, 10217, 9854, 307, 284, 39850, 307, 486, 1499, 32655, 445, 66, 17, 67, 19, 19, 19, 24, 35834, 23, 67, 17, 21, 16, 19, 15, 23, 24, 23, 631, 20, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_account_transactions() { let (mock_db, client, _runtime) = create_database_client_and_runtime(); for (acc, blob) in mock_db.all_accounts.iter() { let total = AccountResource::try_from(blob).unwrap().sequence_number(); let tx_views = client .get_account_transactions(*acc, 0, max(1, min(1000, total * 2)), true) .unwrap() .into_inner(); assert_eq!(tx_views.len() as u64, total); } }
rust_cleaned_test_functions.jsonl/102714
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 217 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 13500, 68182, 368, 341, 262, 1077, 320, 16712, 8685, 11, 2943, 11, 716, 22255, 8, 284, 1855, 27341, 8179, 8378, 33232, 1428, 262, 369, 320, 4475, 11, 23404, 8, 304, 7860, 8685, 7670, 55665...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_source_uri_from_str_http_without_git_extension() { assert_source_uri_from_str( "https://github.com/ffizer/ffizer", "ffizer/ffizer", Some("github.com"), ); }
rust_cleaned_test_functions.jsonl/104988
{ "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, 10347, 15572, 5673, 2895, 25888, 39904, 68801, 31035, 368, 341, 286, 2060, 10347, 15572, 5673, 2895, 1006, 310, 330, 2428, 1110, 5204, 905, 14, 542, 3135, 14, 542, 3135, 756, 310, 330, 542, 3135, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_node_key_and_node_mismatch_descending() { let mut builder = ConfigurationBuilder::default(); builder.add( InMemorySource::from_string_slice(TEST_JSON.trim()), Json::default(), ); let configuration = builder.build().unwrap().merge_owned().unwrap(); let result: Result<Option<i32>, ConfigurationError> = configuration.get_result("map:[1]"); let error = result.unwrap_err(); assert!(std::matches!(error.get_code(), ErrorCode::WrongKeyType(..))); let error_string = error.to_string(); assert!(error_string.contains("map-->[1]")); let result: Result<Option<i32>, ConfigurationError> = configuration.get_result("map:array1:one"); let error = result.unwrap_err(); assert!(std::matches!(error.get_code(), ErrorCode::WrongKeyType(..))); let error_string = error.to_string(); assert!(error_string.contains("map-->array1-->one")); }
rust_cleaned_test_functions.jsonl/20040
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 349 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5084, 3097, 8378, 5084, 717, 24976, 10986, 2459, 368, 341, 262, 1077, 5206, 7363, 284, 12221, 3297, 486, 2258, 543, 262, 7363, 1364, 1006, 286, 758, 10642, 3608, 486, 1499, 3904, 26488, 50320, 253...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_ord() { let cases = vec![ (Some("2"), Collation::Utf8Mb4Bin, Some(50i64)), (Some("23"), Collation::Utf8Mb4Bin, Some(50i64)), (Some("2.3"), Collation::Utf8Mb4Bin, Some(50i64)), (Some(""), Collation::Utf8Mb4Bin, Some(0i64)), (Some("你好"), Collation::Utf8Mb4Bin, Some(14990752i64)), (Some("にほん"), Collation::Utf8Mb4Bin, Some(14909867i64)), (Some("한국"), Collation::Utf8Mb4Bin, Some(15570332i64)), (Some("👍"), Collation::Utf8Mb4Bin, Some(4036989325i64)), (Some("א"), Collation::Utf8Mb4Bin, Some(55184i64)), (Some("2.3"), Collation::Utf8Mb4GeneralCi, Some(50i64)), (None, Collation::Utf8Mb4Bin, Some(0)), (Some("a"), Collation::Latin1Bin, Some(97i64)), (Some("ab"), Collation::Latin1Bin, Some(97i64)), (Some("你好"), Collation::Latin1Bin, Some(228i64)), ]; for (arg, collation, expect_output) in cases { let output = RpnFnScalarEvaluator::new() .return_field_type( FieldTypeBuilder::new() .tp(FieldTypeTp::LongLong) .collation(collation) .build(), ) .push_param(arg.map(|s| s.as_bytes().to_vec())) .evaluate(ScalarFuncSig::Ord) .unwrap(); assert_eq!(output, expect_output); } }
rust_cleaned_test_functions.jsonl/60497
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 879 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 67324, 368, 341, 286, 1077, 5048, 284, 7486, 90515, 310, 320, 8373, 445, 17, 3975, 12905, 367, 486, 38980, 23, 87313, 19, 28794, 11, 4329, 7, 20, 15, 72, 21, 19, 6965, 310, 320, 8373, 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...
2
#[test] fn test_known_encryption_vectors() { let test_keys = SivEncryptionKeys { siv_key: HmacKey::from_slice(&from_hexstr("2ceaccb6b306992f6affd27049b62d823a90f8125a808d292e27f5f82bf7629b8f9ada4a8135ed99cf5d5aef0ca6a69fe54104a8246e7e5a6bb210d0c945559834d3d12b40bd61cf75a462aad1a0d71d0d963957fb8270e83902f48bfd7b8e8f0603c503238c3b24c8f4ab645c521732f31bd0b3d455448f33d56102476ee5c3")).unwrap(), cipher_key: HmacKey::from_slice(&from_hexstr("8d45ccdc385e71c9ab0619d212fcc5118fb44c7d8b37d5dc0db4214b9787905913bdd73e3afe1db5fbea82263d3171c17d2acdf88517e6d78cdb5339f10f50ef68a55950aca578c7a170476da81a705abdf031e74bf6fbf65180e51ee14983c7d100f377cea3a27caca46fd2e2bb2cca48afd5f49cf18fbe43d580e0465b308a")).unwrap(), }; let test_aad = b"aad"; let test_plaintext = b"plaintext"; let test_siv = SIV::from_slice(&from_hexstr("805165cad67979f70e16de978a34693972856db82c390b5bc824fc197a68d5d5")).unwrap(); let test_ciphertext = from_hexstr("c7a4a22690419ee831"); let (siv, ciphertext) = test_keys.encrypt(test_aad, test_plaintext); assert_eq!(siv, test_siv); assert_eq!(ciphertext, test_ciphertext); // This test vector was generated using an independent Python implementation let test_keys = SivEncryptionKeys { siv_key: HmacKey::from_slice(&from_hexstr("bf2bb483cb12aa8fb38370c3f1debfbe6f357ab0b4f0468107e95fa744f8f8419ad3a24dc2789e815ddd4a91852c96b79c6a79da6fd0b90a80359f1f91630a66389788d704e011870c04211527c7175f8dfa560779113ebe2f2486bde5d1cef883d9ad5b80f2e0530782c2d287107023f7b5834f98a370bb3310b39d58376d28")).unwrap(), cipher_key: HmacKey::from_slice(&from_hexstr("0b4d46a0f976497075238d681c7738c128eaeed7394eb700af0a00f7a452193cad43d2fa99360da728f42d1ddd45a4bc8c14ffe0eb4a40e33bf9180c5bb1201ef25615b55dd8b109f6a9f019157460aeae57bc2dd1ab6b0676386cbfd30d60ce96413dee81a339fc7d537f9a5c21bcf9836e9e40c68edaaf6a0fb18a0f7a1338")).unwrap(), }; let test_aad = b"archive id"; let test_plaintext = b"deterministic authenticated encryption"; let test_siv = SIV::from_slice(&from_hexstr("1f5453bee0dee9b19cecc680249d3410d275801109f8780204d698fba56fb33c")).unwrap(); let test_ciphertext = from_hexstr("5f0271a16eb3f842cd268078a34bca95b7b35a57b260edb6870a058c37461efb373a02d419e8"); let (siv, ciphertext) = test_keys.encrypt(test_aad, test_plaintext); assert_eq!(siv, test_siv); assert_eq!(ciphertext, test_ciphertext); }
rust_cleaned_test_functions.jsonl/1520
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1201 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 71690, 13781, 15597, 49158, 368, 341, 197, 10217, 1273, 12631, 284, 328, 344, 79239, 8850, 341, 298, 1903, 344, 3097, 25, 472, 11948, 1592, 486, 1499, 26488, 2099, 1499, 32655, 495, 445, 17, 346, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_cp_reflink_bad() { let (_, mut ucmd) = at_and_ucmd!(); let _result = ucmd .arg("--reflink=bad") .arg(TEST_HELLO_WORLD_SOURCE) .arg(TEST_EXISTING_FILE) .fails() .stderr_contains("invalid argument"); }
rust_cleaned_test_functions.jsonl/21279
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 148 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 39811, 7793, 2080, 34199, 368, 341, 262, 1077, 39464, 5206, 575, 8710, 8, 284, 518, 8378, 68887, 2277, 0, 543, 262, 1077, 716, 1382, 284, 575, 8710, 198, 286, 659, 858, 21549, 1097, 2080, 28, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_process_distribute_stake() { let (genesis_config, sender_keypair) = create_genesis_config(sol_to_lamports(9_000_000.0)); let bank = Bank::new(&genesis_config); let bank_client = BankClient::new(bank); test_process_distribute_stake_with_client(bank_client, sender_keypair); }
rust_cleaned_test_functions.jsonl/78031
{ "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, 11305, 814, 80133, 1261, 726, 368, 341, 286, 1077, 320, 77894, 5332, 11, 4646, 3097, 12670, 8, 284, 1855, 16322, 13774, 5332, 80608, 2346, 907, 309, 3394, 7, 24, 62, 15, 15, 15, 62, 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_yclip_prefix_custom() { let y = b"GGGGGGATG"; let x = b"ATG"; let score = |a: u8, b: u8| if a == b { 1i32 } else { -1i32 }; let scoring = Scoring::new(-5, -1, &score).yclip(-5); let mut aligner = banded::Aligner::with_scoring(scoring, 10, 10); let alignment = aligner.custom(x, y); assert_eq!(alignment.operations, [Yclip(6), Match, Match, Match]); }
rust_cleaned_test_functions.jsonl/126760
{ "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, 4178, 7974, 13974, 15875, 368, 341, 286, 1077, 379, 284, 293, 1, 22254, 22254, 22254, 828, 38, 876, 286, 1077, 856, 284, 293, 1, 828, 38, 3302, 286, 1077, 5456, 284, 760, 64, 25, 575, 23, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_bytes_as_duration() { test_none_with_ctx_and_extra(cast_bytes_as_duration); let cs: Vec<Bytes> = vec![ b"17:51:04.78".to_vec(), b"-17:51:04.78".to_vec(), b"17:51:04.78".to_vec(), b"-17:51:04.78".to_vec(), ]; test_as_duration_helper( cs, |x| String::from_utf8_lossy(x).to_string(), |x| String::from_utf8_lossy(x).to_string(), cast_bytes_as_duration, "cast_bytes_as_duration", ); }
rust_cleaned_test_functions.jsonl/101807
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 329 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12524, 11898, 25454, 368, 341, 286, 1273, 31488, 6615, 15147, 8378, 31858, 1337, 559, 12524, 11898, 25454, 626, 286, 1077, 10532, 25, 11312, 27, 7078, 29, 284, 7486, 90515, 310, 293, 1, 16, 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_trailing_garbage() { let r = super::parser::parse( r#" block 0 { exit(200); } xxx"#, ); assert!(r.is_err()); }
rust_cleaned_test_functions.jsonl/55927
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 138 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3547, 14277, 1889, 277, 20652, 368, 341, 286, 1077, 435, 284, 2256, 486, 9657, 486, 6400, 1006, 310, 435, 2, 698, 310, 2504, 220, 15, 341, 394, 4869, 7, 17, 15, 15, 317, 310, 335, 220, 12319...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_rpc_processor_get_block_commitment() { let exit = Arc::new(AtomicBool::new(false)); let validator_exit = create_validator_exit(&exit); let bank_forks = new_bank_forks().0; let ledger_path = get_tmp_ledger_path!(); let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap()); let commitment_slot0 = BlockCommitment::new([8; MAX_LOCKOUT_HISTORY + 1]); let commitment_slot1 = BlockCommitment::new([9; MAX_LOCKOUT_HISTORY + 1]); let mut block_commitment: HashMap<u64, BlockCommitment> = HashMap::new(); block_commitment .entry(0) .or_insert_with(|| commitment_slot0.clone()); block_commitment .entry(1) .or_insert_with(|| commitment_slot1.clone()); let block_commitment_cache = Arc::new(RwLock::new(BlockCommitmentCache::new( block_commitment, 0, 42, bank_forks.read().unwrap().working_bank(), blockstore.clone(), 0, 0, ))); let mut config = JsonRpcConfig::default(); config.enable_validator_exit = true; let cluster_info = Arc::new(ClusterInfo::default()); let request_processor = JsonRpcRequestProcessor::new( config, bank_forks.clone(), block_commitment_cache, blockstore, validator_exit, RpcHealth::stub(), cluster_info.clone(), Hash::default(), Arc::new(SendTransactionService::new( &cluster_info, &bank_forks, &exit, )), ); assert_eq!( request_processor.get_block_commitment(0), RpcBlockCommitment { commitment: Some(commitment_slot0.commitment), total_stake: 42, } ); assert_eq!( request_processor.get_block_commitment(1), RpcBlockCommitment { commitment: Some(commitment_slot1.commitment), total_stake: 42, } ); assert_eq!( request_processor.get_block_commitment(2), RpcBlockCommitment { commitment: None, total_stake: 42, } ); }
rust_cleaned_test_functions.jsonl/14452
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1238 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 60799, 50127, 3062, 7113, 36346, 478, 368, 341, 286, 1077, 4869, 284, 19689, 486, 931, 7, 65857, 11233, 486, 931, 3576, 1106, 286, 1077, 22935, 16880, 284, 1855, 64959, 16880, 2099, 13652, 317, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_generate_empty_package_manifest() -> Result<()> { let tempdir = tempfile::tempdir().unwrap(); let root = tempdir.path(); let build_manifest_path = root.join("build.manifest"); let meta_package_path = root.join("package"); let package_manifest_path = root.join("package_manifest.json"); let mut build_manifest = File::create(&build_manifest_path).unwrap(); let _package_manifest = File::create(&package_manifest_path).unwrap(); let meta_package_file = File::create(&meta_package_path).unwrap(); build_manifest .write_all(format!("meta/package={}", meta_package_path.display()).as_bytes())?; let meta_package = MetaPackage::from_name("my-package".parse().unwrap()); meta_package.serialize(meta_package_file).unwrap(); let cmd = BuildCommand { build_manifest_path, package_manifest_path: Some(package_manifest_path.clone()), out: PathBuf::from("./out"), published_name: String::from("package"), }; cmd_package_build(cmd).unwrap(); let package_manifest = read_to_string(package_manifest_path).unwrap(); assert_eq!( serde_json::from_str::<serde_json::Value>(&package_manifest).unwrap(), serde_json::json!({ "version": "1", "package": { "name": "package", "version": "0", }, "blobs": [ { "source_path": "./out/meta.far", "path": "meta/", "merkle": "421f08d453e25059d5908923901582e683dbce82fe697e40656bd74e143a96a5", "size": 8192, } ], }), ); Ok(()) }
rust_cleaned_test_functions.jsonl/104042
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 962 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 48851, 15124, 26328, 74269, 368, 1464, 5714, 71698, 341, 286, 1077, 2730, 3741, 284, 54819, 486, 3888, 3741, 1005, 15454, 543, 286, 1077, 3704, 284, 2730, 3741, 3875, 543, 286, 1077, 1936, 74269, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_i128_max() { Python::with_gil(|py| { let v = std::i128::MAX; let obj = v.to_object(py); assert_eq!(v, obj.extract::<i128>(py).unwrap()); assert_eq!(v as u128, obj.extract::<u128>(py).unwrap()); assert!(obj.extract::<u64>(py).is_err()); }) }
rust_cleaned_test_functions.jsonl/24280
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 196 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5318, 16, 17, 23, 6345, 368, 341, 286, 13027, 486, 4197, 1889, 321, 22428, 3288, 91, 341, 310, 1077, 348, 284, 1460, 486, 72, 16, 17, 23, 486, 10586, 280, 310, 1077, 2839, 284, 348, 2389, 53...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_range() { assert_eq!(parse_range("lines=0-10", 1000), Err("invalid range unit")); assert_eq!(parse_range("bytes=500-", 1000), Ok(Some(Range { start: 500, end: 1000}))); assert_eq!(parse_range("bytes=2000-", 1000), Ok(None)); assert_eq!(parse_range("bytes=-100", 1000), Ok(Some(Range { start: 900, end: 1000}))); assert_eq!(parse_range("bytes=-2000", 1000), Ok(None)); assert_eq!(parse_range("bytes=100-200", 1000), Ok(Some(Range { start: 100, end: 201}))); assert_eq!(parse_range("bytes=500-999", 1000), Ok(Some(Range { start: 500, end: 1000}))); assert_eq!(parse_range("bytes=500-1000", 1000), Ok(None)); assert_eq!(parse_range("bytes=200-100", 1000), Ok(None)); assert_eq!(parse_range("bytes=1500-2000", 1000), Ok(None)); assert_eq!(parse_range("bytes=", 1000), Err("invalid range")); assert_eq!(parse_range("bytes=a-", 1000), Err("invalid range number")); assert_eq!(parse_range("bytes=a-b", 1000), Err("invalid range number")); assert_eq!(parse_range("bytes=-b", 1000), Err("invalid range number")); }
rust_cleaned_test_functions.jsonl/57525
{ "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, 9698, 368, 341, 262, 2060, 10714, 10297, 6400, 9698, 445, 7969, 28, 15, 12, 16, 15, 497, 220, 16, 15, 15, 15, 701, 15495, 445, 11808, 2088, 4982, 14929, 262, 2060, 10714, 10297, 6400, 9698, 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_fill_playlist() { use crate::index; let db = db::_get_test_db("fill_playlist.sqlite"); index::update(&db).unwrap(); let mut playlist_content: Vec<String> = index::flatten(&db, Path::new("root")) .unwrap() .into_iter() .map(|s| s.path) .collect(); assert_eq!(playlist_content.len(), 12); let first_song = playlist_content[0].clone(); playlist_content.push(first_song); assert_eq!(playlist_content.len(), 13); save_playlist("all_the_music", "test_user", &playlist_content, &db).unwrap(); let songs = read_playlist("all_the_music", "test_user", &db).unwrap(); assert_eq!(songs.len(), 13); assert_eq!(songs[0].title, Some("Above The Water".to_owned())); assert_eq!(songs[12].title, Some("Above The Water".to_owned())); use std::path::PathBuf; let mut first_song_path = PathBuf::new(); first_song_path.push("root"); first_song_path.push("Khemmis"); first_song_path.push("Hunted"); first_song_path.push("01 - Above The Water.mp3"); assert_eq!(songs[0].path, first_song_path.to_str().unwrap()); // Save again to verify that we don't dupe the content save_playlist("all_the_music", "test_user", &playlist_content, &db).unwrap(); let songs = read_playlist("all_the_music", "test_user", &db).unwrap(); assert_eq!(songs.len(), 13); }
rust_cleaned_test_functions.jsonl/60430
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 502 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30728, 69267, 368, 341, 41819, 17717, 486, 1252, 401, 10217, 2927, 284, 2927, 13541, 455, 4452, 8685, 445, 7559, 69267, 42167, 797, 26327, 486, 2386, 2099, 1999, 568, 15454, 1428, 10217, 5206, 26791...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_supplies_buy_clothes_twice() { let mut supplies = Supplies::new(); supplies.buy_clothes(200).unwrap(); supplies.buy_clothes(200).unwrap(); assert_eq!(300, supplies.money); assert_eq!(400, supplies.clothes); }
rust_cleaned_test_functions.jsonl/28666
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 132 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 23723, 7202, 46348, 666, 385, 6375, 54178, 558, 368, 341, 286, 1077, 5206, 16720, 284, 50252, 486, 931, 543, 286, 16720, 63871, 666, 385, 6375, 7, 17, 15, 15, 568, 15454, 543, 286, 16720, 63871,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_tracking_channels() { static CASES: &[(&str, bool)] = &[ ("stable", true), ("beta", true), ("nightly", true), ("nightly-2020-10-04", false), ("1.48", true), ("1.47.0", false), ]; for case in CASES { let full_tcn = format!("{}-x86_64-unknown-linux-gnu", case.0); let tcd = ToolchainDesc::from_str(&full_tcn).unwrap(); eprintln!("Considering {}", case.0); assert_eq!(tcd.is_tracking(), case.1); } }
rust_cleaned_test_functions.jsonl/30003
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 317 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 66105, 19291, 368, 341, 286, 1099, 38319, 50, 25, 44590, 2099, 495, 11, 1807, 7252, 284, 609, 9640, 310, 3489, 27992, 497, 830, 1326, 310, 3489, 19127, 497, 830, 1326, 310, 3489, 9287, 398, 497,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
6
#[test] fn test_is_locked_out_root_slot_child_pass() { let mut locktower = Locktower::new(EpochStakes::new_for_tests(2), 0, 0.67); let descendants = vec![(0, vec![1].into_iter().collect())] .into_iter() .collect(); locktower.lockouts.root_slot = Some(0); assert!(!locktower.is_locked_out(1, &descendants)); }
rust_cleaned_test_functions.jsonl/25564
{ "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, 6892, 60271, 6068, 12993, 27563, 17268, 15464, 368, 341, 286, 1077, 5206, 5296, 77578, 284, 15701, 77578, 486, 931, 10722, 79, 4953, 623, 2050, 486, 931, 5478, 32509, 7, 17, 701, 220, 15, 11, 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