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_czech() { let mut zmachine = make_zmachine("tests/czech/czech.z3"); zmachine.set_interpreter_metadata(InterpreterMetadata { interpreter_number: 0, interpreter_version: 0, standard_version_major: 1, standard_version_minor: 0, }); zmachine.restart(); let output = run_zmachine(zmachine, &[]); assert_eq_with_diff(&output, &read_output("tests/czech/czech.out3")); }
rust_cleaned_test_functions.jsonl/62150
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 191 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 666, 25751, 368, 341, 262, 1077, 5206, 1147, 32056, 284, 1281, 6415, 32056, 445, 23841, 2899, 25751, 2899, 25751, 3938, 18, 797, 262, 1147, 32056, 980, 15318, 28637, 22220, 7, 58426, 14610, 341, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_notify_limits() { let chanmon_cfgs = create_chanmon_cfgs(3); let node_cfgs = create_node_cfgs(3, &chanmon_cfgs); let node_chanmgrs = create_node_chanmgrs(3, &node_cfgs, &[None, None, None]); let nodes = create_network(3, &node_cfgs, &node_chanmgrs); // All nodes start with a persistable update pending as `create_network` connects each node // with all other nodes to make most tests simpler. assert!(nodes[0].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(nodes[1].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(nodes[2].node.await_persistable_update_timeout(Duration::from_millis(1))); let mut chan = create_announced_chan_between_nodes(&nodes, 0, 1, InitFeatures::known(), InitFeatures::known()); // to connect messages with new values chan.0.contents.fee_base_msat *= 2; chan.1.contents.fee_base_msat *= 2; let node_a_chan_info = nodes[0].node.list_channels()[0].clone(); let node_b_chan_info = nodes[1].node.list_channels()[0].clone(); assert!(nodes[0].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(nodes[1].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(!nodes[2].node.await_persistable_update_timeout(Duration::from_millis(1))); // After persisting the first two nodes they should no longer need fresh persistence. assert!(!nodes[0].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(!nodes[1].node.await_persistable_update_timeout(Duration::from_millis(1))); // about the channel. nodes[2].node.handle_channel_update(&nodes[1].node.get_our_node_id(), &chan.0); nodes[2].node.handle_channel_update(&nodes[1].node.get_our_node_id(), &chan.1); assert!(!nodes[2].node.await_persistable_update_timeout(Duration::from_millis(1))); // The nodes which are a party to the channel should also ignore messages from unrelated // parties. nodes[0].node.handle_channel_update(&nodes[2].node.get_our_node_id(), &chan.0); nodes[0].node.handle_channel_update(&nodes[2].node.get_our_node_id(), &chan.1); nodes[1].node.handle_channel_update(&nodes[2].node.get_our_node_id(), &chan.0); nodes[1].node.handle_channel_update(&nodes[2].node.get_our_node_id(), &chan.1); assert!(!nodes[0].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(!nodes[1].node.await_persistable_update_timeout(Duration::from_millis(1))); // At this point the channel info given by peers should still be the same. assert_eq!(nodes[0].node.list_channels()[0], node_a_chan_info); assert_eq!(nodes[1].node.list_channels()[0], node_b_chan_info); // An earlier version of handle_channel_update didn't check the directionality of the let as_node_one = nodes[0].node.get_our_node_id().serialize()[..] < nodes[1].node.get_our_node_id().serialize()[..]; let as_update = if as_node_one == (chan.0.contents.flags & 1 == 0 /* chan.0 is from node one */) { &chan.0 } else { &chan.1 }; let bs_update = if as_node_one == (chan.0.contents.flags & 1 == 0 /* chan.0 is from node one */) { &chan.1 } else { &chan.0 }; // persisted and that its channel info remains the same. nodes[0].node.handle_channel_update(&nodes[1].node.get_our_node_id(), &as_update); nodes[1].node.handle_channel_update(&nodes[0].node.get_our_node_id(), &bs_update); assert!(!nodes[0].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(!nodes[1].node.await_persistable_update_timeout(Duration::from_millis(1))); assert_eq!(nodes[0].node.list_channels()[0], node_a_chan_info); assert_eq!(nodes[1].node.list_channels()[0], node_b_chan_info); // the channel info has updated. nodes[0].node.handle_channel_update(&nodes[1].node.get_our_node_id(), &bs_update); nodes[1].node.handle_channel_update(&nodes[0].node.get_our_node_id(), &as_update); assert!(nodes[0].node.await_persistable_update_timeout(Duration::from_millis(1))); assert!(nodes[1].node.await_persistable_update_timeout(Duration::from_millis(1))); assert_ne!(nodes[0].node.list_channels()[0], node_a_chan_info); assert_ne!(nodes[1].node.list_channels()[0], node_b_chan_info); }
rust_cleaned_test_functions.jsonl/94565
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1675 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 36654, 31820, 368, 341, 18363, 197, 10217, 26023, 1645, 18343, 82, 284, 1855, 45552, 1645, 18343, 82, 7, 18, 317, 197, 10217, 2436, 18343, 82, 284, 1855, 5084, 18343, 82, 7, 18, 11, 609, 5658, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_update_add_htlc_bolt2_sender_exceed_max_htlc_value_in_flight() { //BOLT 2 Requirement: if the sum of total offered HTLCs would exceed the remote's max_htlc_value_in_flight_msat: MUST NOT add an HTLC. let chanmon_cfgs = create_chanmon_cfgs(2); let node_cfgs = create_node_cfgs(2, &chanmon_cfgs); let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]); let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs); let channel_value = 100000; let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, channel_value, 0, InitFeatures::known(), InitFeatures::known()); let max_in_flight = get_channel_value_stat!(nodes[0], chan.2).counterparty_max_htlc_value_in_flight_msat; send_payment(&nodes[0], &vec!(&nodes[1])[..], max_in_flight); let (_, our_payment_hash, our_payment_secret) = get_payment_preimage_hash!(nodes[1]); // Manually create a route over our max in flight (which our router normally automatically // limits us to. let route = Route { paths: vec![vec![RouteHop { pubkey: nodes[1].node.get_our_node_id(), node_features: NodeFeatures::known(), channel_features: ChannelFeatures::known(), short_channel_id: nodes[1].node.list_usable_channels()[0].short_channel_id.unwrap(), fee_msat: max_in_flight + 1, cltv_expiry_delta: TEST_FINAL_CLTV }]] }; unwrap_send_err!(nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret)), true, APIError::ChannelUnavailable { ref err }, assert!(regex::Regex::new(r"Cannot send value that would put us over the max HTLC value in flight our peer will accept \(\d+\)").unwrap().is_match(err))); assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty()); nodes[0].logger.assert_log_contains("lightning::ln::channelmanager".to_string(), "Cannot send value that would put us over the max HTLC value in flight our peer will accept".to_string(), 1); send_payment(&nodes[0], &[&nodes[1]], max_in_flight); }
rust_cleaned_test_functions.jsonl/16924
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 724 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8882, 2891, 49086, 17257, 880, 6181, 17, 54356, 2702, 4635, 6345, 49086, 17257, 3142, 1243, 90370, 368, 341, 197, 322, 33, 35320, 220, 17, 75938, 25, 421, 279, 2629, 315, 2790, 8900, 5260, 8556, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_debug_info_offset() { let padding = &[0; 10]; let entries = &[0; 20]; let encoding = Encoding { format: Format::Dwarf32, version: 4, address_size: 4, }; let mut unit = CompilationUnitHeader { header: UnitHeader { encoding, unit_length: 0, debug_abbrev_offset: DebugAbbrevOffset(0), entries_buf: EndianSlice::new(entries, LittleEndian), }, offset: DebugInfoOffset(0), }; Section::with_endian(Endian::Little) .append_bytes(padding) .comp_unit(&mut unit); let offset = padding.len(); let header_length = CompilationUnitHeader::<EndianSlice<LittleEndian>, _>::size_of_header(encoding); let length = unit.length_including_self(); assert_eq!(DebugInfoOffset(0).to_unit_offset(&unit), None); assert_eq!(DebugInfoOffset(offset - 1).to_unit_offset(&unit), None); assert_eq!(DebugInfoOffset(offset).to_unit_offset(&unit), None); assert_eq!( DebugInfoOffset(offset + header_length - 1).to_unit_offset(&unit), None ); assert_eq!( DebugInfoOffset(offset + header_length).to_unit_offset(&unit), Some(UnitOffset(header_length)) ); assert_eq!( DebugInfoOffset(offset + length - 1).to_unit_offset(&unit), Some(UnitOffset(length - 1)) ); assert_eq!(DebugInfoOffset(offset + length).to_unit_offset(&unit), None); assert_eq!( UnitOffset(header_length).to_debug_info_offset(&unit), DebugInfoOffset(offset + header_length) ); assert_eq!( UnitOffset(length - 1).to_debug_info_offset(&unit), DebugInfoOffset(offset + length - 1) ); }
rust_cleaned_test_functions.jsonl/102075
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 944 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15446, 3109, 6917, 368, 341, 286, 1077, 5300, 284, 44590, 15, 26, 220, 16, 15, 935, 286, 1077, 10695, 284, 44590, 15, 26, 220, 17, 15, 935, 286, 1077, 11170, 284, 29330, 341, 310, 3561, 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...
1
#[test] fn test_withdraw_stake() { let stake_pubkey = analog_sdk::pubkey::new_rand(); let stake_lamports = 42; let stake_account = AccountSharedData::new_ref_data_with_space( stake_lamports, &StakeState::Uninitialized, std::mem::size_of::<StakeState>(), &id(), ) .expect("stake_account"); let mut clock = Clock::default(); let to = analog_sdk::pubkey::new_rand(); let to_account = AccountSharedData::new_ref(1, 0, &system_program::id()); let to_keyed_account = KeyedAccount::new(&to, false, &to_account); let stake_keyed_account = KeyedAccount::new(&stake_pubkey, false, &stake_account); assert_eq!( stake_keyed_account.withdraw( stake_lamports, &to_keyed_account, &clock, &StakeHistory::default(), &to_keyed_account, // unsigned account as withdraw authority None, true, ), Err(InstructionError::MissingRequiredSignature) ); // signed keyed account and uninitialized should work let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account); let to_keyed_account = KeyedAccount::new(&to, false, &to_account); assert_eq!( stake_keyed_account.withdraw( stake_lamports, &to_keyed_account, &clock, &StakeHistory::default(), &stake_keyed_account, None, true, ), Ok(()) ); assert_eq!(stake_account.borrow().tock(), 0); assert_eq!(stake_keyed_account.state(), Ok(StakeState::Uninitialized)); // reset balance stake_account.borrow_mut().set_lamports(stake_lamports); // lockup let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account); let custodian = analog_sdk::pubkey::new_rand(); stake_keyed_account .initialize( &Authorized::auto(&stake_pubkey), &Lockup { unix_timestamp: 0, epoch: 0, custodian, }, &Rent::free(), ) .unwrap(); let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account); let to_keyed_account = KeyedAccount::new(&to, false, &to_account); assert_eq!( stake_keyed_account.withdraw( stake_lamports + 1, &to_keyed_account, &clock, &StakeHistory::default(), &stake_keyed_account, None, true, ), Err(InstructionError::InsufficientFunds) ); let vote_pubkey = analog_sdk::pubkey::new_rand(); let vote_account = RefCell::new(vote_state::create_account( &vote_pubkey, &analog_sdk::pubkey::new_rand(), 0, 100, )); let vote_keyed_account = KeyedAccount::new(&vote_pubkey, false, &vote_account); vote_keyed_account .set_state(&VoteStateVersions::new_current(VoteState::default())) .unwrap(); let signers = vec![stake_pubkey].into_iter().collect(); assert_eq!( stake_keyed_account.delegate( &vote_keyed_account, &clock, &StakeHistory::default(), &Config::default(), &signers, true, ), Ok(()) ); // simulate rewards stake_account.borrow_mut().checked_add_lamports(10).unwrap(); // withdrawal before deactivate works for rewards amount let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account); let to_keyed_account = KeyedAccount::new(&to, false, &to_account); assert_eq!( stake_keyed_account.withdraw( 10, &to_keyed_account, &clock, &StakeHistory::default(), &stake_keyed_account, None, true, ), Ok(()) ); // simulate rewards stake_account.borrow_mut().checked_add_lamports(10).unwrap(); // withdrawal of rewards fails if not in excess of stake let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account); let to_keyed_account = KeyedAccount::new(&to, false, &to_account); assert_eq!( stake_keyed_account.withdraw( 10 + 1, &to_keyed_account, &clock, &StakeHistory::default(), &stake_keyed_account, None, true, ), Err(InstructionError::InsufficientFunds) ); // deactivate the stake before withdrawal assert_eq!(stake_keyed_account.deactivate(&clock, &signers), Ok(())); // simulate time passing clock.epoch += 100; // Try to withdraw more than what's available let to_keyed_account = KeyedAccount::new(&to, false, &to_account); assert_eq!( stake_keyed_account.withdraw( stake_lamports + 10 + 1, &to_keyed_account, &clock, &StakeHistory::default(), &stake_keyed_account, None, true, ), Err(InstructionError::InsufficientFunds) ); // Try to withdraw all tock let to_keyed_account = KeyedAccount::new(&to, false, &to_account); assert_eq!( stake_keyed_account.withdraw( stake_lamports + 10, &to_keyed_account, &clock, &StakeHistory::default(), &stake_keyed_account, None, true, ), Ok(()) ); assert_eq!(stake_account.borrow().tock(), 0); assert_eq!(stake_keyed_account.state(), Ok(StakeState::Uninitialized)); // overflow let rent = Rent::default(); let rent_exempt_reserve = rent.minimum_balance(std::mem::size_of::<StakeState>()); let authority_pubkey = Pubkey::new_unique(); let stake_pubkey = Pubkey::new_unique(); let stake_account = AccountSharedData::new_ref_data_with_space( 1_000_000_000, &StakeState::Initialized(Meta { rent_exempt_reserve, authorized: Authorized { staker: authority_pubkey, withdrawer: authority_pubkey, }, lockup: Lockup::default(), }), std::mem::size_of::<StakeState>(), &id(), ) .expect("stake_account"); let stake2_pubkey = Pubkey::new_unique(); let stake2_account = AccountSharedData::new_ref_data_with_space( 1_000_000_000, &StakeState::Initialized(Meta { rent_exempt_reserve, authorized: Authorized { staker: authority_pubkey, withdrawer: authority_pubkey, }, lockup: Lockup::default(), }), std::mem::size_of::<StakeState>(), &id(), ) .expect("stake2_account"); let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account); let stake2_keyed_account = KeyedAccount::new(&stake2_pubkey, false, &stake2_account); let authority_account = AccountSharedData::new_ref(42, 0, &system_program::id()); let authority_keyed_account = KeyedAccount::new(&authority_pubkey, true, &authority_account); assert_eq!( stake_keyed_account.withdraw( u64::MAX - 10, &stake2_keyed_account, &clock, &StakeHistory::default(), &authority_keyed_account, None, true, ), Err(InstructionError::InsufficientFunds), ); }
rust_cleaned_test_functions.jsonl/15297
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 4515 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6615, 7633, 1261, 726, 368, 341, 286, 1077, 18279, 34014, 792, 284, 23400, 61783, 486, 9585, 792, 486, 931, 33864, 543, 286, 1077, 18279, 907, 309, 3394, 284, 220, 19, 17, 280, 286, 1077, 18279,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_merge_deleted_blob_into_blob_to_tree() -> BitResult<()> { BitRepo::with_minimal_repo(|repo| { let ours = commit! { foo { bar < "bar contents" } }; let theirs = commit! {}; repo.three_way_merge(ours, theirs)?; assert_eq!(cat!(repo: "foo/bar"), "bar contents"); Ok(()) }) }
rust_cleaned_test_functions.jsonl/94168
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 215 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 20888, 39418, 45908, 45514, 45908, 2346, 11663, 368, 1464, 6495, 2077, 71698, 341, 262, 6495, 25243, 486, 4197, 7260, 2861, 37784, 22428, 23476, 91, 341, 286, 1077, 11350, 284, 5266, 0, 341, 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...
2
#[test] fn test_lexicographic_largest() { assert!(!bool::from(Fp2::zero().lexicographically_largest())); assert!(!bool::from(Fp2::one().lexicographically_largest())); assert!(bool::from( Fp2 { c0: Fp::from_raw_unchecked([ 0x1128ecad67549455, 0x9e7a1cff3a4ea1a8, 0xeb208d51e08bcf27, 0xe98ad40811f5fc2b, 0x736c3a59232d511d, 0x10acd42d29cfcbb6, ]), c1: Fp::from_raw_unchecked([ 0xd328e37cc2f58d41, 0x948df0858a605869, 0x6032f9d56f93a573, 0x2be483ef3fffdc87, 0x30ef61f88f483c2a, 0x1333f55a35725be0, ]), } .lexicographically_largest() )); assert!(!bool::from( Fp2 { c0: -Fp::from_raw_unchecked([ 0x1128ecad67549455, 0x9e7a1cff3a4ea1a8, 0xeb208d51e08bcf27, 0xe98ad40811f5fc2b, 0x736c3a59232d511d, 0x10acd42d29cfcbb6, ]), c1: -Fp::from_raw_unchecked([ 0xd328e37cc2f58d41, 0x948df0858a605869, 0x6032f9d56f93a573, 0x2be483ef3fffdc87, 0x30ef61f88f483c2a, 0x1333f55a35725be0, ]), } .lexicographically_largest() )); assert!(!bool::from( Fp2 { c0: Fp::from_raw_unchecked([ 0x1128ecad67549455, 0x9e7a1cff3a4ea1a8, 0xeb208d51e08bcf27, 0xe98ad40811f5fc2b, 0x736c3a59232d511d, 0x10acd42d29cfcbb6, ]), c1: Fp::zero(), } .lexicographically_largest() )); assert!(bool::from( Fp2 { c0: -Fp::from_raw_unchecked([ 0x1128ecad67549455, 0x9e7a1cff3a4ea1a8, 0xeb208d51e08bcf27, 0xe98ad40811f5fc2b, 0x736c3a59232d511d, 0x10acd42d29cfcbb6, ]), c1: Fp::zero(), } .lexicographically_largest() )); }
rust_cleaned_test_functions.jsonl/97994
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1879 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 74547, 292, 12679, 907, 32381, 368, 341, 286, 2060, 0, 3471, 2641, 486, 1499, 7832, 79, 17, 486, 14154, 1005, 2571, 292, 63931, 907, 32381, 7392, 286, 2060, 0, 3471, 2641, 486, 1499, 7832, 79, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_one_node_operations() { let env = init_cluster(1); let x = Client::to(0, env.clone()).get("a").unwrap(); assert!(x.0.is_none()); Client::to(0, env.clone()).set("a", "1").unwrap(); let x = Client::to(0, env.clone()).get("a").unwrap(); assert_eq!(x.0, Some("1".to_owned())); }
rust_cleaned_test_functions.jsonl/62210
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 150 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11667, 5084, 57345, 368, 341, 262, 1077, 6105, 284, 2930, 28441, 7, 16, 317, 262, 1077, 856, 284, 8423, 486, 983, 7, 15, 11, 6105, 15997, 6011, 455, 445, 64, 1827, 15454, 543, 262, 2060, 10297...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_case_insensitive_anagrams() { let word = "Orchestra"; let inputs = ["cashregister", "Carthorse", "radishes"]; let outputs = vec!["Carthorse"]; process_anagram_case(word, &inputs, &outputs); }
rust_cleaned_test_functions.jsonl/14779
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 95 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19096, 34386, 18723, 12008, 68772, 368, 341, 262, 1077, 3409, 284, 330, 2195, 37160, 3302, 262, 1077, 11127, 284, 4383, 41271, 6343, 497, 330, 8852, 339, 10836, 497, 330, 13281, 20527, 31797, 262, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_results_in_indecision() { let file = std::include_str!("config.toml"); let builder: Builder = toml::from_str(file).expect("parsing toml"); let err = builder.build().expect_err("determining paths should fail"); match err { BuildError::ProcessHoard(HoardError::EnvTrie(err)) => match err { TrieError::Indecision(left, right) => assert_eq!( hashset! { left, right }, hashset! { "foo".into(), "baz".into() } ), _ => panic!("Unexpected error: {}", err), }, _ => panic!("Unexpected error: {}", err), } }
rust_cleaned_test_functions.jsonl/18799
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 290 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13576, 1243, 1243, 63938, 368, 341, 262, 1077, 1034, 284, 1460, 486, 997, 2895, 17223, 1676, 73494, 75, 797, 262, 1077, 7363, 25, 20626, 284, 311, 1014, 486, 1499, 2895, 4866, 568, 17119, 445, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_is_boundary_multibyte() { let test = "\u{FFFD}\u{FFFD}\u{FFFD}\u{FFFD}\u{FFFD}\u{FFFD}"; assert!(is_boundary(test, Some(8))); }
rust_cleaned_test_functions.jsonl/6930
{ "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, 6892, 54004, 26290, 579, 78361, 368, 341, 16885, 286, 1077, 1273, 284, 2917, 84, 90, 1748, 14596, 11035, 84, 90, 1748, 14596, 11035, 84, 90, 1748, 14596, 11035, 84, 90, 1748, 14596, 11035, 84, 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
#[test] fn test_string() { let mut b = "test".to_owned(); assert_eq!(Body::from(b.clone()).size(), BodySize::Sized(4)); assert_eq!(Body::from(b.clone()).get_ref(), b"test"); assert_eq!(Body::from(&b).size(), BodySize::Sized(4)); assert_eq!(Body::from(&b).get_ref(), b"test"); assert_eq!(b.size(), BodySize::Sized(4)); assert_eq!( block_on(poll_fn(|cx| b.poll_next(cx))).unwrap().ok(), Some(Bytes::from("test")) ); }
rust_cleaned_test_functions.jsonl/82690
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 265 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3904, 368, 341, 286, 1077, 5206, 293, 284, 330, 1944, 3263, 983, 51973, 543, 286, 2060, 10714, 10297, 5444, 486, 1499, 1883, 15997, 6011, 2141, 1507, 13958, 1695, 486, 50, 1506, 7, 19, 1106, 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_sender_string_in_script() { let _pool = ConstPool::new(); let module_text = r" address {{sender}} { module Debug { public fun debug(): u8 { 1 } } }"; let source_text = r" script { use {{sender}}::Debug; fun main() { let _ = Debug::debug(); } } "; let effects = execute_script( MoveFile::with_content(script_path(), source_text), vec![MoveFile::with_content( module_path("debug.move"), module_text, )], "libra", "0x1", vec![], ) .unwrap() .last() .unwrap() .effects(); assert_eq!(effects.resources().len(), 0); }
rust_cleaned_test_functions.jsonl/43918
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 410 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 54356, 3904, 1243, 14660, 368, 341, 262, 1077, 716, 10285, 284, 24522, 10551, 486, 931, 1428, 262, 1077, 4688, 4326, 284, 435, 698, 262, 2621, 5867, 11644, 3417, 341, 286, 4688, 11091, 341, 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_append_vec_data() { let path = get_append_vec_path("test_append_data"); let av = AppendVec::new(&path.path, true, 1024 * 1024); let account = create_test_account(5); let index = av.append_account_test(&account).unwrap(); assert_eq!(av.get_account_test(index).unwrap(), account); let account1 = create_test_account(6); let index1 = av.append_account_test(&account1).unwrap(); assert_eq!(av.get_account_test(index).unwrap(), account); assert_eq!(av.get_account_test(index1).unwrap(), account1); }
rust_cleaned_test_functions.jsonl/5418
{ "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, 26041, 13251, 1769, 368, 341, 286, 1077, 1815, 284, 633, 26041, 13251, 2638, 445, 1944, 26041, 1769, 797, 286, 1077, 1822, 284, 29807, 10050, 486, 931, 2099, 2343, 3875, 11, 830, 11, 220, 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_same_letters() { let test_cases = vec![ ("t-e", "t-e", TokenSimilarity::Identical), ("t-e", "t_e", TokenSimilarity::SameLetters), ("t-e", "t_e ", TokenSimilarity::SameLetters), ("t-e", "t____e", TokenSimilarity::SameLetters), ("t-e", "t----e", TokenSimilarity::SameLetters), ("t", "tp", TokenSimilarity::Distant), ("t", "t0", TokenSimilarity::Distant), ("t", "t_", TokenSimilarity::SameLetters), ("t", "p", TokenSimilarity::Distant), ("t", "", TokenSimilarity::Distant), ( "transfer-encoding", "transfer-encoding1", TokenSimilarity::Distant, ), ( "transfer-encoding", "tran\u{017f}fer-encoding", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "transfer-encod\u{0131}ng", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "transfer-encoding", TokenSimilarity::Identical, ), ( "transfer-encoding", "Transfer-Encoding", TokenSimilarity::Identical, ), ( "x-my-custom-important-header", "X-My-Custom-Important-Header", TokenSimilarity::Identical, ), ( "x-my-custom-important-header", "X_My_Custom_Important_Header", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "transfer-encodin", TokenSimilarity::Distant, ), ("transfer", "transfer-encoding", TokenSimilarity::Distant), ( "transfer-encoding", "transfer-encoding1", TokenSimilarity::Distant, ), ( "transfer-encoding", "TRANSFER-ENCODING", TokenSimilarity::Identical, ), ( "transfer-encoding", "transfer-\tencoding", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "\r\ntransfer-\t\te\tn\tc o d i ng\t", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "transfer_encoding", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "transfer---encoding", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "x_transfer_encoding", TokenSimilarity::Distant, ), ( "transfer-encoding", "x_transfer_encodings", TokenSimilarity::Distant, ), ("transfer-encoding", "gibberish", TokenSimilarity::Distant), ( "transfer-encoding", "\t\x01\x02transfer-encoding\t\x0f\x0c", TokenSimilarity::SameLetters, ), ( "transfer-encoding", "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t", TokenSimilarity::Distant, ), ( "transfer-encoding", "accept-encoding", TokenSimilarity::Distant, ), ]; test_cases.iter().for_each(|(e, c, expected_distance)| { let important_header = http_token(e); let header = http_token(c); let actual_distance = determine_similarity(important_header, header); assert_eq!( actual_distance, *expected_distance, "similarity({}, {:?}) != {:?}", e, c, *expected_distance ); }); }
rust_cleaned_test_functions.jsonl/88818
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2541 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 33574, 67330, 368, 341, 286, 1077, 1273, 41427, 284, 7486, 90515, 310, 3489, 83, 5655, 497, 330, 83, 5655, 497, 9660, 34402, 487, 486, 28301, 938, 1326, 310, 3489, 83, 5655, 497, 330, 83, 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_parse_message_type_compare_3() { let schema = " message root { required int32 _1 (INT_8); required int32 _2 (INT_16); required float _3; required double _4; optional int32 _5 (DATE); optional binary _6 (UTF8); } "; let mut iter = Tokenizer::from_str(schema); let message = Parser { tokenizer: &mut iter, } .parse_message_type() .unwrap(); let mut fields = vec![ Rc::new( Type::primitive_type_builder("_1", PhysicalType::INT32) .with_repetition(Repetition::REQUIRED) .with_logical_type(LogicalType::INT_8) .build() .unwrap(), ), Rc::new( Type::primitive_type_builder("_2", PhysicalType::INT32) .with_repetition(Repetition::REQUIRED) .with_logical_type(LogicalType::INT_16) .build() .unwrap(), ), Rc::new( Type::primitive_type_builder("_3", PhysicalType::FLOAT) .with_repetition(Repetition::REQUIRED) .build() .unwrap(), ), Rc::new( Type::primitive_type_builder("_4", PhysicalType::DOUBLE) .with_repetition(Repetition::REQUIRED) .build() .unwrap(), ), Rc::new( Type::primitive_type_builder("_5", PhysicalType::INT32) .with_logical_type(LogicalType::DATE) .build() .unwrap(), ), Rc::new( Type::primitive_type_builder("_6", PhysicalType::BYTE_ARRAY) .with_logical_type(LogicalType::UTF8) .build() .unwrap(), ), ]; let expected = Type::group_type_builder("root") .with_fields(&mut fields) .build() .unwrap(); assert_eq!(message, expected); }
rust_cleaned_test_functions.jsonl/79632
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1297 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 6462, 1819, 32235, 62, 18, 368, 341, 286, 1077, 10802, 284, 6228, 262, 1943, 3704, 341, 414, 2567, 526, 18, 17, 716, 16, 320, 3221, 62, 23, 317, 414, 2567, 526, 18, 17, 716, 17, 320, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_prf_invalid_bit_sizes() { for bits in 0..2048_usize { if VALID_BIT_SIZES.contains(&bits) { continue; } let result = prf("".as_bytes(), "", "".as_bytes(), bits as usize); assert_eq!(result.is_err(), true, "expected failure with wrong bit size: {:?}", bits); } }
rust_cleaned_test_functions.jsonl/132292
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 193 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5294, 69, 31433, 13996, 32159, 368, 341, 286, 369, 9472, 304, 220, 15, 496, 17, 15, 19, 23, 11306, 551, 341, 310, 421, 43291, 11189, 1098, 89415, 8786, 2099, 11516, 8, 341, 394, 3060, 280, 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...
3
#[test] fn test_json_number_truthy() { use std::f64; assert!(json!(16i16).is_truthy(false)); assert!(json!(16i16).is_truthy(true)); assert!(json!(0i16).is_truthy(true)); assert!(!json!(0i16).is_truthy(false)); assert!(json!(1.0f64).is_truthy(false)); assert!(json!(1.0f64).is_truthy(true)); assert!(json!(Some(16i16)).is_truthy(false)); assert!(json!(Some(16i16)).is_truthy(true)); assert!(!json!(None as Option<i16>).is_truthy(false)); assert!(!json!(None as Option<i16>).is_truthy(true)); assert!(!json!(f64::NAN).is_truthy(false)); assert!(!json!(f64::NAN).is_truthy(true)); // there is no infinity in json/serde_json }
rust_cleaned_test_functions.jsonl/101294
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 347 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9455, 5500, 49186, 88, 368, 341, 262, 990, 1460, 486, 69, 21, 19, 280, 262, 2060, 10297, 2236, 10297, 16, 21, 72, 16, 21, 568, 285, 49186, 88, 3576, 1106, 262, 2060, 10297, 2236, 10297, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_transpile_tsx() { let specifier = resolve_url_or_path("https://deno.land/x/mod.ts") .expect("could not resolve specifier"); let source = r#" export class A { render() { return <div><span></span></div> } } "#; let module = parse(specifier.as_str(), source, &MediaType::Tsx) .expect("could not parse module"); let (code, _) = module .transpile(&EmitOptions::default()) .expect("could not strip types"); assert!(code.contains("React.createElement(\"div\", null")); }
rust_cleaned_test_functions.jsonl/2739
{ "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, 7965, 12192, 25023, 87, 368, 341, 262, 1077, 97616, 284, 8830, 2903, 8734, 2638, 445, 2428, 1110, 5183, 78, 87627, 10776, 38479, 21288, 1138, 414, 659, 17119, 445, 28077, 537, 8830, 97616, 797, 26...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_heap_oom_rescue() { static mut SPACE: [usize; 100] = [0; 100]; let heap = LockedHeapWithRescue::new(|heap: &mut Heap<32>, _layout: &Layout| unsafe { heap.add_to_heap(SPACE.as_ptr() as usize, SPACE.as_ptr().add(100) as usize); }); unsafe { assert!(heap.alloc(Layout::from_size_align(1, 1).unwrap()) as usize != 0); } }
rust_cleaned_test_functions.jsonl/99752
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 176 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 33059, 62, 4191, 4918, 31724, 368, 341, 262, 1099, 5206, 52060, 25, 508, 51878, 26, 220, 16, 15, 15, 60, 284, 508, 15, 26, 220, 16, 15, 15, 935, 262, 1077, 17364, 284, 92945, 27909, 2354, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_new_normal_value_all_types() { let _ = Value::new_normal("hello"); let _ = Value::new_normal("hello".to_string()); let _ = Value::new_normal(1_u8); let _ = Value::new_normal(1_u16); let _ = Value::new_normal(1_u32); let _ = Value::new_normal(1_u64); let _ = Value::new_normal(1_i8); let _ = Value::new_normal(1_i16); let _ = Value::new_normal(1_i32); let _ = Value::new_normal(1_i64); let _ = Value::new_normal(true); }
rust_cleaned_test_functions.jsonl/41642
{ "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, 5921, 13973, 3142, 5705, 9763, 368, 341, 286, 1077, 716, 284, 5162, 486, 931, 13973, 445, 14990, 797, 286, 1077, 716, 284, 5162, 486, 931, 13973, 445, 14990, 3263, 983, 3904, 1423, 286, 1077, 71...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_ignore_rpc_from_peers_below_graylist_threshold() { let config = GossipsubConfig::default(); let peer_score_params = PeerScoreParams::default(); let mut peer_score_thresholds = PeerScoreThresholds::default(); peer_score_thresholds.gossip_threshold = 0.5 * peer_score_params.behaviour_penalty_weight; peer_score_thresholds.publish_threshold = 0.5 * peer_score_params.behaviour_penalty_weight; peer_score_thresholds.graylist_threshold = 3.0 * peer_score_params.behaviour_penalty_weight; //build mesh with no peers let (mut gs, _, topics) = inject_nodes1() .topics(vec!["test".into()]) .gs_config(config.clone()) .scoring(Some((peer_score_params, peer_score_thresholds))) .create_network(); //add two additional peers that will be added to the mesh let p1 = add_peer(&mut gs, &topics, false, false); let p2 = add_peer(&mut gs, &topics, false, false); //reduce score of p1 below peer_score_thresholds.graylist_threshold //note that penalties get squared so two penalties means a score of gs.peer_score.as_mut().unwrap().0.add_penalty(&p1, 2); //reduce score of p2 below publish_threshold but not below graylist_threshold gs.peer_score.as_mut().unwrap().0.add_penalty(&p2, 1); let raw_message1 = RawGossipsubMessage { source: Some(PeerId::random()), data: vec![1, 2, 3, 4], sequence_number: Some(1u64), topic: topics[0].clone(), signature: None, key: None, validated: true, }; let raw_message2 = RawGossipsubMessage { source: Some(PeerId::random()), data: vec![1, 2, 3, 4, 5], sequence_number: Some(2u64), topic: topics[0].clone(), signature: None, key: None, validated: true, }; let raw_message3 = RawGossipsubMessage { source: Some(PeerId::random()), data: vec![1, 2, 3, 4, 5, 6], sequence_number: Some(3u64), topic: topics[0].clone(), signature: None, key: None, validated: true, }; let raw_message4 = RawGossipsubMessage { source: Some(PeerId::random()), data: vec![1, 2, 3, 4, 5, 6, 7], sequence_number: Some(4u64), topic: topics[0].clone(), signature: None, key: None, validated: true, }; // Transform the inbound message let message2 = &gs .data_transform .inbound_transform(raw_message2.clone()) .unwrap(); // Transform the inbound message let message4 = &gs .data_transform .inbound_transform(raw_message4.clone()) .unwrap(); let subscription = GossipsubSubscription { action: GossipsubSubscriptionAction::Subscribe, topic_hash: topics[0].clone(), }; let control_action = GossipsubControlAction::IHave { topic_hash: topics[0].clone(), message_ids: vec![config.message_id(&message2)], }; //clear events gs.events.clear(); //receive from p1 gs.inject_event( p1.clone(), ConnectionId::new(0), HandlerEvent::Message { rpc: GossipsubRpc { messages: vec![raw_message1], subscriptions: vec![subscription.clone()], control_msgs: vec![control_action], }, invalid_messages: Vec::new(), }, ); assert_eq!(gs.events.len(), 1); assert!(match &gs.events[0] { NetworkBehaviourAction::GenerateEvent(event) => match event { GossipsubEvent::Subscribed { .. } => true, _ => false, }, _ => false, }); let control_action = GossipsubControlAction::IHave { topic_hash: topics[0].clone(), message_ids: vec![config.message_id(&message4)], }; //receive from p2 gs.inject_event( p2.clone(), ConnectionId::new(0), HandlerEvent::Message { rpc: GossipsubRpc { messages: vec![raw_message3], subscriptions: vec![subscription.clone()], control_msgs: vec![control_action], }, invalid_messages: Vec::new(), }, ); //events got processed assert!(gs.events.len() > 1); }
rust_cleaned_test_functions.jsonl/66917
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2436 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 58493, 60799, 5673, 36367, 388, 82750, 51331, 1607, 21858, 368, 341, 286, 1077, 2193, 284, 479, 41473, 1966, 2648, 486, 2258, 543, 286, 1077, 14397, 10405, 6745, 284, 45147, 10570, 4870, 486, 2258, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_process() { for opt in vec!["-p", "--process"] { new_ucmd!() .arg(opt) .succeeds() .stdout_is(expected_result(&[opt])); } }
rust_cleaned_test_functions.jsonl/79394
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 117 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11305, 368, 341, 262, 369, 3387, 304, 7486, 0, 1183, 12, 79, 497, 14482, 4630, 1341, 341, 286, 501, 68887, 2277, 0, 741, 310, 659, 858, 24539, 340, 310, 659, 82, 29264, 82, 741, 310, 659, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
#[test] fn test_from_subtype_for_u8() { assert_eq!(u8::from(Subtype::Int8), b'c'); assert_eq!(u8::from(Subtype::UInt8), b'C'); assert_eq!(u8::from(Subtype::Int16), b's'); assert_eq!(u8::from(Subtype::UInt16), b'S'); assert_eq!(u8::from(Subtype::Int32), b'i'); assert_eq!(u8::from(Subtype::UInt32), b'I'); assert_eq!(u8::from(Subtype::Float), b'f'); }
rust_cleaned_test_functions.jsonl/95433
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 227 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 96228, 5478, 7300, 23, 368, 341, 286, 2060, 10714, 10297, 84, 23, 486, 1499, 98906, 1313, 486, 1072, 23, 701, 293, 6, 66, 1157, 286, 2060, 10714, 10297, 84, 23, 486, 1499, 98906, 1313, 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_compile_value_with_formatter() { let text = "{ foobar | my_formatter }"; let instructions = compile(text).unwrap(); assert_eq!(1, instructions.len()); assert_eq!( &FormattedValue(vec![PathStep::Name("foobar")], "my_formatter"), &instructions[0] ); }
rust_cleaned_test_functions.jsonl/18169
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 172 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 74170, 3142, 6615, 73965, 368, 972, 286, 1077, 1467, 284, 13868, 11756, 31393, 760, 847, 73965, 335, 3534, 286, 1077, 11221, 284, 19192, 7235, 568, 15454, 1647, 286, 2060, 10714, 10297, 16, 11, 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_take_value_index_from_large_list() { let list = build_generic_list::<i64, Int32Type>(vec![ Some(vec![0, 1]), Some(vec![2, 3, 4]), Some(vec![5, 6, 7, 8, 9]), ]); let indices = UInt32Array::from(vec![2, 0]); let (indexed, offsets) = take_value_indices_from_list::<_, Int64Type>(&list, &indices).unwrap(); assert_eq!(indexed, Int64Array::from(vec![5, 6, 7, 8, 9, 0, 1])); assert_eq!(offsets, vec![0, 5, 7]); }
rust_cleaned_test_functions.jsonl/67654
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 287 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 73261, 3142, 3560, 5673, 45228, 2019, 368, 341, 286, 1077, 1140, 284, 1936, 41232, 2019, 27638, 72, 21, 19, 11, 1333, 18, 17, 929, 2235, 4083, 90515, 310, 4329, 25592, 20703, 15, 11, 220, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_normalized_angle() { macro_rules! almost_eq { ($left:expr, $right:expr) => { let left = $left; let right = $right; assert!((left - right).abs() < 1e-6, "{} != {}", left, right); }; } use std::f32::consts::TAU; almost_eq!(normalized_angle(-3.0 * TAU), 0.0); almost_eq!(normalized_angle(-2.3 * TAU), -0.3 * TAU); almost_eq!(normalized_angle(-TAU), 0.0); almost_eq!(normalized_angle(0.0), 0.0); almost_eq!(normalized_angle(TAU), 0.0); almost_eq!(normalized_angle(2.7 * TAU), -0.3 * TAU); }
rust_cleaned_test_functions.jsonl/73496
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 303 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 80006, 21727, 368, 341, 262, 18072, 21407, 0, 4558, 10714, 341, 286, 1711, 2359, 96011, 11, 400, 1291, 96011, 8, 589, 341, 310, 1077, 2115, 284, 400, 2359, 280, 310, 1077, 1290, 284, 400, 1291, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_cookie_httponly_string_is_added() { let cookie = CookieOptions { cookie_name: "".to_string(), cookie_value: None, max_age: None, domain: None, path: None, secure: false, http_only: true, same_site: None, }; assert_eq!(cookie.to_string(), "=; HttpOnly"); }
rust_cleaned_test_functions.jsonl/101601
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 222 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 38663, 49086, 83, 618, 398, 3904, 6892, 37653, 368, 341, 286, 1077, 12544, 284, 24356, 3798, 341, 310, 12544, 1269, 25, 44907, 983, 3904, 3148, 310, 12544, 3142, 25, 2240, 345, 310, 1932, 32053, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_deserialize_string() { let request = TestInterfaceRequest::from_args( 3, /* opcode */ vec![Arg::String(STRING_VALUE.to_string())], ) .unwrap(); assert_match!(request, TestInterfaceRequest::String{arg} => assert_eq!(arg, STRING_VALUE)); }
rust_cleaned_test_functions.jsonl/55798
{ "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, 15768, 9050, 3904, 368, 341, 286, 1077, 1681, 284, 3393, 5051, 1900, 486, 1499, 8384, 1006, 310, 220, 18, 11, 1391, 30028, 735, 310, 7486, 20703, 2735, 486, 703, 7, 16468, 7476, 2389, 3904, 2140...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_list_of() { let mut a = Assert::new(); a.globals_add(validate_module); a.eq("([1, 2, 3], '1, 2, 3')", "with_int_list([1, 2, 3])"); a.fail("with_int_list(1)", BAD); a.fail("with_int_list([1, 'foo'])", BAD); a.fail("with_int_list([[]])", BAD); a.eq( "([[1, 2], [3]], '1, 2 + 3')", "with_list_list([[1, 2], [3]])", ); let expected = r#"([{1: 2, 3: 4}, {5: 6}], "1: 2, 3: 4 + 5: 6")"#; let test = r#"with_dict_list([{1: 2, 3: 4}, {5: 6}])"#; a.eq(expected, test); }
rust_cleaned_test_functions.jsonl/65895
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 355 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2019, 3575, 368, 341, 286, 1077, 5206, 264, 284, 5319, 486, 931, 543, 286, 264, 1302, 16616, 2891, 94244, 10750, 317, 286, 264, 26662, 445, 2561, 16, 11, 220, 17, 11, 220, 18, 1125, 364, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_struct_equal() { let strings: ArrayRef = Arc::new(StringArray::from(vec![ Some("joe"), None, None, Some("mark"), Some("doe"), ])); let ints: ArrayRef = Arc::new(Int32Array::from(vec![ Some(1), Some(2), None, Some(4), Some(5), ])); let a = StructArray::try_from(vec![("f1", strings.clone()), ("f2", ints.clone())]) .unwrap(); let b = StructArray::try_from(vec![("f1", strings), ("f2", ints)]).unwrap(); assert!(a.equals(&b)); assert!(b.equals(&a)); }
rust_cleaned_test_functions.jsonl/892
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 400 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15126, 11478, 368, 341, 286, 1077, 9069, 25, 2910, 3945, 284, 19689, 486, 931, 2242, 1857, 486, 1499, 25592, 90515, 310, 4329, 445, 73, 4644, 4461, 310, 2240, 345, 310, 2240, 345, 310, 4329, 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_get_source_from_data_url() { let fixtures = vec![ ("data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=", true, MediaType::TypeScript, "application/typescript;base64", "export const a = \"a\";\n\nexport enum A {\n A,\n B,\n C,\n}\n"), ("data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=?a=b&b=c", true, MediaType::TypeScript, "application/typescript;base64", "export const a = \"a\";\n\nexport enum A {\n A,\n B,\n C,\n}\n"), ("data:text/plain,Hello%2C%20Deno!", true, MediaType::Unknown, "text/plain", "Hello, Deno!"), ("data:,Hello%2C%20Deno!", true, MediaType::Unknown, "", "Hello, Deno!"), ("data:application/javascript,console.log(\"Hello, Deno!\");%0A", true, MediaType::JavaScript, "application/javascript", "console.log(\"Hello, Deno!\");\n"), ("data:text/jsx;base64,ZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oKSB7CiAgcmV0dXJuIDxkaXY+SGVsbG8gRGVubyE8L2Rpdj4KfQo=", true, MediaType::Jsx, "text/jsx;base64", "export default function() {\n return <div>Hello Deno!</div>\n}\n"), ("data:text/tsx;base64,ZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24oKSB7CiAgcmV0dXJuIDxkaXY+SGVsbG8gRGVubyE8L2Rpdj4KfQo=", true, MediaType::Tsx, "text/tsx;base64", "export default function() {\n return <div>Hello Deno!</div>\n}\n"), ]; for ( url_str, expected_ok, expected_media_type, expected_media_type_str, expected, ) in fixtures { let specifier = resolve_url(url_str).unwrap(); let actual = get_source_from_data_url(&specifier); assert_eq!(actual.is_ok(), expected_ok); if expected_ok { let (actual, actual_media_type, actual_media_type_str) = actual.unwrap(); assert_eq!(actual, expected); assert_eq!(actual_media_type, expected_media_type); assert_eq!(actual_media_type_str, expected_media_type_str); } } }
rust_cleaned_test_functions.jsonl/34677
{ "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, 3062, 10347, 5673, 1769, 2903, 368, 341, 262, 1077, 37664, 284, 7486, 90515, 414, 3489, 691, 25, 5132, 20384, 1228, 81860, 21, 19, 50832, 55, 71, 20211, 18, 41, 15, 6265, 85, 11081, 45, 15, 19...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_parse_num1() { let segments = PathParser::new(r"/first<id:num(10)>").parse().unwrap(); assert_eq!( format!("{:?}", segments), r#"[CombPart([ConstPart("first"), CharPart { name: "id", min_width: 10, max_width: None }])]"# ); }
rust_cleaned_test_functions.jsonl/63598
{ "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, 21039, 4273, 16, 368, 341, 286, 1077, 20632, 284, 7933, 6570, 486, 931, 2601, 3115, 3896, 27, 307, 55268, 7, 16, 15, 16018, 1827, 6400, 1005, 15454, 543, 286, 2060, 10714, 33673, 310, 3561, 8892...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_run_search() { let mut config: Config = toml::from_str(CONFIG_DEFAULT).unwrap(); config.pager.mode = ConfigPagerMode::Disable; let args = vec!["procs", "root"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); let args = vec!["procs", "1"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); let args = vec!["procs", "--or", "root", "1"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); let args = vec!["procs", "--and", "root", "1"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); let args = vec!["procs", "--nor", "root", "1"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); let args = vec!["procs", "--nand", "root", "1"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); config.search.nonnumeric_search = ConfigSearchKind::Exact; config.search.numeric_search = ConfigSearchKind::Partial; let args = vec!["procs", "root", "1"]; let opt = Opt::from_iter(args.iter()); let ret = run_default(&opt, &config); assert!(ret.is_ok()); }
rust_cleaned_test_functions.jsonl/53091
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 710 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 14007, 10716, 368, 341, 286, 1077, 5206, 2193, 25, 5532, 284, 311, 1014, 486, 1499, 2895, 38958, 13811, 568, 15454, 543, 286, 2193, 556, 1409, 22981, 284, 5532, 22640, 3636, 486, 25479, 401, 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_reason_for_error() { let result = Ok(123); assert!(matches!(reason_for_error(&result), None)); let result: Result<(), error::Error> = Err(error::Error::KubeError { source: kube::error::Error::RequestSend, }); assert!(matches!(reason_for_error(&result), None)); let result: Result<(), error::Error> = Err(error::Error::KubeError { source: kube::error::Error::Api(ErrorResponse { status: "".to_string(), message: "".to_string(), reason: "Foobar".to_string(), code: 0, }), }); let result_2 = reason_for_error(&result); assert!( matches!(result_2, None), "Got [{:?}] expected [None]", result_2 ); let result: Result<(), error::Error> = Err(error::Error::KubeError { source: kube::error::Error::Api(ErrorResponse { status: "".to_string(), message: "".to_string(), reason: "AlreadyExists".to_string(), code: 0, }), }); let result_2 = reason_for_error(&result); assert!( matches!(result_2, Some(StatusReason::AlreadyExists)), "Got [{:?}] expected [Some(StatusReason::AlreadyExists)]", result_2 ); }
rust_cleaned_test_functions.jsonl/45739
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 719 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 38229, 5478, 4096, 368, 341, 286, 1077, 1102, 284, 7622, 7, 16, 17, 18, 317, 286, 2060, 10297, 19914, 10297, 19895, 5478, 4096, 2099, 1382, 701, 2240, 3237, 286, 1077, 1102, 25, 5714, 68843, 146...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_ufo_path_unique_extension_two_extensions_without_period() { let op = get_ufo_outpath(&Path::new("one/two/three.ufo"), &None, &Some("fmt.ufo".to_string())); assert_eq!(op, PathBuf::from("one/two/three.fmt.ufo")); }
rust_cleaned_test_functions.jsonl/21544
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 136 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 7300, 824, 2638, 21218, 31035, 23241, 60498, 39904, 20818, 368, 341, 286, 1077, 1179, 4035, 310, 633, 7300, 824, 6068, 2343, 2099, 1820, 486, 931, 445, 603, 5523, 1126, 20439, 765, 11634, 82...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_unit_sizes() { equal_tokens! { <nodes> "450MB" -> b::token_list(vec![b::bare("450MB")]) } }
rust_cleaned_test_functions.jsonl/5860
{ "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, 14832, 32159, 368, 341, 286, 6144, 28838, 0, 341, 310, 366, 20008, 397, 310, 330, 19, 20, 15, 8412, 1, 1464, 293, 486, 5839, 2019, 25592, 20703, 65, 486, 54102, 445, 19, 20, 15, 8412, 899, 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
#[test] fn test_read_identifier() { let mut reader = Lexer::from_str("abc ident test"); assert_tok(&mut reader, TokenKind::Identifier("abc".into()), 1, 1); assert_tok(&mut reader, TokenKind::Identifier("ident".into()), 1, 5); assert_tok(&mut reader, TokenKind::Identifier("test".into()), 1, 11); assert_end(&mut reader, 1, 15); }
rust_cleaned_test_functions.jsonl/101123
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 160 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 33176, 368, 341, 286, 1077, 5206, 6604, 284, 85082, 486, 1499, 2895, 445, 13683, 3524, 1273, 797, 286, 2060, 76162, 2099, 6984, 6604, 11, 9660, 10629, 486, 8714, 445, 13683, 3263, 18122, 118...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_runner() { let metric_addr = "127.0.0.1:60002"; let listen_addr = "127.0.0.1:60003"; let metric_sender = Box::new(MetricSender::new(metric_addr, String::from(listen_addr), String::from("test-sender"), 1).unwrap()) as Box<Runner + Send>; let mut listener = Transit::new(listen_addr).unwrap(); let (sn, rc) = chan::sync(1); let (test_sn, test_rc) = chan::sync(0); let thread = thread::spawn(move || { assert!(metric_sender.run(rc).is_ok()); test_sn.send(true); }); let res: Result<(MetricPacket,_), _> = listener.recv_from(); assert!(res.is_ok()); sn.send(Signal::INT); assert!(test_rc.recv().unwrap()); thread.join().expect("Could not join thread"); }
rust_cleaned_test_functions.jsonl/23600
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 525 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 54828, 368, 341, 286, 1077, 18266, 7387, 284, 330, 16, 17, 22, 13, 15, 13, 15, 13, 16, 25, 21, 15, 15, 15, 17, 876, 286, 1077, 8844, 7387, 284, 330, 16, 17, 22, 13, 15, 13, 15, 13, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_validator_exit_2() { solana_logger::setup(); error!("test_validator_exit_2"); let num_nodes = 2; let mut validator_config = ValidatorConfig::default(); validator_config.rpc_config.enable_validator_exit = true; validator_config.wait_for_supermajority = Some(0); let config = ClusterConfig { cluster_lamports: 10_000, node_stakes: vec![100; num_nodes], validator_configs: vec![validator_config; num_nodes], ..ClusterConfig::default() }; let local = LocalCluster::new(&config); cluster_tests::validator_exit(&local.entry_point_info, num_nodes); }
rust_cleaned_test_functions.jsonl/35984
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 263 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 64959, 16880, 62, 17, 368, 341, 262, 2048, 3362, 27413, 486, 15188, 543, 262, 1465, 17223, 1944, 64959, 16880, 62, 17, 797, 262, 1077, 1629, 14896, 284, 220, 17, 280, 262, 1077, 5206, 22935, 533...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_cast_enum_as_duration() { test_none_with_ctx_and_extra(cast_enum_as_duration); let cs: Vec<EnumRef> = vec![ EnumRef::new("17:51:04.78".as_bytes(), &0), EnumRef::new("17:51:04.78".as_bytes(), &1), EnumRef::new("-17:51:04.78".as_bytes(), &2), EnumRef::new("20000:20:20".as_bytes(), &3), EnumRef::new("-20000:20:20".as_bytes(), &4), EnumRef::new("abcdefg".as_bytes(), &5), ]; test_as_duration_helper( cs, |x| String::from_utf8_lossy(x.name()).to_string(), |x| String::from_utf8_lossy(x.name()).to_string(), cast_enum_as_duration, "cast_enum_as_duration", ); }
rust_cleaned_test_functions.jsonl/103220
{ "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, 5303, 31054, 11898, 25454, 368, 341, 286, 1273, 31488, 6615, 15147, 8378, 31858, 1337, 559, 31054, 11898, 25454, 317, 286, 1077, 10532, 25, 11312, 27, 10766, 3945, 29, 284, 7486, 90515, 310, 14086, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_pipe() { let (fd0, fd1) = pipe().unwrap(); let m0 = stat::SFlag::from_bits_truncate(stat::fstat(fd0).unwrap().st_mode); // S_IFIFO means it's a pipe assert_eq!(m0, SFlag::S_IFIFO); let m1 = stat::SFlag::from_bits_truncate(stat::fstat(fd1).unwrap().st_mode); assert_eq!(m1, SFlag::S_IFIFO); }
rust_cleaned_test_functions.jsonl/9003
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 167 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 41862, 368, 341, 262, 1077, 320, 6902, 15, 11, 12414, 16, 8, 284, 13647, 1005, 15454, 543, 262, 1077, 296, 15, 284, 2793, 486, 50, 12135, 486, 1499, 20034, 3547, 26900, 41785, 486, 69, 9878, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_purge_old_snapshot_archives() { // expecting the oldest 1 and the newest 1 are retained let snap1_name = format!("snapshot-1-{}.tar.zst", Hash::default()); let snap2_name = format!("snapshot-3-{}.tar.zst", Hash::default()); let snap3_name = format!("snapshot-50-{}.tar.zst", Hash::default()); let snapshot_names = vec![&snap1_name, &snap2_name, &snap3_name]; let expected_snapshots = vec![&snap1_name, &snap3_name]; common_test_purge_old_snapshot_archives(&snapshot_names, 1, &expected_snapshots); common_test_purge_old_snapshot_archives(&snapshot_names, 0, &expected_snapshots); let expected_snapshots = vec![&snap1_name, &snap2_name, &snap3_name]; common_test_purge_old_snapshot_archives(&snapshot_names, 2, &expected_snapshots); }
rust_cleaned_test_functions.jsonl/53298
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 378 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 620, 39823, 21108, 53265, 34330, 1886, 368, 341, 1789, 286, 442, 22331, 279, 23513, 220, 16, 323, 279, 23601, 220, 16, 525, 34263, 198, 286, 1077, 10658, 16, 1269, 284, 3561, 17223, 35501, 12, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_header() -> io::Result<()> { let mut writer = Writer::new(Vec::new()); let header = Header::default(); writer.write_header(&header)?; let expected = b"##fileformat=VCFv4.3 #CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO "; assert_eq!(writer.get_ref().as_slice(), &expected[..]); Ok(()) }
rust_cleaned_test_functions.jsonl/106955
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 175 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9165, 8757, 368, 1464, 6399, 486, 2077, 71698, 341, 286, 1077, 5206, 6916, 284, 29404, 486, 931, 49923, 486, 931, 5231, 286, 1077, 4247, 284, 12104, 486, 2258, 543, 286, 6916, 3836, 8757, 2099, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_big_struct() { use test_capnp::test_big_struct; // Make the first segment small to force allocation of a second segment. let mut message = message::Builder::new(message::HeapAllocator::new().first_segment_words(5)); let mut big_struct = message.init_root::<test_big_struct::Builder>(); big_struct.set_bool_field(false); big_struct.set_int8_field(-128); big_struct.set_int16_field(0); big_struct.set_int32_field(1009); assert_eq!(big_struct.has_struct_field(), false); big_struct.reborrow().init_struct_field(); assert_eq!(big_struct.has_struct_field(), true); { let mut inner = big_struct.reborrow().get_struct_field().unwrap(); inner.set_float64_field(0.1234567); inner.set_bool_field_b(true); } big_struct.set_bool_field(true); let big_struct_reader = big_struct.into_reader(); assert_eq!(big_struct_reader.has_struct_field(), true); assert_eq!(big_struct_reader.get_int8_field(), -128); assert_eq!(big_struct_reader.get_int32_field(), 1009); let inner_reader = big_struct_reader.get_struct_field().unwrap(); assert!(!inner_reader.get_bool_field_a()); assert!(inner_reader.get_bool_field_b()); assert_eq!(inner_reader.get_float64_field(), 0.1234567); }
rust_cleaned_test_functions.jsonl/55848
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 625 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 36386, 15126, 368, 341, 286, 990, 1273, 16388, 6199, 486, 1944, 36386, 15126, 401, 286, 442, 7405, 279, 1156, 10238, 2613, 311, 5344, 23757, 315, 264, 2086, 10238, 624, 286, 1077, 5206, 1943, 284,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_dst() { let _reset = set_time_zone_london_dst(); let utc_in_feb = strptime("2015-02-01Z", "%F%z").unwrap(); let utc_in_jun = strptime("2015-06-01Z", "%F%z").unwrap(); let utc_in_nov = strptime("2015-11-01Z", "%F%z").unwrap(); let local_in_feb = utc_in_feb.to_local(); let local_in_jun = utc_in_jun.to_local(); let local_in_nov = utc_in_nov.to_local(); assert_eq!(local_in_feb.tm_mon, 1); assert_eq!(local_in_feb.tm_hour, 0); assert_eq!(local_in_feb.tm_utcoff, 0); assert_eq!(local_in_feb.tm_isdst, 0); assert_eq!(local_in_jun.tm_mon, 5); assert_eq!(local_in_jun.tm_hour, 1); assert_eq!(local_in_jun.tm_utcoff, 3600); assert_eq!(local_in_jun.tm_isdst, 1); assert_eq!(local_in_nov.tm_mon, 10); assert_eq!(local_in_nov.tm_hour, 0); assert_eq!(local_in_nov.tm_utcoff, 0); assert_eq!(local_in_nov.tm_isdst, 0) }
rust_cleaned_test_functions.jsonl/7352
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 547 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 33114, 368, 341, 286, 1077, 716, 9716, 284, 738, 3009, 28692, 907, 6474, 33114, 543, 286, 1077, 69596, 1243, 761, 3065, 284, 607, 28941, 445, 17, 15, 16, 20, 12, 15, 17, 12, 15, 16, 57, 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...
1
#[test] fn test_create_tx_default_fee_rate() { let (wallet, _, _) = get_funded_wallet(get_test_wpkh()); let addr = wallet.get_new_address().unwrap(); let (psbt, details) = wallet .create_tx(TxBuilder::with_recipients(vec![( addr.script_pubkey(), 25_000, )])) .unwrap(); assert_fee_rate!(psbt.extract_tx(), details.fees, FeeRate::default(), @add_signature); }
rust_cleaned_test_functions.jsonl/11326
{ "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, 8657, 17805, 9993, 34305, 9246, 368, 341, 286, 1077, 320, 35735, 11, 8358, 27439, 284, 633, 761, 36053, 62308, 5433, 4452, 1670, 20819, 71, 1423, 286, 1077, 10789, 284, 15085, 670, 5921, 6744, 100...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_env_config() -> Result<()> { temp_env::with_vars( vec![ ("LOG_LEVEL", Some("DEBUG")), ("QUERY_TENANT_ID", Some("tenant-1")), ("QUERY_CLUSTER_ID", Some("cluster-1")), ("QUERY_MYSQL_HANDLER_HOST", Some("127.0.0.1")), ("QUERY_MYSQL_HANDLER_PORT", Some("3306")), ("QUERY_MAX_ACTIVE_SESSIONS", Some("255")), ("QUERY_CLICKHOUSE_HANDLER_HOST", Some("1.2.3.4")), ("QUERY_CLICKHOUSE_HANDLER_PORT", Some("9000")), ("QUERY_HTTP_HANDLER_HOST", Some("1.2.3.4")), ("QUERY_HTTP_HANDLER_PORT", Some("8001")), ("QUERY_FLIGHT_API_ADDRESS", Some("1.2.3.4:9091")), ("QUERY_ADMIN_API_ADDRESS", Some("1.2.3.4:8081")), ("QUERY_METRIC_API_ADDRESS", Some("1.2.3.4:7071")), ("QUERY_TABLE_CACHE_ENABLED", Some("true")), ("QUERY_TABLE_MEMORY_CACHE_MB_SIZE", Some("512")), ("QUERY_TABLE_DISK_CACHE_ROOT", Some("_cache_env")), ("QUERY_TABLE_DISK_CACHE_MB_SIZE", Some("512")), ("STORAGE_TYPE", Some("s3")), ("STORAGE_NUM_CPUS", Some("16")), ("STORAGE_FS_DATA_PATH", Some("/tmp/test")), ("STORAGE_S3_REGION", Some("us.region")), ("STORAGE_S3_ENDPOINT_URL", Some("http://127.0.0.1:10024")), ("STORAGE_S3_ACCESS_KEY_ID", Some("us.key.id")), ("STORAGE_S3_SECRET_ACCESS_KEY", Some("us.key")), ("STORAGE_S3_BUCKET", Some("us.bucket")), ("QUERY_TABLE_ENGINE_CSV_ENABLED", Some("true")), ("QUERY_TABLE_ENGINE_PARQUET_ENABLED", Some("true")), ("QUERY_TABLE_ENGINE_MEMORY_ENABLED", Some("true")), ("QUERY_DATABASE_ENGINE_GITHUB_ENABLED", Some("false")), ("CONFIG_FILE", None), ], || { let configured = Config::load().expect("must success"); assert_eq!("DEBUG", configured.log.level); assert_eq!("tenant-1", configured.query.tenant_id); assert_eq!("cluster-1", configured.query.cluster_id); assert_eq!("127.0.0.1", configured.query.mysql_handler_host); assert_eq!(3306, configured.query.mysql_handler_port); assert_eq!(255, configured.query.max_active_sessions); assert_eq!("1.2.3.4", configured.query.clickhouse_handler_host); assert_eq!(9000, configured.query.clickhouse_handler_port); assert_eq!("1.2.3.4", configured.query.http_handler_host); assert_eq!(8001, configured.query.http_handler_port); assert_eq!("1.2.3.4:9091", configured.query.flight_api_address); assert_eq!("1.2.3.4:8081", configured.query.admin_api_address); assert_eq!("1.2.3.4:7071", configured.query.metric_api_address); assert_eq!("s3", configured.storage.storage_type); assert_eq!(16, configured.storage.storage_num_cpus); assert_eq!("/tmp/test", configured.storage.fs.data_path); assert_eq!("us.region", configured.storage.s3.region); assert_eq!("http://127.0.0.1:10024", configured.storage.s3.endpoint_url); assert_eq!("us.key.id", configured.storage.s3.access_key_id); assert_eq!("us.key", configured.storage.s3.secret_access_key); assert_eq!("us.bucket", configured.storage.s3.bucket); assert!(configured.query.table_engine_csv_enabled); assert!(configured.query.table_engine_parquet_enabled); assert!(configured.query.table_engine_memory_enabled); assert!(!configured.query.database_engine_github_enabled); assert!(configured.query.table_cache_enabled); assert_eq!(512, configured.query.table_memory_cache_mb_size); assert_eq!("_cache_env", configured.query.table_disk_cache_root); assert_eq!(512, configured.query.table_disk_cache_mb_size); }, ); Ok(()) }
rust_cleaned_test_functions.jsonl/32231
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2041 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15879, 5332, 368, 1464, 5714, 71698, 341, 262, 2730, 15879, 486, 4197, 11168, 1006, 286, 7486, 90515, 310, 3489, 7243, 17415, 497, 4329, 445, 5150, 30154, 310, 3489, 41019, 1139, 953, 2821, 3450, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_cursor_pos() { let mut layout = Layout::new(0, (100, 20).into()); let mut input = StringInput::default(); input.set_value("Hello, World!".into()); input.set_at(0); assert_eq!(input.cursor_pos(layout), (0, 0)); input.set_at(4); assert_eq!(input.cursor_pos(layout), (4, 0)); layout.line_offset = 5; assert_eq!(input.cursor_pos(layout), (9, 0)); input.set_at(0); assert_eq!(input.cursor_pos(layout), (5, 0)); layout.line_offset = 0; input.set_value(LOREM.into()); assert_eq!(input.cursor_pos(layout), (0, 0)); input.set_at(4); assert_eq!(input.cursor_pos(layout), (4, 0)); layout.line_offset = 5; assert_eq!(input.cursor_pos(layout), (9, 0)); input.set_at(0); assert_eq!(input.cursor_pos(layout), (5, 0)); input.set_at(130); assert_eq!(input.cursor_pos(layout), (35, 1)); layout.line_offset = 0; input.set_at(0); input.set_value(UNICODE.into()); assert_eq!(input.cursor_pos(layout), (0, 0)); input.set_at(4); assert_eq!(input.cursor_pos(layout), (4, 0)); layout.line_offset = 5; assert_eq!(input.cursor_pos(layout), (9, 0)); input.set_at(0); assert_eq!(input.cursor_pos(layout), (5, 0)); input.set_at(130); assert_eq!(input.cursor_pos(layout), (35, 1)); layout.offset_y = 3; assert_eq!(input.cursor_pos(layout), (35, 4)); }
rust_cleaned_test_functions.jsonl/63670
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 788 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28601, 6479, 368, 341, 286, 1077, 5206, 6789, 284, 13821, 486, 931, 7, 15, 11, 320, 16, 15, 15, 11, 220, 17, 15, 568, 18122, 1423, 286, 1077, 5206, 1946, 284, 923, 2505, 486, 2258, 543, 286,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_iter_empty() { assert_eq!(0, Table::find_first(TABLE_EMPTY).unwrap().iter().count()); assert_eq!(0, Table::find_first(TABLE_TH).unwrap().iter().count()); }
rust_cleaned_test_functions.jsonl/47588
{ "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, 11723, 15124, 368, 341, 286, 2060, 10714, 10297, 15, 11, 6633, 486, 3903, 12978, 83006, 36640, 568, 15454, 1005, 2015, 1005, 1830, 1423, 286, 2060, 10714, 10297, 15, 11, 6633, 486, 3903, 12978, 83...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_vcx_disclosed_proof_retrieve_credentials() { let _setup = SetupMocks::init(); let _mock_builder = MockBuilder::init(). set_mock_creds_retrieved_for_proof_request(CREDS_FROM_PROOF_REQ); let proof_handle = _vcx_disclosed_proof_create_with_request_c_closure(ARIES_PROOF_REQUEST_PRESENTATION).unwrap(); let cb = return_types_u32::Return_U32_STR::new().unwrap(); assert_eq!(vcx_disclosed_proof_retrieve_credentials(cb.command_handle, proof_handle, Some(cb.get_callback())), error::SUCCESS.code_num); let _credentials = cb.receive(None).unwrap().unwrap(); }
rust_cleaned_test_functions.jsonl/110437
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 421 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2273, 25844, 37745, 9259, 86757, 1288, 34216, 47396, 368, 341, 286, 1077, 716, 15188, 284, 18626, 72577, 486, 2327, 543, 286, 1077, 716, 16712, 28532, 284, 14563, 3297, 486, 2327, 25829, 310, 738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_decompose_sccs_one_wc_with_two_sccs() { let mut graph = petgraph_impl::new(); let n0 = graph.add_node(0); let n1 = graph.add_node(1); let n2 = graph.add_node(2); let n3 = graph.add_node(3); let n4 = graph.add_node(4); graph.add_edge(n0, n1, 10); graph.add_edge(n1, n2, 11); graph.add_edge(n2, n3, 12); graph.add_edge(n3, n4, 13); graph.add_edge(n1, n0, 15); graph.add_edge(n1, n0, 155); graph.add_edge(n3, n2, 17); graph.add_edge(n4, n3, 1); graph.add_edge(n2, n2, 20); debug_assert!(!is_strongly_connected(&graph)); let node_map = decompose_strongly_connected_components(&graph); debug_assert_eq!(node_map, vec![n0, n0, n2, n2, n2]); let result = extract_subgraphs_from_node_mapping(&graph, &node_map); debug_assert_eq!(result.len(), 2); let first = &result[0]; let second = &result[1]; debug_assert_eq!(first.node_count(), 2); debug_assert_eq!(first.edge_count(), 3); debug_assert_eq!(second.node_count(), 3); debug_assert_eq!(second.edge_count(), 5); debug_assert_node_data(first, &mut [0, 1]); debug_assert_edge_data(first, &mut [10, 15, 155]); debug_assert_node_data(second, &mut [2, 3, 4]); debug_assert_edge_data(second, &mut [1, 12, 13, 17, 20]); }
rust_cleaned_test_functions.jsonl/115479
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 730 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2259, 52706, 643, 638, 82, 11667, 75871, 6615, 23241, 643, 638, 82, 368, 341, 286, 1077, 5206, 4771, 284, 6753, 4439, 21007, 486, 931, 543, 286, 1077, 308, 15, 284, 4771, 1364, 5084, 7, 15, 31...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_read_write() { let mut block = default_block(); let mem = block.mem.clone(); let vq = VirtQueue::new(GuestAddress(0), &mem, 16); block.set_queue(0, vq.create_queue()); block.activate().unwrap(); initialize_virtqueue(&vq); let request_type_addr = GuestAddress(vq.dtable[0].addr.get()); let data_addr = GuestAddress(vq.dtable[1].addr.get()); let status_addr = GuestAddress(vq.dtable[2].addr.get()); // Write. { mem.write_obj::<u32>(VIRTIO_BLK_T_OUT, request_type_addr) .unwrap(); vq.dtable[1].flags.set(VIRTQ_DESC_F_NEXT); vq.dtable[1].len.set(8); mem.write_obj::<u64>(123_456_789, data_addr).unwrap(); check_metric_after_block!( &METRICS.block.write_count, 1, invoke_handler_for_queue_event(&mut block) ); assert_eq!(vq.used.idx.get(), 1); assert_eq!(vq.used.ring[0].get().id, 0); assert_eq!(vq.used.ring[0].get().len, 0); assert_eq!(mem.read_obj::<u32>(status_addr).unwrap(), VIRTIO_BLK_S_OK); } // Read. { vq.used.idx.set(0); block.set_queue(0, vq.create_queue()); mem.write_obj::<u32>(VIRTIO_BLK_T_IN, request_type_addr) .unwrap(); vq.dtable[1] .flags .set(VIRTQ_DESC_F_NEXT | VIRTQ_DESC_F_WRITE); check_metric_after_block!( &METRICS.block.read_count, 1, invoke_handler_for_queue_event(&mut block) ); assert_eq!(vq.used.idx.get(), 1); assert_eq!(vq.used.ring[0].get().id, 0); assert_eq!(vq.used.ring[0].get().len, vq.dtable[1].len.get()); assert_eq!(mem.read_obj::<u32>(status_addr).unwrap(), VIRTIO_BLK_S_OK); assert_eq!(mem.read_obj::<u64>(data_addr).unwrap(), 123_456_789); } }
rust_cleaned_test_functions.jsonl/76939
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1186 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 9165, 368, 341, 286, 1077, 5206, 2504, 284, 1638, 7113, 543, 286, 1077, 1833, 284, 2504, 41493, 15997, 543, 286, 1077, 348, 80, 284, 47775, 7554, 486, 931, 6699, 3045, 4286, 7, 15, 701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_cycle_generic_type() { let hdr = indoc! {" #include <cstdint> template<typename TY> struct Container { Container(TY a_) : a(a_) {} TY a; }; inline Container<char> make_thingy() { Container<char> a('a'); return a; } typedef Container<char> Concrete; inline uint32_t take_thingy(Concrete a) { return a.a; } "}; let rs = quote! { assert_eq!(ffi::take_thingy(ffi::make_thingy()), 'a' as u32) }; run_test("", hdr, rs, &["take_thingy", "make_thingy"], &[]); }
rust_cleaned_test_functions.jsonl/9856
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 342 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 39079, 41232, 1819, 368, 341, 262, 1077, 36615, 284, 1257, 509, 0, 314, 698, 286, 671, 997, 366, 96975, 397, 286, 3811, 16544, 48862, 397, 286, 2036, 9678, 341, 310, 9678, 4140, 56, 264, 16324, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_id() { mock_mgp_once!(mgp_vertex_get_id_context, |_, vertex_id_ptr| unsafe { (*vertex_id_ptr).as_int = 72; mgp_error::MGP_ERROR_NO_ERROR }); with_dummy!(Vertex, |vertex: &Vertex| { assert_eq!(vertex.id(), 72); }); }
rust_cleaned_test_functions.jsonl/28516
{ "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, 842, 368, 341, 262, 7860, 717, 21888, 7630, 10297, 12311, 79, 26611, 3062, 842, 8467, 11, 760, 6878, 11936, 842, 4348, 91, 19860, 341, 286, 4609, 12085, 842, 4348, 568, 300, 4042, 284, 220, 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_wait_timeout() { let persistence_notifier = Arc::new(PersistenceNotifier::new()); let thread_notifier = Arc::clone(&persistence_notifier); let exit_thread = Arc::new(AtomicBool::new(false)); let exit_thread_clone = exit_thread.clone(); thread::spawn(move || { loop { let &(ref persist_mtx, ref cnd) = &thread_notifier.persistence_lock; let mut persistence_lock = persist_mtx.lock().unwrap(); *persistence_lock = true; cnd.notify_all(); if exit_thread_clone.load(Ordering::SeqCst) { break } } }); // Check that we can block indefinitely until updates are available. let _ = persistence_notifier.wait(); // Check that the PersistenceNotifier will return after the given duration if updates are // available. loop { if persistence_notifier.wait_timeout(Duration::from_millis(100)) { break } } exit_thread.store(true, Ordering::SeqCst); // Check that the PersistenceNotifier will return after the given duration even if no updates // are available. loop { if !persistence_notifier.wait_timeout(Duration::from_millis(100)) { break } } }
rust_cleaned_test_functions.jsonl/79988
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 427 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18760, 20537, 368, 341, 197, 10217, 40956, 86179, 284, 19689, 486, 931, 5304, 8026, 64729, 486, 931, 1423, 197, 10217, 4516, 86179, 284, 19689, 486, 19982, 2099, 79, 8026, 86179, 626, 197, 10217, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
#[test] fn test_sign_verify_add() { let (creator_kp, creator_secret) = get_fake_keypackage(); let (to_be_added, _) = get_fake_keypackage(); let (context, tree) = GroupContext::init(creator_kp); let group_aux = GroupAux::new(context, tree, creator_secret); let plain = group_aux.get_signed_add(&to_be_added); assert!(plain .verify_signature( &group_aux.context, &group_aux.kp_secret.credential_private_key.public_key() ) .is_ok()); }
rust_cleaned_test_functions.jsonl/25582
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 281 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11172, 35638, 2891, 368, 341, 286, 1077, 320, 32398, 4698, 79, 11, 19919, 21962, 8, 284, 633, 56881, 3097, 1722, 543, 286, 1077, 320, 983, 21263, 37653, 11, 27439, 284, 633, 56881, 3097, 1722, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_edge_case_1() { let result = parser(vec![ DeltaOp { insert: Value::String(String::from("\t")), attributes: None, }, DeltaOp { insert: json!({ "savvy_image": "path/to/image" }), attributes: Some(json!({"alt": "Rotating_earth_(large).gif"})), }, DeltaOp { insert: Value::String(String::from("\n\n")), attributes: None, }, ]); assert_eq!(result, String::from("<p>\t<img src=\"path/to/image\" alt=\"Rotating_earth_(large).gif\"></p><p><br></p>")); }
rust_cleaned_test_functions.jsonl/33078
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 403 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17932, 19096, 62, 16, 368, 341, 286, 1077, 1102, 284, 6729, 25592, 90515, 310, 24957, 7125, 341, 394, 5656, 25, 5162, 486, 703, 2242, 486, 1499, 4921, 83, 30154, 394, 8201, 25, 2240, 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, 1, 1, 1...
1
#[test] fn test_new() { let id = CodeId::new("dfb8e43af2423d73a453aeb6a777ef75".into()); assert_eq!(id.as_str(), "dfb8e43af2423d73a453aeb6a777ef75"); }
rust_cleaned_test_functions.jsonl/67975
{ "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, 5921, 368, 341, 262, 1077, 877, 284, 6119, 764, 486, 931, 445, 2940, 65, 23, 68, 19, 18, 2577, 17, 19, 17, 18, 67, 22, 18, 64, 19, 20, 18, 64, 3065, 21, 64, 22, 22, 22, 823, 22, 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_parse_gameroom_service() { let time = SystemTime::now(); let services = parse_splinter_services( "my_circuit", &get_msg_proposal("my_circuit").circuit.roster, time, ); assert_eq!(services, vec![get_new_gameroom_service("my_circuit", time)]); }
rust_cleaned_test_functions.jsonl/131061
{ "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, 21039, 1889, 309, 2328, 316, 12267, 368, 341, 286, 1077, 882, 284, 739, 1462, 486, 3328, 543, 286, 1077, 3516, 284, 4715, 643, 500, 2245, 39846, 1006, 310, 330, 2408, 666, 37268, 756, 310, 609, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_bin() { let args = [ String::from("command"), String::from("-w"), String::from("is"), String::from("./test-data/test.txt"), ]; let mut config = parse_config(&args).unwrap(); let mut file_content = String::new(); config.get_file().read_to_string(&mut file_content).unwrap(); let matched_indices = search(&mut config); assert_eq!(matched_indices.len(), 1); assert_eq!(matched_indices[0], 5); }
rust_cleaned_test_functions.jsonl/19382
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 203 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21816, 368, 341, 262, 1077, 2827, 284, 2278, 286, 923, 486, 1499, 445, 5631, 4461, 286, 923, 486, 1499, 13645, 86, 4461, 286, 923, 486, 1499, 445, 285, 4461, 286, 923, 486, 1499, 13988, 1944, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_from_iter() { let v: SmallVector<int> = (vec!(1i, 2, 3)).move_iter().collect(); assert_eq!(3, v.len()); assert_eq!(&1, v.get(0)); assert_eq!(&2, v.get(1)); assert_eq!(&3, v.get(2)); }
rust_cleaned_test_functions.jsonl/54735
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 140 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 11723, 368, 341, 286, 1077, 348, 25, 14994, 3781, 4159, 29, 284, 320, 4083, 10297, 16, 72, 11, 220, 17, 11, 220, 18, 4579, 3397, 11723, 1005, 17384, 543, 286, 2060, 10714, 10297, 18, 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_encode_and_decode() { let mut stx = SignedTransaction::default(); stx.data = vec![1; 200]; let transactions = vec![stx; 200]; let body = BlockBody { transactions }; let body_rlp = rlp::encode(&body); let body: BlockBody = rlp::decode(&body_rlp); let body_encoded = rlp::encode(&body).into_vec(); assert_eq!(body_rlp, body_encoded); }
rust_cleaned_test_functions.jsonl/57069
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 197 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11224, 8378, 15227, 368, 341, 286, 1077, 5206, 357, 87, 284, 52453, 8070, 486, 2258, 543, 286, 357, 87, 2196, 284, 7486, 20703, 16, 26, 220, 17, 15, 15, 935, 286, 1077, 14131, 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_dirty_node_only_if_children_are_actually_removed() { let mut root = Node::new(); style!(root, AlignItems(Align::FlexStart), Width(100 pt), Height(100 pt) ); let mut root_child_0 = Node::new(); style!(root_child_0, Width(50 pt), Height(25 pt) ); root.insert_child(&mut root_child_0, 0); root.calculate_layout(UNDEFINED, UNDEFINED, Direction::LTR); let mut root_child_1 = Node::new(); root.remove_child(&mut root_child_1); assert!(!root.is_dirty()); drop(root_child_1); root.remove_child(&mut root_child_0); assert!(root.is_dirty()); }
rust_cleaned_test_functions.jsonl/134644
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 247 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 63642, 5084, 18410, 11119, 31206, 56855, 29370, 1832, 68248, 368, 341, 10217, 5206, 3704, 284, 6018, 486, 931, 1428, 42551, 10297, 2888, 345, 197, 197, 10069, 4353, 7, 10069, 486, 31671, 3479, 1326,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_keymap() { let keymaps = r###" keymaps = [ { key = "ctrl+w l l", command = "right", when = "n" }, { key = "ctrl+w l", command = "right", when = "n" }, { key = "ctrl+w h", command = "left", when = "n" }, { key = "ctrl+w", command = "left", when = "n" }, ] "###; let keymaps = KeyPressData::keymaps_from_str(keymaps).unwrap(); let keypress = KeyPressData::get_keypress("ctrl+w"); assert_eq!(keymaps.get(&keypress).unwrap().len(), 4); let keypress = KeyPressData::get_keypress("ctrl+w l"); assert_eq!(keymaps.get(&keypress).unwrap().len(), 2); let keypress = KeyPressData::get_keypress("ctrl+w h"); assert_eq!(keymaps.get(&keypress).unwrap().len(), 1); let keypress = KeyPressData::get_keypress("ctrl+w l l"); assert_eq!(keymaps.get(&keypress).unwrap().len(), 1); }
rust_cleaned_test_functions.jsonl/8150
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 399 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3097, 2186, 368, 341, 286, 1077, 1376, 17640, 284, 435, 14374, 698, 792, 17640, 284, 2278, 262, 314, 1376, 284, 330, 11933, 65105, 326, 326, 497, 3210, 284, 330, 1291, 497, 979, 284, 330, 77, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_check_interval() { block_on(async { let config = config_generator(); let mut state_machine = StateMachine::new( StubPolicyEngine, StubHttpRequest, StubInstaller::default(), &config, StubTimer, MockMetricsReporter::new(false), Rc::new(Mutex::new(MemStorage::new())), make_test_app_set(), ) .await; clock::mock::set(time::i64_to_time(123456789)); state_machine.report_check_interval().await; // No metrics should be reported because no last check time in storage. assert!(state_machine.metrics_reporter.metrics.is_empty()); { let storage = state_machine.storage_ref.lock().await; assert_eq!(storage.get_int(LAST_CHECK_TIME).await, Some(123456789)); assert_eq!(storage.len(), 1); assert!(storage.committed()); } // A second update check should report metrics. let duration = Duration::from_micros(999999); clock::mock::set(clock::now() + duration); state_machine.report_check_interval().await; assert_eq!( state_machine.metrics_reporter.metrics, vec![Metrics::UpdateCheckInterval(duration)] ); let storage = state_machine.storage_ref.lock().await; assert_eq!(storage.get_int(LAST_CHECK_TIME).await, Some(123456789 + 999999)); assert_eq!(storage.len(), 1); assert!(storage.committed()); }); }
rust_cleaned_test_functions.jsonl/94235
{ "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, 14813, 7200, 20541, 368, 341, 286, 2504, 4470, 18285, 341, 310, 1077, 2193, 284, 2193, 25813, 543, 310, 1077, 5206, 1584, 38695, 284, 3234, 21605, 486, 931, 1006, 394, 66611, 13825, 4571, 345, 394...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_canonical_json_inspect_formatting() { let mut hierarchy = NodeHierarchy::new( "root", vec![Property::String("x".to_string(), "foo".to_string())], vec![], ); hierarchy.sort(); let json_schema = Data::for_inspect( "a/b/c/d", Some(hierarchy), 123456u64, TEST_URL, "test_file_plz_ignore.inspect", Vec::new(), ); let result_json = serde_json::to_value(&json_schema).expect("serialization should succeed."); let expected_json = json!({ "moniker": "a/b/c/d", "version": 1, "data_source": "Inspect", "payload": { "root": { "x": "foo" } }, "metadata": { "component_url": TEST_URL, "errors": null, "filename": "test_file_plz_ignore.inspect", "timestamp": 123456, } }); pretty_assertions::assert_eq!(result_json, expected_json, "golden diff failed."); }
rust_cleaned_test_functions.jsonl/71447
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 626 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 27421, 22391, 9455, 34386, 987, 8955, 1280, 368, 341, 286, 1077, 5206, 28922, 284, 6018, 85264, 486, 931, 1006, 310, 330, 2888, 756, 310, 7486, 20703, 3052, 486, 703, 445, 87, 3263, 983, 3904, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_range_query() { let int_field: Field; let schema = { let mut schema_builder = Schema::builder(); int_field = schema_builder.add_i64_field("intfield", INDEXED); schema_builder.build() }; let index = Index::create_in_ram(schema); { let mut index_writer = index.writer_with_num_threads(2, 6_000_000).unwrap(); for i in 1..100 { let mut doc = Document::new(); for j in 1..100 { if i % j == 0 { doc.add_i64(int_field, j as i64); } } index_writer.add_document(doc); } index_writer.commit().unwrap(); } let reader = index.reader().unwrap(); let searcher = reader.searcher(); let count_multiples = |range_query: RangeQuery| searcher.search(&range_query, &Count).unwrap(); assert_eq!(count_multiples(RangeQuery::new_i64(int_field, 10..11)), 9); assert_eq!( count_multiples(RangeQuery::new_i64_bounds( int_field, Bound::Included(10), Bound::Included(11) )), 18 ); assert_eq!( count_multiples(RangeQuery::new_i64_bounds( int_field, Bound::Excluded(9), Bound::Included(10) )), 9 ); assert_eq!( count_multiples(RangeQuery::new_i64_bounds( int_field, Bound::Included(9), Bound::Unbounded )), 91 ); }
rust_cleaned_test_functions.jsonl/107880
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 994 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9698, 5738, 368, 341, 286, 1077, 526, 5013, 25, 8601, 280, 286, 1077, 10802, 284, 341, 310, 1077, 5206, 10802, 28532, 284, 12539, 486, 17850, 543, 310, 526, 5013, 284, 10802, 28532, 1364, 5318, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
#[test] fn test_unique_glyph_names() { let names = vec!["A"; 3].into_iter().map(Cow::from); let unique_names = unique_glyph_names(names, 3); assert_eq!( unique_names, &[Cow::from("A"), Cow::from("A.alt01"), Cow::from("A.alt02")] ); }
rust_cleaned_test_functions.jsonl/62855
{ "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, 21218, 88703, 9187, 368, 341, 286, 1077, 5036, 284, 7486, 0, 1183, 32, 5123, 220, 18, 936, 18122, 11723, 1005, 2186, 3025, 363, 486, 1499, 317, 286, 1077, 4911, 9187, 284, 4911, 88703, 9187, 404...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_bordered_gif_full() { assert_borders_full!("bordered.gif", Borders { top: 41, right: 0, bottom: 39, left: 0, }); }
rust_cleaned_test_functions.jsonl/48476
{ "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, 880, 10544, 1889, 333, 16372, 368, 341, 262, 2060, 880, 7917, 16372, 17223, 9461, 291, 16008, 756, 5108, 80712, 341, 6526, 1909, 25, 220, 19, 16, 345, 6526, 1290, 25, 220, 15, 345, 6526, 5622, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_authenticate_enforce() { let mut rng = ThreadRng256 {}; let dummy_user_presence = |_| panic!("Unexpected user presence check in CTAP1"); let sk = crypto::ecdsa::SecKey::gensk(&mut rng); let mut ctap_state = CtapState::new(&mut rng, dummy_user_presence, START_CLOCK_VALUE); let rp_id = "example.com"; let application = crypto::sha256::Sha256::hash(rp_id.as_bytes()); let key_handle = ctap_state.encrypt_key_handle(sk, &application).unwrap(); let message = create_authenticate_message(&application, Ctap1Flags::EnforceUpAndSign, &key_handle); ctap_state.u2f_up_state.consume_up(START_CLOCK_VALUE); ctap_state.u2f_up_state.grant_up(START_CLOCK_VALUE); let response = Ctap1Command::process_command(&message, &mut ctap_state, START_CLOCK_VALUE).unwrap(); assert_eq!(response[0], 0x01); check_signature_counter( array_ref!(response, 1, 4), ctap_state .persistent_store .global_signature_counter() .unwrap(), ); }
rust_cleaned_test_functions.jsonl/55445
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 545 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11305, 14014, 22661, 6205, 8833, 368, 341, 286, 1077, 5206, 28422, 284, 8752, 49, 968, 17, 20, 21, 9321, 286, 1077, 17292, 3317, 56403, 284, 66091, 21975, 17223, 29430, 1196, 9362, 1779, 304, 1857...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_next_with_complex_rules_should_have_correct_start() { let mut lsys: LSystem = LSystem::new("AB".to_string()); let mut rule: HashMap<char, String> = HashMap::new(); rule.insert('A', "AB".to_string()); rule.insert('B', "A".to_string()); lsys.push(rule); let next: LSystem = lsys.next(); assert_eq!(next.start, "ABA"); }
rust_cleaned_test_functions.jsonl/101653
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 185 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11257, 6615, 41522, 21407, 43378, 67301, 31550, 4906, 368, 341, 286, 1077, 5206, 326, 7791, 25, 444, 2320, 284, 444, 2320, 486, 931, 445, 1867, 3263, 983, 3904, 1423, 286, 1077, 5206, 5912, 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...
1
#[test] fn test_host_parser() { assert_eq!(parse_host("example.com"), ("example.com", None)); assert_eq!(parse_host("example.com:8080"), ("example.com", Some(8080))); assert_eq!(parse_host("example:8080"), ("example", Some(8080))); assert_eq!(parse_host("example.com:false"), ("example.com", None)); assert_eq!(parse_host("example.com:false:false"), ("example.com", None)); }
rust_cleaned_test_functions.jsonl/32857
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 180 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12848, 18517, 368, 341, 286, 2060, 10714, 10297, 6400, 12848, 445, 8687, 905, 3975, 3489, 8687, 905, 497, 2240, 1106, 286, 2060, 10714, 10297, 6400, 12848, 445, 8687, 905, 25, 23, 15, 23, 15, 39...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_parse_bak_multiple() { for i in 0..250 { let source = "<".repeat(i); let instructions = Parser::parse_instructions(&Parser::parse_string(source.as_str())); assert_eq!(instructions, vec![Instruction::BAK(1); i]); } }
rust_cleaned_test_functions.jsonl/56694
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 120 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 880, 585, 45233, 368, 341, 262, 369, 600, 304, 220, 15, 496, 17, 20, 15, 341, 286, 1077, 2530, 284, 4055, 3263, 30624, 1956, 317, 286, 1077, 11221, 284, 21102, 486, 6400, 82427, 2099, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_hover_arg_impl_traits_has_goto_type_action() { check_actions( r#" trait Foo {} trait Bar<T> {} struct S{} fn foo(ar<|>g: &impl Foo + Bar<S>) {} "#, expect![[r#" [ GoToType( [ HoverGotoTypeData { mod_path: "test::Foo", nav: NavigationTarget { file_id: FileId( 0, ), full_range: 0..12, focus_range: Some( 6..9, ), name: "Foo", kind: TRAIT, container_name: None, description: Some( "trait Foo", ), docs: None, }, }, HoverGotoTypeData { mod_path: "test::Bar", nav: NavigationTarget { file_id: FileId( 0, ), full_range: 13..28, focus_range: Some( 19..22, ), name: "Bar", kind: TRAIT, container_name: None, description: Some( "trait Bar", ), docs: None, }, }, HoverGotoTypeData { mod_path: "test::S", nav: NavigationTarget { file_id: FileId( 0, ), full_range: 29..39, focus_range: Some( 36..37, ), name: "S", kind: STRUCT, container_name: None, description: Some( "struct S", ), docs: None, }, }, ], ), ] "#]], ); }
rust_cleaned_test_functions.jsonl/66171
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2526 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 53445, 6057, 21007, 39693, 21778, 97732, 1819, 7931, 368, 341, 286, 1779, 25368, 1006, 310, 435, 2, 698, 29432, 33428, 5613, 29432, 4716, 3125, 29, 5613, 1235, 328, 31483, 8822, 15229, 37544, 27, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_index_mut() { fn prop(iv: IVec3) -> bool { let mut miv = iv; miv[0] = iv.x + 1; miv[1] = iv.y + 1; miv[2] = iv.z + 1; miv == iv + IVec3::one() } quickcheck(prop as fn(IVec3) -> bool); }
rust_cleaned_test_functions.jsonl/114286
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 189 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3560, 29523, 368, 341, 286, 5168, 2004, 71714, 25, 358, 10050, 18, 8, 1464, 1807, 341, 310, 1077, 5206, 296, 344, 284, 17509, 280, 310, 296, 344, 58, 15, 60, 284, 17509, 1993, 488, 220, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_division_by_scalefactor() { let length: Length<f32, Cm> = Length::new(5.0); let cm_per_second: Scale<f32, Second, Cm> = Scale::new(10.0); let result = length / cm_per_second; let expected: Length<f32, Second> = Length::new(0.5); assert_eq!(result, expected); }
rust_cleaned_test_functions.jsonl/50587
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 154 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16237, 1816, 3710, 16727, 37591, 368, 341, 286, 1077, 3084, 25, 17287, 63895, 18, 17, 11, 356, 76, 29, 284, 17287, 486, 931, 7, 20, 13, 15, 317, 286, 1077, 9961, 5678, 29644, 25, 24613, 63895,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_count_chars_with() { let test_input = create_test_input(); let num_chars = count_chars(&test_input); assert_eq!(num_chars, 36); }
rust_cleaned_test_functions.jsonl/1886
{ "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, 3180, 37418, 6615, 368, 341, 286, 1077, 1273, 5898, 284, 1855, 4452, 5898, 543, 286, 1077, 1629, 37418, 284, 1760, 37418, 2099, 1944, 5898, 626, 286, 2060, 10714, 10297, 2413, 37418, 11, 220, 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
#[test] fn test_from_str_radix() { let r = to_str_pairs(); for num_pair in r.iter() { let &(ref n, ref rs) = num_pair; for str_pair in rs.iter() { let &(ref radix, ref str) = str_pair; assert_eq!(n, &FromStrRadix::from_str_radix(str.as_slice(), *radix).unwrap()); } } let zed: Option<BigUint> = FromStrRadix::from_str_radix("Z", 10); assert_eq!(zed, None); let blank: Option<BigUint> = FromStrRadix::from_str_radix("_", 2); assert_eq!(blank, None); let minus_one: Option<BigUint> = FromStrRadix::from_str_radix("-1", 10); assert_eq!(minus_one, None); }
rust_cleaned_test_functions.jsonl/98319
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 526 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 2895, 39764, 941, 368, 341, 286, 1077, 435, 284, 311, 2895, 36430, 543, 286, 369, 1629, 14445, 304, 435, 19471, 368, 341, 310, 1077, 22796, 1097, 308, 11, 2053, 10036, 8, 284, 1629, 14445,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_byteio() { let file = File::open("Cargo.toml").unwrap(); let io: ByteIo<_, LittleEndian> = ByteIo::new(file); let r = io.read_i32_at(3).unwrap(); assert_eq!(0x67616b63, r); }
rust_cleaned_test_functions.jsonl/115219
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 105 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19737, 815, 368, 341, 262, 1077, 1034, 284, 2887, 486, 2508, 445, 98228, 73494, 75, 1827, 15454, 543, 262, 1077, 6399, 25, 10906, 42799, 27, 6878, 14671, 43231, 29, 284, 10906, 42799, 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_read_handshake() { use crate::PEER_ID; let mut r = Reader::new(); let m = Message::Handshake { rsv: [0; 8], hash: [0; 20], id: *PEER_ID, }; let mut data = vec![0; 68]; m.encode(&mut data[..]).unwrap(); let mut c = Cursor::new(&data); assert_eq!(r.readable(&mut c).unwrap().unwrap(), m); }
rust_cleaned_test_functions.jsonl/46454
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 228 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6443, 23194, 29661, 368, 341, 286, 990, 17717, 486, 1740, 640, 3450, 280, 286, 1077, 5206, 435, 284, 25166, 486, 931, 543, 286, 1077, 296, 284, 4856, 486, 2314, 29661, 341, 310, 435, 3492, 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...
1
#[test] fn test_exact_chunks_mut_nth() { let v: &mut [i32] = &mut [0, 1, 2, 3, 4, 5]; let mut c = v.exact_chunks_mut(2); assert_eq!(c.nth(1).unwrap(), &[2, 3]); assert_eq!(c.next().unwrap(), &[4, 5]); let v2: &mut [i32] = &mut [0, 1, 2, 3, 4, 5, 6]; let mut c2 = v2.exact_chunks_mut(3); assert_eq!(c2.nth(1).unwrap(), &[3, 4, 5]); assert_eq!(c2.next(), None); }
rust_cleaned_test_functions.jsonl/4143
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 222 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 71084, 65470, 29523, 78342, 368, 341, 262, 1077, 348, 25, 609, 6984, 508, 72, 18, 17, 60, 284, 609, 6984, 508, 15, 11, 220, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 935, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_js_doc_tag_named() { assert_eq!( serde_json::to_value(JsDoc::from( "@callback name more docs\n\nnew paragraph".to_string() )) .unwrap(), json!({ "tags": [ { "kind": "callback", "name": "name", "doc": "more docs\n\nnew paragraph", } ] }) ); assert_eq!( serde_json::to_value(JsDoc::from( "@template T more docs\n\nnew paragraph".to_string() )) .unwrap(), json!({ "tags": [ { "kind": "template", "name": "T", "doc": "more docs\n\nnew paragraph", } ] }) ); }
rust_cleaned_test_functions.jsonl/119526
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 416 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 26250, 18869, 9372, 71834, 368, 341, 262, 2060, 10714, 33673, 414, 61570, 9455, 486, 983, 3142, 16368, 82, 9550, 486, 1499, 1006, 286, 8428, 13494, 829, 803, 26340, 1699, 1699, 931, 14311, 3263, 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_error_helpers() { let r: Response = ErrorBadRequest("err").into(); assert_eq!(r.status(), StatusCode::BAD_REQUEST); let r: Response = ErrorUnauthorized("err").into(); assert_eq!(r.status(), StatusCode::UNAUTHORIZED); let r: Response = ErrorPaymentRequired("err").into(); assert_eq!(r.status(), StatusCode::PAYMENT_REQUIRED); let r: Response = ErrorForbidden("err").into(); assert_eq!(r.status(), StatusCode::FORBIDDEN); let r: Response = ErrorNotFound("err").into(); assert_eq!(r.status(), StatusCode::NOT_FOUND); let r: Response = ErrorMethodNotAllowed("err").into(); assert_eq!(r.status(), StatusCode::METHOD_NOT_ALLOWED); let r: Response = ErrorNotAcceptable("err").into(); assert_eq!(r.status(), StatusCode::NOT_ACCEPTABLE); let r: Response = ErrorProxyAuthenticationRequired("err").into(); assert_eq!(r.status(), StatusCode::PROXY_AUTHENTICATION_REQUIRED); let r: Response = ErrorRequestTimeout("err").into(); assert_eq!(r.status(), StatusCode::REQUEST_TIMEOUT); let r: Response = ErrorConflict("err").into(); assert_eq!(r.status(), StatusCode::CONFLICT); let r: Response = ErrorGone("err").into(); assert_eq!(r.status(), StatusCode::GONE); let r: Response = ErrorLengthRequired("err").into(); assert_eq!(r.status(), StatusCode::LENGTH_REQUIRED); let r: Response = ErrorPreconditionFailed("err").into(); assert_eq!(r.status(), StatusCode::PRECONDITION_FAILED); let r: Response = ErrorPayloadTooLarge("err").into(); assert_eq!(r.status(), StatusCode::PAYLOAD_TOO_LARGE); let r: Response = ErrorUriTooLong("err").into(); assert_eq!(r.status(), StatusCode::URI_TOO_LONG); let r: Response = ErrorUnsupportedMediaType("err").into(); assert_eq!(r.status(), StatusCode::UNSUPPORTED_MEDIA_TYPE); let r: Response = ErrorRangeNotSatisfiable("err").into(); assert_eq!(r.status(), StatusCode::RANGE_NOT_SATISFIABLE); let r: Response = ErrorExpectationFailed("err").into(); assert_eq!(r.status(), StatusCode::EXPECTATION_FAILED); let r: Response = ErrorImATeapot("err").into(); assert_eq!(r.status(), StatusCode::IM_A_TEAPOT); let r: Response = ErrorMisdirectedRequest("err").into(); assert_eq!(r.status(), StatusCode::MISDIRECTED_REQUEST); let r: Response = ErrorUnprocessableEntity("err").into(); assert_eq!(r.status(), StatusCode::UNPROCESSABLE_ENTITY); let r: Response = ErrorLocked("err").into(); assert_eq!(r.status(), StatusCode::LOCKED); let r: Response = ErrorFailedDependency("err").into(); assert_eq!(r.status(), StatusCode::FAILED_DEPENDENCY); let r: Response = ErrorUpgradeRequired("err").into(); assert_eq!(r.status(), StatusCode::UPGRADE_REQUIRED); let r: Response = ErrorPreconditionRequired("err").into(); assert_eq!(r.status(), StatusCode::PRECONDITION_REQUIRED); let r: Response = ErrorTooManyRequests("err").into(); assert_eq!(r.status(), StatusCode::TOO_MANY_REQUESTS); let r: Response = ErrorRequestHeaderFieldsTooLarge("err").into(); assert_eq!(r.status(), StatusCode::REQUEST_HEADER_FIELDS_TOO_LARGE); let r: Response = ErrorUnavailableForLegalReasons("err").into(); assert_eq!(r.status(), StatusCode::UNAVAILABLE_FOR_LEGAL_REASONS); let r: Response = ErrorInternalServerError("err").into(); assert_eq!(r.status(), StatusCode::INTERNAL_SERVER_ERROR); let r: Response = ErrorNotImplemented("err").into(); assert_eq!(r.status(), StatusCode::NOT_IMPLEMENTED); let r: Response = ErrorBadGateway("err").into(); assert_eq!(r.status(), StatusCode::BAD_GATEWAY); let r: Response = ErrorServiceUnavailable("err").into(); assert_eq!(r.status(), StatusCode::SERVICE_UNAVAILABLE); let r: Response = ErrorGatewayTimeout("err").into(); assert_eq!(r.status(), StatusCode::GATEWAY_TIMEOUT); let r: Response = ErrorHttpVersionNotSupported("err").into(); assert_eq!(r.status(), StatusCode::HTTP_VERSION_NOT_SUPPORTED); let r: Response = ErrorVariantAlsoNegotiates("err").into(); assert_eq!(r.status(), StatusCode::VARIANT_ALSO_NEGOTIATES); let r: Response = ErrorInsufficientStorage("err").into(); assert_eq!(r.status(), StatusCode::INSUFFICIENT_STORAGE); let r: Response = ErrorLoopDetected("err").into(); assert_eq!(r.status(), StatusCode::LOOP_DETECTED); let r: Response = ErrorNotExtended("err").into(); assert_eq!(r.status(), StatusCode::NOT_EXTENDED); let r: Response = ErrorNetworkAuthenticationRequired("err").into(); assert_eq!(r.status(), StatusCode::NETWORK_AUTHENTICATION_REQUIRED); }
rust_cleaned_test_functions.jsonl/18018
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2020 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4096, 54473, 368, 341, 286, 1077, 435, 25, 5949, 284, 4600, 46015, 445, 615, 1827, 18122, 543, 286, 2060, 10714, 10297, 81, 4299, 1507, 53403, 486, 53572, 14454, 626, 286, 1077, 435, 25, 5949, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_get_channel_order() { assert_eq!( get_channel_order(ChannelLayout::MONO), [Channel::FrontCenter] ); assert_eq!( get_channel_order(ChannelLayout::MONO_LFE), [Channel::FrontCenter, Channel::LowFrequency] ); assert_eq!( get_channel_order(ChannelLayout::STEREO), [Channel::FrontLeft, Channel::FrontRight] ); assert_eq!( get_channel_order(ChannelLayout::STEREO_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::LowFrequency ] ); assert_eq!( get_channel_order(ChannelLayout::_3F), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter ] ); assert_eq!( get_channel_order(ChannelLayout::_3F_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::LowFrequency ] ); assert_eq!( get_channel_order(ChannelLayout::_2F1), [Channel::FrontLeft, Channel::FrontRight, Channel::BackCenter] ); assert_eq!( get_channel_order(ChannelLayout::_2F1_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::LowFrequency, Channel::BackCenter ] ); assert_eq!( get_channel_order(ChannelLayout::_3F1), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::BackCenter ] ); assert_eq!( get_channel_order(ChannelLayout::_3F1_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::LowFrequency, Channel::BackCenter ] ); assert_eq!( get_channel_order(ChannelLayout::_2F2), [ Channel::FrontLeft, Channel::FrontRight, Channel::SideLeft, Channel::SideRight ] ); assert_eq!( get_channel_order(ChannelLayout::_2F2_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::LowFrequency, Channel::SideLeft, Channel::SideRight ] ); assert_eq!( get_channel_order(ChannelLayout::QUAD), [ Channel::FrontLeft, Channel::FrontRight, Channel::BackLeft, Channel::BackRight ] ); assert_eq!( get_channel_order(ChannelLayout::QUAD_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::LowFrequency, Channel::BackLeft, Channel::BackRight ] ); assert_eq!( get_channel_order(ChannelLayout::_3F2), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::SideLeft, Channel::SideRight ] ); assert_eq!( get_channel_order(ChannelLayout::_3F2_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::LowFrequency, Channel::SideLeft, Channel::SideRight ] ); assert_eq!( get_channel_order(ChannelLayout::_3F2_BACK), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::BackLeft, Channel::BackRight ] ); assert_eq!( get_channel_order(ChannelLayout::_3F2_LFE_BACK), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::LowFrequency, Channel::BackLeft, Channel::BackRight ] ); assert_eq!( get_channel_order(ChannelLayout::_3F3R_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::LowFrequency, Channel::BackCenter, Channel::SideLeft, Channel::SideRight ] ); assert_eq!( get_channel_order(ChannelLayout::_3F4_LFE), [ Channel::FrontLeft, Channel::FrontRight, Channel::FrontCenter, Channel::LowFrequency, Channel::BackLeft, Channel::BackRight, Channel::SideLeft, Channel::SideRight ] ); }
rust_cleaned_test_functions.jsonl/93753
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2452 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 14571, 7869, 368, 341, 262, 2060, 10714, 33673, 286, 633, 14571, 7869, 68420, 2175, 486, 21344, 46, 1326, 286, 508, 9629, 486, 23395, 9392, 921, 262, 1439, 262, 2060, 10714, 33673, 286, 633,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_rgb_f32() { test_image_sum_f32("gradient-3c-32b-float.tiff", ColorType::RGB(32), 472.8405); }
rust_cleaned_test_functions.jsonl/75201
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 62 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37407, 761, 18, 17, 368, 341, 262, 1273, 4954, 10160, 761, 18, 17, 445, 26394, 12, 18, 66, 12, 18, 17, 65, 2220, 1239, 734, 3092, 497, 3478, 929, 486, 18184, 7, 18, 17, 701, 220, 19, 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
#[test] fn test_join_lines_selection_dot_chain() { check_join_lines_sel( r" fn foo() { join($0type_params.type_params() .filter_map(|it| it.name()) .map(|it| it.text())$0) }", r" fn foo() { join(type_params.type_params().filter_map(|it| it.name()).map(|it| it.text())) }", ); }
rust_cleaned_test_functions.jsonl/22506
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 199 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31017, 18323, 23672, 30941, 30583, 368, 341, 286, 1779, 31017, 18323, 34153, 1006, 310, 435, 698, 8822, 15229, 368, 341, 262, 5138, 699, 15, 1313, 6745, 4852, 6745, 741, 310, 659, 5315, 5376, 2242...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_from_empty_vec() { let v: Vec<i32> = vec![]; let a = PrimitiveArray::from(v); assert_eq!(0, a.len()); }
rust_cleaned_test_functions.jsonl/32612
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 85 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 15124, 13251, 368, 341, 286, 1077, 348, 25, 11312, 21897, 18, 17, 29, 284, 7486, 0, 15078, 286, 1077, 264, 284, 51460, 1857, 486, 1499, 3747, 317, 286, 2060, 10714, 10297, 15, 11, 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
#[test] fn test_exists_query() { let exists_query = Query::build_exists("name").build(); assert_eq!("{\"exists\":{\"field\":\"name\"}}", serde_json::to_string(&exists_query).unwrap()); }
rust_cleaned_test_functions.jsonl/4272
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 112 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9766, 5738, 368, 341, 286, 1077, 6724, 5738, 284, 11361, 486, 5834, 9766, 445, 606, 1827, 5834, 543, 286, 2060, 10714, 88928, 2105, 16304, 92729, 2566, 23488, 606, 2105, 3417, 756, 4293, 61570, 94...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_reflect_over_y_axis() { let quad = BoundedQuadratic::new(1., 2., 1., 1., 1.); let expected_reflection = BoundedQuadratic::new(-2., -1., 1., -1., 1.); assert_eq!(quad.reflect_over_y(), expected_reflection); assert_eq!(quad.reflect_over_y().reflect_over_y(), quad); }
rust_cleaned_test_functions.jsonl/19862
{ "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, 7793, 767, 15431, 4178, 23567, 368, 341, 286, 1077, 27082, 284, 425, 13082, 2183, 88678, 486, 931, 7, 16, 2572, 220, 17, 2572, 220, 16, 2572, 220, 16, 2572, 220, 16, 58957, 286, 1077, 3601, 77...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_slot_in_array_pattern_removed() { test("[,,] = foo();", "foo()"); test("[a,b,,] = foo();", "[a,b] = foo();"); test("[a,[],b,[],[]] = foo();", "[a,[],b] = foo();"); test("[a,{},b,{},{}] = foo();", "[a,{},b] = foo();"); test("function f([,,,]) {}", "function f([]) {}"); test_same("[[], [], [], ...rest] = foo()"); }
rust_cleaned_test_functions.jsonl/478
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 175 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15124, 27563, 1243, 3858, 21260, 68248, 368, 341, 262, 1273, 10937, 10631, 60, 284, 15229, 2129, 497, 330, 7975, 45961, 262, 1273, 10937, 64, 8402, 10631, 60, 284, 15229, 2129, 497, 10545, 64, 840...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_placement_chars() { // Create the default grid for testing let mut grid = Grid::builder() .width(10) .height(5) .build(); grid.set_width_chars(150); grid.set_height_chars(36); assert_eq!(grid.get_placement_chars(1, 2), (1, 7)); assert_eq!(grid.get_placement_chars(2, 3), (16, 14)); }
rust_cleaned_test_functions.jsonl/71776
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 219 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 90203, 37418, 368, 1476, 286, 442, 4230, 279, 1638, 5827, 369, 7497, 198, 286, 1077, 5206, 5827, 284, 10587, 486, 17850, 741, 310, 659, 3098, 7, 16, 15, 340, 310, 659, 2563, 7, 20, 340, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_value_assoc_val() { let v: Value = Value::new_int(114514); assert!(v.is_value()); assert!(!v.is_ref()); assert!(!v.is_container()); assert!(!v.is_null()); }
rust_cleaned_test_functions.jsonl/14903
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 98 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3142, 18891, 6189, 368, 341, 262, 1077, 348, 25, 5162, 284, 5162, 486, 931, 4042, 7, 16, 16, 19, 20, 16, 19, 626, 262, 2060, 10297, 85, 2079, 3142, 1423, 262, 2060, 0, 3471, 85, 2079, 7793, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_digest_based_test_vectors() { test::run( test_file!("../../../../crypto/fipsmodule/ecdsa/ecdsa_verify_tests.txt"), |section, test_case| { assert_eq!(section, ""); let curve_name = test_case.consume_string("Curve"); let public_key = { let mut public_key = Vec::new(); public_key.push(0x04); public_key.extend(&test_case.consume_bytes("X")); public_key.extend(&test_case.consume_bytes("Y")); public_key }; let digest = test_case.consume_bytes("Digest"); let sig = { let mut sig = Vec::new(); sig.extend(&test_case.consume_bytes("R")); sig.extend(&test_case.consume_bytes("S")); sig }; let invalid = test_case.consume_optional_string("Invalid"); let alg = match curve_name.as_str() { "P-256" => &ECDSA_P256_SHA256_FIXED, "P-384" => &ECDSA_P384_SHA384_FIXED, _ => { panic!("Unsupported curve: {}", curve_name); }, }; let digest = super::super::digest_scalar::digest_bytes_scalar( &alg.ops.scalar_ops, &digest[..], ); let actual_result = alg.verify_digest( untrusted::Input::from(&public_key[..]), digest, untrusted::Input::from(&sig[..]), ); assert_eq!(actual_result.is_ok(), invalid.is_none()); Ok(()) }, ); }
rust_cleaned_test_functions.jsonl/116434
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1117 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 52994, 66679, 4452, 49158, 368, 341, 286, 1273, 486, 6108, 1006, 310, 1273, 2458, 17223, 84257, 35772, 6663, 3077, 4352, 73058, 96780, 73058, 96780, 35638, 32509, 3909, 4461, 310, 760, 2809, 11, 127...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_create_not() -> Result<()> { let schema = Schema::new(vec![Field::new("a", DataType::Boolean, true)]); let dfschema = DFSchema::try_from(schema.clone())?; let planner = DefaultPhysicalPlanner::default(); let expr = planner.create_physical_expr( &col("a").not(), &dfschema, &schema, &make_ctx_state(), )?; let expected = expressions::not(expressions::col("a", &schema)?, &schema)?; assert_eq!(format!("{:?}", expr), format!("{:?}", expected)); Ok(()) }
rust_cleaned_test_functions.jsonl/35512
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 287 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8657, 7913, 368, 1464, 5714, 71698, 341, 286, 1077, 10802, 284, 12539, 486, 931, 25592, 20703, 1877, 486, 931, 445, 64, 497, 33172, 486, 6890, 11, 830, 41958, 286, 1077, 25792, 3416, 284, 56383, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
#[test] fn test_close_wait_close() { let mut s = socket_close_wait(); s.close(); assert_eq!(s.state, State::LastAck); sanity!(s, socket_last_ack()); }
rust_cleaned_test_functions.jsonl/1749
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 98 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12704, 18760, 12704, 368, 341, 286, 1077, 5206, 274, 284, 7575, 12704, 18760, 543, 286, 274, 4653, 543, 286, 2060, 10714, 10297, 82, 3467, 11, 3234, 486, 5842, 55559, 317, 286, 46842, 10297, 82, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_lock_request_ephemeral_account_failure() { let inspector = Arc::new(Inspector::new()); request_stream_test( AccountLifetime::Ephemeral, create_clean_pre_auth_manager(), None, Arc::clone(&inspector), |account_handler_proxy| async move { account_handler_proxy.create_account(None).await??; // Get a proxy to the Account interface let (account_client_end, account_server_end) = create_endpoints().unwrap(); let (acp_client_end, _) = create_endpoints().unwrap(); account_handler_proxy.get_account(acp_client_end, account_server_end).await??; let account_proxy = account_client_end.into_proxy().unwrap(); // Send the lock request assert_eq!(account_proxy.lock().await?, Err(ApiError::FailedPrecondition)); // Wait for a potentitially faulty lock request to propagate fasync::Timer::new(LOCK_REQUEST_DURATION.clone().after_now()).await; // The channel is still usable assert!(account_proxy.get_persona_ids().await.is_ok()); // The state remains initialized assert_data_tree!(inspector, root: { account_handler: contains { lifecycle: "initialized", } }); Ok(()) }, ); }
rust_cleaned_test_functions.jsonl/105854
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 752 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9818, 7893, 12476, 29032, 3253, 13500, 43618, 368, 341, 286, 1077, 44725, 284, 19689, 486, 931, 7, 46230, 486, 931, 1423, 286, 1681, 12673, 4452, 1006, 310, 8615, 74579, 486, 36, 59941, 3253, 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...
6
#[test] fn test_transfer() { let mut depot = Depot::with_capacity(6); depot.insert("one", "ONE".to_owned()); let depot = depot.transfer(); assert_eq!(depot.get::<String>("one").unwrap(), &"ONE".to_owned()); }
rust_cleaned_test_functions.jsonl/11376
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 113 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 35403, 368, 341, 286, 1077, 5206, 44619, 284, 46970, 486, 4197, 35603, 7, 21, 317, 286, 44619, 7030, 445, 603, 497, 330, 5225, 3263, 983, 51973, 5231, 286, 1077, 44619, 284, 44619, 49428, 543, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_create_datetime_full_from_int_fail() { assert!(Value::datetime_full_from_int(2012, 1, 0, 3, 30, 30, 3030, "+", 7, 45).is_err()); assert!(Value::datetime_full_from_int(2012, 1, 0, 3, 30, 30, 3030, "q", 7, 45).is_err()); }
rust_cleaned_test_functions.jsonl/86230
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 118 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8657, 28943, 16372, 5673, 4042, 22121, 368, 341, 262, 2060, 10297, 1130, 486, 15450, 16372, 5673, 4042, 7, 17, 15, 16, 17, 11, 220, 16, 11, 220, 15, 11, 220, 18, 11, 220, 18, 15, 11, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_part1() { const DATA: &str = r#" #1 @ 1,3: 4x4 #2 @ 3,1: 4x4 #3 @ 5,5: 2x2 "#; let input = get_input(DATA.as_bytes()).unwrap(); assert_eq!(4, part1(&input)); }
rust_cleaned_test_functions.jsonl/127832
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 128 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10495, 16, 368, 341, 286, 733, 14112, 25, 609, 495, 284, 435, 2, 698, 2, 16, 569, 220, 16, 11, 18, 25, 220, 19, 87, 19, 198, 2, 17, 569, 220, 18, 11, 16, 25, 220, 19, 87, 19, 198, 2,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1