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_executor_no_builtin_found() { let mut cmd: Command = Command::default(); cmd.command_name = String::from("test"); let ctx = ContextManager::init(); let result = executor(cmd, &ctx); assert_eq!(result.is_err(), true); }
rust_cleaned_test_functions.jsonl/65846
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 125 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 81207, 6536, 73829, 21480, 368, 341, 286, 1077, 5206, 5439, 25, 7348, 284, 7348, 486, 2258, 543, 286, 5439, 14143, 1269, 284, 923, 486, 1499, 445, 1944, 3071, 286, 1077, 5635, 284, 9608, 2043, 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_inode_store_child() { let store = build_basic_store(); assert_eq!(store.child(2, Path::new("foo.txt")).unwrap().path, Path::new("/data/foo.txt")); assert!(store.child(2, Path::new("notfound")).is_none()); }
rust_cleaned_test_functions.jsonl/35698
{ "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, 46748, 14809, 17268, 368, 341, 286, 1077, 3553, 284, 1936, 34729, 14809, 543, 286, 2060, 10714, 10297, 4314, 17531, 7, 17, 11, 7933, 486, 931, 445, 7975, 3909, 15197, 15454, 1005, 2343, 11, 7933, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_time() { run_test_parse_time( "01:02:03.456", NaiveTime::from_hms_nano(1, 2, 3, 456_000_000), ); run_test_parse_time("01:02:03", NaiveTime::from_hms(1, 2, 3)); run_test_parse_time("02:03.456", NaiveTime::from_hms_nano(0, 2, 3, 456_000_000)); run_test_parse_time("01:02", NaiveTime::from_hms(1, 2, 0)); fn run_test_parse_time(s: &str, t: NaiveTime) { assert_eq!(strconv::parse_time(s).unwrap(), t); } }
rust_cleaned_test_functions.jsonl/55836
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 252 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 3009, 368, 341, 262, 1598, 4452, 21039, 3009, 1006, 286, 330, 15, 16, 25, 15, 17, 25, 15, 18, 13, 19, 20, 21, 756, 286, 12812, 533, 1462, 486, 1499, 1523, 1011, 1089, 5652, 7, 16, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_i32_bigendian() { let mut storage = vec![0; 1024]; type Field1 = PrimitiveField<i32, BigEndian, 5>; type Field2 = PrimitiveField<i32, BigEndian, 20>; Field1::write(&mut storage, 10i32.pow(8)); Field2::write(&mut storage, -(10i32.pow(7))); assert_eq!( 10i32.pow(8), i32::from_be_bytes((&storage[5..9]).try_into().unwrap()) ); assert_eq!( -(10i32.pow(7)), i32::from_be_bytes((&storage[20..24]).try_into().unwrap()) ); assert_eq!(10i32.pow(8), Field1::read(&storage)); assert_eq!(-(10i32.pow(7)), Field2::read(&storage)); assert_eq!(Some(4), PrimitiveField::<i32, BigEndian, 5>::SIZE); assert_eq!(Some(4), PrimitiveField::<i32, BigEndian, 5>::SIZE); }
rust_cleaned_test_functions.jsonl/35722
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 436 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5318, 18, 17, 36386, 408, 1103, 368, 341, 286, 1077, 5206, 5819, 284, 7486, 20703, 15, 26, 220, 16, 15, 17, 19, 4821, 286, 943, 8601, 16, 284, 51460, 1877, 21897, 18, 17, 11, 6164, 43231, 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_full_block() { let mut polyline = vec![CoordinatePair::from((1.0, 1.0))]; for _ in 0..123 { polyline.push(CoordinatePair::from((5.0, 10.0))); polyline.push(CoordinatePair::from((2.0, 4.0))); } let polylines = vec![polyline]; let sketch = Sketch::new(&polylines); let blocks = sketch.into_blocks(false); assert_eq!(blocks.len(), 1); assert_eq!(blocks[0].len(), 768); }
rust_cleaned_test_functions.jsonl/31621
{ "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, 16372, 7113, 368, 341, 286, 1077, 5206, 92241, 284, 7486, 20703, 28589, 12443, 486, 1499, 1188, 16, 13, 15, 11, 220, 16, 13, 15, 81956, 286, 369, 716, 304, 220, 15, 496, 16, 17, 18, 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_stackbuffer_record() { let mut buffer = StackBuffer::new(HashMap::new()); let stack_trace = StackTrace::new( None, None, None, vec![StackFrame::new( None, Some("test_record".to_string()), None, None, None, None, )], ); // First record buffer.record(stack_trace.clone()).unwrap(); assert_eq!(buffer.data.len(), 1); assert_eq!(buffer.data[&stack_trace], 1); // Second record buffer.record(stack_trace.clone()).unwrap(); assert_eq!(buffer.data.len(), 1); assert_eq!(buffer.data[&stack_trace], 2); }
rust_cleaned_test_functions.jsonl/124453
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 333 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15528, 7573, 14192, 368, 341, 262, 1077, 5206, 4147, 284, 14284, 4095, 486, 931, 7, 18497, 486, 931, 1423, 262, 1077, 5611, 23575, 284, 14284, 6550, 486, 931, 1006, 286, 2240, 345, 286, 2240, 34...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_enum_before_space() { check( r#" enum Foo$0 { A, B, } fn main() { let f: Foo; f = Foo::A; } "#, expect![[r#" Foo Enum FileId(0) 0..26 5..8 FileId(0) 50..53 FileId(0) 63..66 "#]], ); }
rust_cleaned_test_functions.jsonl/60638
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 221 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31054, 23708, 14663, 368, 341, 286, 1779, 1006, 310, 435, 2, 698, 9018, 33428, 3, 15, 341, 262, 362, 345, 262, 425, 345, 532, 8822, 1887, 368, 341, 262, 1077, 282, 25, 33428, 280, 262, 282, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_rsna_wpa3_psk_fails() { let bss = fake_bss!(Wpa3); let credential = fidl_sme::Credential::Psk(vec![0xAA; 32]); get_wpa3_rsna(&fake_device_info(CLIENT_ADDR), &credential, &bss) .expect_err("expected WPA3 RSNA failure with PSK"); }
rust_cleaned_test_functions.jsonl/6073
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 157 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 3062, 47115, 3376, 1670, 6595, 18, 620, 4886, 761, 6209, 368, 341, 286, 1077, 293, 778, 284, 12418, 880, 778, 10297, 54, 6595, 18, 317, 286, 1077, 40207, 284, 32104, 75, 643, 2660, 486, 48265, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_split_char_iterator() { let data = "\nMäry häd ä little lämb\nLittle lämb\n"; let split: Vec<&str> = data.split(' ').collect(); assert_eq!( split, ["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]); let mut rsplit: Vec<&str> = data.split(' ').rev().collect(); rsplit.reverse(); assert_eq!(rsplit, ["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]); let split: Vec<&str> = data.split(|c: char| c == ' ').collect(); assert_eq!( split, ["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]); let mut rsplit: Vec<&str> = data.split(|c: char| c == ' ').rev().collect(); rsplit.reverse(); assert_eq!(rsplit, ["\nMäry", "häd", "ä", "little", "lämb\nLittle", "lämb\n"]); // Unicode let split: = data.split('ä').collect(); assert_eq!( split, ["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]); let mut rsplit: Vec<&str> = data.split('ä').rev().collect(); rsplit.reverse(); assert_eq!(rsplit, ["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]); let split: Vec<&str> = data.split(|c: char| c == 'ä').collect(); assert_eq!( split, ["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]); let mut rsplit: Vec<&str> = data.split(|c: char| c == 'ä').rev().collect(); rsplit.reverse(); assert_eq!(rsplit, ["\nM", "ry h", "d ", " little l", "mb\nLittle l", "mb\n"]); }
rust_cleaned_test_functions.jsonl/17657
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 654 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17052, 9232, 13491, 368, 341, 262, 1077, 821, 284, 2917, 77, 44, 2305, 884, 305, 30875, 12709, 2632, 30005, 3096, 1699, 38103, 30005, 3096, 1699, 3302, 262, 1077, 6718, 25, 11312, 52244, 495, 29, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_binop_and() { let checker = MutationsChecker::new("tests/integration.rs").unwrap(); let ands = &[ "REPLACE_WITH_FALSE", "REPLACE_WITH_TRUE", "REMOVE_RIGHT", "NEGATE_LEFT", "NEGATE_RIGHT", ]; assert!(checker.has_multiple(ands, "21:15: 21:28")); }
rust_cleaned_test_functions.jsonl/117860
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 174 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21816, 453, 8378, 368, 341, 262, 1077, 40915, 284, 31228, 804, 35188, 486, 931, 445, 23841, 31114, 17376, 25638, 1827, 15454, 1428, 262, 1077, 323, 82, 284, 609, 9640, 286, 330, 787, 35875, 23929,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_t03() { // Index selection let (r, sioe) = do_execute!(&["-s", "\"primes\".[0]"], super::IN_DAT_03); assert_eq!(buff!(sioe, serr), ""); assert_eq!(buff!(sioe, sout), "7\n",); assert_eq!(r.is_ok(), true); let (r, sioe) = do_execute!(&["-s", "\"primes\"[0]"], super::IN_DAT_03); assert_eq!(buff!(sioe, serr), ""); assert_eq!(buff!(sioe, sout), "7\n",); assert_eq!(r.is_ok(), true); let (r, sioe) = do_execute!(&["-s", "\"primes\"[2,0]"], super::IN_DAT_03); assert_eq!(buff!(sioe, serr), ""); assert_eq!(buff!(sioe, sout), "[13,7]\n",); assert_eq!(r.is_ok(), true); }
rust_cleaned_test_functions.jsonl/118358
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 414 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 528, 15, 18, 368, 341, 286, 442, 8008, 6589, 198, 286, 1077, 320, 81, 11, 274, 815, 68, 8, 284, 653, 44329, 0, 2099, 1183, 12, 82, 497, 15898, 649, 1733, 2105, 7873, 15, 60, 7914, 2256, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_zip() { let mut coll1 = NonEmptyVec::new('x'); let other1 = vec!['y', 'z', 'u', 'v', 'w']; coll1.extend(other1.into_iter()); let mut coll2 = NonEmptyVec::new(9); let other2 = vec![0, 14, 9, 3, 16]; coll2.extend(other2.into_iter()); let coll_ = coll1.zip(coll2); let mut iter = coll_.into_iter(); assert_eq!(iter.next(), Some(('x', 9))); assert_eq!(iter.next(), Some(('y', 0))); assert_eq!(iter.next(), Some(('z', 14))); assert_eq!(iter.next(), Some(('u', 9))); assert_eq!(iter.next(), Some(('v', 3))); assert_eq!(iter.next(), Some(('w', 16))); assert_eq!(iter.next(), None); }
rust_cleaned_test_functions.jsonl/67660
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 370 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 42131, 368, 341, 286, 1077, 5206, 4530, 16, 284, 11581, 3522, 10050, 486, 931, 492, 87, 1157, 286, 1077, 1008, 16, 284, 7486, 0, 677, 88, 516, 364, 89, 516, 364, 84, 516, 364, 85, 516, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_vcx_credential_get_state() { settings::set_defaults(); settings::set_config_value(settings::CONFIG_ENABLE_TEST_MODE,"true"); let handle = credential::from_string(DEFAULT_SERIALIZED_CREDENTIAL).unwrap(); assert!(handle > 0); let rc = vcx_credential_get_state(0,handle,Some(get_state_cb)); assert_eq!(rc, error::SUCCESS.code_num); thread::sleep(Duration::from_millis(300)); }
rust_cleaned_test_functions.jsonl/7550
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 206 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2273, 25844, 666, 30320, 3062, 4387, 368, 341, 286, 5003, 486, 746, 42290, 543, 286, 5003, 486, 746, 5332, 3142, 23369, 486, 24652, 14379, 11641, 8414, 1335, 1866, 797, 286, 1077, 3705, 284, 40207...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_macro_expand_will_stop_1() { do_resolve( r#" macro_rules! foo { ($($ty:ty)*) => { foo!($($ty)*); } } foo!(KABOOM); "#, ); do_resolve( r#" macro_rules! foo { ($($ty:ty)*) => { foo!(() $($ty)*); } } foo!(KABOOM); "#, ); }
rust_cleaned_test_functions.jsonl/7330
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 196 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 58810, 67875, 1670, 483, 19039, 62, 16, 368, 341, 286, 653, 77291, 1006, 310, 435, 2, 698, 32606, 21407, 0, 15229, 341, 262, 1711, 699, 1881, 25, 1881, 8, 3764, 589, 314, 15229, 0, 699, 699, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_cie_incomplete_length_32() { let kind = debug_frame_le(); let section = Section::with_endian(kind.endian()).L16(5); assert_parse_cie( kind, section, 8, Err(Error::UnexpectedEof(ReaderOffsetId(0))), ); }
rust_cleaned_test_functions.jsonl/9294
{ "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, 21039, 666, 645, 1243, 14737, 5118, 62, 18, 17, 368, 341, 286, 1077, 3093, 284, 7390, 8929, 11751, 543, 286, 1077, 3772, 284, 11113, 486, 4197, 87193, 62697, 5073, 1103, 6011, 43, 16, 21, 7, 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_preprocess_large() { let (display, exec) = preprocess(r#"import "array" array.from( rows: [ {_measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:30Z, _value: false}, {_measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:40Z, _value: true}, {_measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:50Z, _value: false}, {_measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:00Z, _value: false}, {_measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:10Z, _value: true}, {_measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:20Z, _value: true}, ], < ) > |> map(fn: (r) => ({r with _value: "b"}))"#).unwrap(); let want_display = expect![[r#" ```flux import "array" array.from( rows: [ { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:30Z, _value: false, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:40Z, _value: true, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:50Z, _value: false, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:00Z, _value: false, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:10Z, _value: true, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:20Z, _value: true, }, ], ) |> map(fn: (r) => ({r with _value: "b"})) ```"#]]; want_display.assert_eq(display.as_str()); let want_exec = expect![[r#" import "array" array.from( rows: [ { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:30Z, _value: false, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:40Z, _value: true, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:13:50Z, _value: false, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:00Z, _value: false, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:10Z, _value: true, }, { _measurement: "m0", _field: "f0", t0: "tagvalue", _time: 2018-12-19T22:14:20Z, _value: true, }, ], ) |> yield(name: "input") |> map(fn: (r) => ({r with _value: "b"})) |> yield(name: "output")"#]]; want_exec.assert_eq(exec.as_str()); }
rust_cleaned_test_functions.jsonl/30695
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 3295 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10442, 4630, 45228, 368, 341, 286, 1077, 320, 5493, 11, 3883, 8, 284, 53465, 2601, 55543, 474, 330, 1653, 1837, 1653, 6387, 1006, 262, 6978, 25, 2278, 286, 48617, 81425, 25, 330, 76, 15, 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_diagonal() { let mut mux = Mux::new(); let node1 = mux .add_right_of(TextArea::new(), mux.root().build().unwrap()) .expect("first failed"); let mut siv = Cursive::dummy(); let node2 = mux.add_right_of(TextArea::new(), node1).unwrap(); let _ = mux.add_below(TextArea::new(), node2).unwrap(); let upper_right_corner = mux.add_right_of(TextArea::new(), node2).unwrap(); let bottom_left_corner = mux.add_below(TextArea::new(), node1).unwrap(); let bottom_left_middle = mux .add_right_of(TextArea::new(), bottom_left_corner) .unwrap(); let id = NamedView::new("mux".to_string(), mux); siv.add_fullscreen_layer(id); siv.run(); let mut mux: cursive_core::views::ViewRef<Mux> = siv.find_name("mux").unwrap(); println!("Moving left..."); mux.on_event(Event::Alt(Key::Left)); assert_eq!(mux.focus(), bottom_left_corner); println!("Moving right..."); mux.on_event(Event::Alt(Key::Right)); assert_eq!(mux.focus(), bottom_left_middle); println!("Moving up..."); mux.on_event(Event::Alt(Key::Up)); assert_eq!(mux.focus(), node1); println!("Moving right..."); mux.on_event(Event::Alt(Key::Right)); assert_eq!(mux.focus(), node2); println!("Moving right..."); mux.on_event(Event::Alt(Key::Right)); assert_eq!(mux.focus(), upper_right_corner); }
rust_cleaned_test_functions.jsonl/64539
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 600 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 29477, 23450, 368, 341, 262, 1077, 5206, 59807, 284, 386, 2200, 486, 931, 543, 262, 1077, 2436, 16, 284, 59807, 198, 286, 659, 718, 10539, 3575, 34082, 8726, 486, 931, 1507, 59807, 12576, 1005, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_duplicate_rollback_then_vote_on_other_duplicate_success() { let SelectVoteAndResetForkResult { vote_bank, reset_bank, heaviest_fork_failures, } = run_test_duplicate_rollback_then_vote_on_other_duplicate(3); assert_matches!( vote_bank .map(|(bank, switch_decision)| (bank.slot(), switch_decision)) .unwrap(), (5, SwitchForkDecision::SwitchProof(_)) ); assert_eq!(reset_bank.unwrap().slot(), 5); assert!(heaviest_fork_failures.is_empty()); }
rust_cleaned_test_functions.jsonl/25831
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 323 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 70434, 62, 33559, 68367, 54360, 4470, 30456, 70434, 18632, 368, 341, 286, 1077, 8427, 41412, 3036, 14828, 37, 669, 2077, 341, 310, 6910, 35733, 345, 310, 7585, 35733, 345, 310, 566, 98362, 761, 66...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_insert_string() { let mut cl = Cmdline::new(13); assert_eq!(cl.as_str(), ""); assert!(cl.insert_str("noapic").is_ok()); assert_eq!(cl.as_str(), "noapic"); assert!(cl.insert_str("nopci").is_ok()); assert_eq!(cl.as_str(), "noapic nopci"); }
rust_cleaned_test_functions.jsonl/29217
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 166 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 17678, 3904, 368, 341, 286, 1077, 5206, 1185, 284, 40210, 1056, 486, 931, 7, 16, 18, 317, 286, 2060, 10714, 10297, 564, 5357, 2895, 1507, 14498, 286, 2060, 10297, 564, 7030, 2895, 445, 2152, 391...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_primitive_array_sum_with_nulls() { let a = Int32Array::from(&[None, Some(2), Some(3), None, Some(5)]); assert_eq!(10, sum_primitive(&a).unwrap()); }
rust_cleaned_test_functions.jsonl/58849
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 92 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 84087, 3858, 10160, 6615, 15162, 82, 368, 341, 286, 1077, 264, 284, 1333, 18, 17, 1857, 486, 1499, 2099, 58, 4064, 11, 4329, 7, 17, 701, 4329, 7, 18, 701, 2240, 11, 4329, 7, 20, 41958, 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
#[test] fn test_multi_tombstone() { let engine = TestEngineBuilder::new().build().unwrap(); must_prewrite_put(&engine, b"foo", b"bar", b"foo", 10); must_prewrite_put(&engine, b"foo1", b"bar1", b"foo", 10); must_prewrite_put(&engine, b"foo2", b"bar2", b"foo", 10); must_prewrite_put(&engine, b"foo3", b"bar3", b"foo", 10); must_commit(&engine, b"foo", 10, 20); must_commit(&engine, b"foo1", 10, 20); must_commit(&engine, b"foo2", 10, 20); must_commit(&engine, b"foo3", 10, 20); must_prewrite_delete(&engine, b"foo1", b"foo1", 30); must_prewrite_delete(&engine, b"foo2", b"foo1", 30); must_commit(&engine, b"foo1", 30, 40); must_commit(&engine, b"foo2", 30, 40); must_gc(&engine, b"foo", 50); must_gc(&engine, b"foo1", 50); must_gc(&engine, b"foo2", 50); must_gc(&engine, b"foo3", 50); let mut getter = new_multi_point_getter(&engine, TimeStamp::max()); let perf_statistics = PerfStatisticsInstant::new(); must_get_value(&mut getter, b"foo", b"bar"); assert_eq!(perf_statistics.delta().0.internal_delete_skipped_count, 0); let perf_statistics = PerfStatisticsInstant::new(); must_get_none(&mut getter, b"foo1"); assert_eq!(perf_statistics.delta().0.internal_delete_skipped_count, 2); let perf_statistics = PerfStatisticsInstant::new(); must_get_none(&mut getter, b"foo2"); assert_eq!(perf_statistics.delta().0.internal_delete_skipped_count, 2); let perf_statistics = PerfStatisticsInstant::new(); must_get_value(&mut getter, b"foo3", b"bar3"); assert_eq!(perf_statistics.delta().0.internal_delete_skipped_count, 0); }
rust_cleaned_test_functions.jsonl/45605
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 816 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 25133, 528, 2855, 10812, 368, 341, 286, 1077, 4712, 284, 3393, 4571, 3297, 486, 931, 1005, 5834, 1005, 15454, 1428, 286, 1969, 620, 52473, 15557, 2099, 8512, 11, 293, 1, 7975, 497, 293, 1, 2257,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_use_items_right() { // No space after the '}' check_join_lines( r" use ra_syntax::{ <|> TextUnit, TextRange };", r" use ra_syntax::{ <|> TextUnit, TextRange};", ); }
rust_cleaned_test_functions.jsonl/109161
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 142 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31017, 18323, 15951, 12134, 10539, 368, 341, 286, 442, 2308, 3550, 1283, 279, 40074, 1248, 286, 1779, 31017, 18323, 1006, 310, 435, 698, 810, 15122, 78894, 74843, 27, 91, 29, 262, 2918, 4562, 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_padding() -> Result<(), Error> { let tt = vec![ (4, 4), (2, 4), (5, 8), (8, 8), (11, 12), (1, 4), (3, 4), (6, 8), (7, 8), (0, 0), (40, 40), ]; for (i, o) in tt { let got = nearest_padded_value_length(i); assert_eq!(got, o, "padd({}) {} (got) != {} (expected)", i, got, o,); } Ok(()) }
rust_cleaned_test_functions.jsonl/108723
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 299 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 40726, 368, 1464, 5714, 68843, 4600, 29, 341, 262, 1077, 17853, 284, 7486, 90515, 286, 320, 19, 11, 220, 19, 701, 5872, 286, 320, 17, 11, 220, 19, 701, 5872, 286, 320, 20, 11, 220, 23, 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...
2
#[test] fn test_service_node_parsing() { let node = Node { id: "node".to_string(), node: "node".to_string(), address: "1.1.1.1".to_string(), }; let service = Service { id: "node".to_string(), service: "node".to_string(), address: "2.2.2.2".to_string(), port: 32, }; let empty_service = Service { id: "".to_string(), service: "".to_string(), address: "".to_string(), port: 32, }; let sn = ServiceNode { node: node.clone(), service: service.clone(), }; let (host, port) = Consul::parse_host_port_from_service_node_response(sn); assert_eq!(service.port, port); assert_eq!(service.address, host); let sn = ServiceNode { node: node.clone(), service: empty_service, }; let (host, port) = Consul::parse_host_port_from_service_node_response(sn); assert_eq!(service.port, port); assert_eq!(node.address, host); }
rust_cleaned_test_functions.jsonl/73807
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 588 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12267, 5084, 620, 28598, 368, 341, 286, 1077, 2436, 284, 6018, 341, 310, 877, 25, 330, 3509, 3263, 983, 3904, 3148, 310, 2436, 25, 330, 3509, 3263, 983, 3904, 3148, 310, 2621, 25, 330, 16, 13,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_bool() { [(b"\xf4", false), (b"\xf5", true)] .iter() .for_each(|(bytes, expected)| { let deserializer = Deserializer::new(); let mut serializer = Serializer::new(); let (value, _) = deserializer.take_value(*bytes).unwrap(); match value { Value::Bool(got) => { assert_eq!(got, *expected); } _ => panic!("wrong type, expected bool"), }; serializer.write_bool(*expected); let x = serializer.as_ref(); assert_eq!(x, *bytes); }); }
rust_cleaned_test_functions.jsonl/62584
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 350 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22159, 368, 341, 262, 17826, 65, 11934, 5848, 19, 497, 895, 701, 320, 65, 11934, 5848, 20, 497, 830, 5563, 286, 659, 2015, 741, 286, 659, 1958, 32046, 22428, 7, 9651, 11, 3601, 17935, 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_decode_glyf() { let buffer = read_fixture("tests/fonts/opentype/test-font.ttf"); let file = ReadScope::new(&buffer).read::<OpenTypeFile>().unwrap(); let glyph = Glyph { number_of_contours: 1, bounding_box: BoundingBox { x_min: 1761, y_min: 565, x_max: 2007, y_max: 1032, }, data: GlyphData::Simple(SimpleGlyph { end_pts_of_contours: vec![2], instructions: vec![], flags: vec![ SimpleGlyphFlag::from_bits_truncate(1), SimpleGlyphFlag::from_bits_truncate(51), SimpleGlyphFlag::from_bits_truncate(3), ], coordinates: vec![Point(1761, 565), Point(2007, 565), Point(1884, 1032)], }), }; let expected = GlyfTable { records: vec![ GlyfRecord::Empty, GlyfRecord::Empty, GlyfRecord::Parsed(glyph), ], }; match file.font { OpenTypeFont::Single(ttf) => { let head = ttf .read_table(&file.scope, tag::HEAD) .expect("unable to read head table") .expect("head table not found") .read::<HeadTable>() .expect("error parsing head table"); let maxp = ttf .read_table(&file.scope, tag::MAXP) .expect("unable to read maxp table") .expect("maxp table not found") .read::<MaxpTable>() .expect("error parsing maxp table"); let loca = ttf .read_table(&file.scope, tag::LOCA) .expect("unable to read loca table") .expect("loca table not found") .read_dep::<LocaTable>((usize::from(maxp.num_glyphs), head.index_to_loc_format)) .expect("error parsing loca table"); let mut glyf = ttf .read_table(&file.scope, tag::GLYF) .expect("unable to read glyf table") .expect("glyf table not found") .read_dep::<GlyfTable>(&loca) .expect("error parsing glyf table"); glyf.records.iter_mut().for_each(|rec| rec.parse().unwrap()); assert_eq!(glyf, expected); } OpenTypeFont::Collection(_) => unreachable!(), } }
rust_cleaned_test_functions.jsonl/6593
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1309 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15227, 1889, 398, 69, 368, 341, 262, 1077, 4147, 284, 1349, 74409, 445, 23841, 60667, 52000, 306, 499, 12697, 30671, 45192, 797, 262, 1077, 1034, 284, 4457, 10803, 486, 931, 2099, 7573, 568, 878, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_metadata() { let mut file = Options::new() .max_size("Hello, fmmap!".len() as u64) .create_mmap_file_mut(get_random_filename()) .unwrap(); file.set_remove_on_drop(true); file.write_all("Hello, fmmap!".as_bytes(), 0).unwrap(); metadata_test!(file.metadata().unwrap()); }
rust_cleaned_test_functions.jsonl/90384
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 405 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22220, 368, 341, 286, 1077, 5206, 1034, 284, 14566, 486, 931, 741, 310, 659, 2810, 2368, 445, 9707, 11, 31121, 2186, 92993, 2892, 368, 438, 575, 21, 19, 340, 310, 659, 3182, 717, 2186, 2458, 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_integer_number() { let scanner = Scanner::new(); let source = "123".to_owned(); assert_eq!( Ok(vec![ Token { t: TokenType::Number, line: 1, lexeme: "123".to_owned(), literal: Some(Literal::Number(123.0)), }, Token { t: TokenType::Eof, line: 1, lexeme: String::new(), literal: None, } ]), scanner.scan_tokens(source) ); }
rust_cleaned_test_functions.jsonl/92091
{ "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, 31725, 5500, 368, 341, 286, 1077, 20775, 284, 17170, 486, 931, 543, 286, 1077, 2530, 284, 330, 16, 17, 18, 3263, 983, 51973, 543, 286, 2060, 10714, 33673, 310, 7622, 25592, 90515, 394, 9660, 341...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_function_doc_missing_description() { let src = " // Package foo does a thing. package foo // f is a function. f = (x) => x "; let loc = Locator::new(&src[..]); assert_docs_full( src, PackageDoc { path: "path".to_string(), name: "foo".to_string(), headline: "Package foo does a thing.".to_string(), description: None, members: map![ "f" => Doc::Function(Box::new(FunctionDoc{ name: "f".to_string(), headline: "f is a function.".to_string(), description: None, parameters: vec![], flux_type: "(x:A) => A".to_string(), is_option: false, source_location: loc.get(6, 9, 6, 21), examples: vec![], metadata: None, })), ], examples: Vec::new(), metadata: None, }, vec![Diagnostic { msg: "missing documentation for parameter \"x\"".to_string(), loc: loc.get(6, 9, 6, 21), }], ); }
rust_cleaned_test_functions.jsonl/9996
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 816 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9174, 18869, 40447, 11448, 368, 341, 286, 1077, 2286, 284, 6228, 286, 442, 16906, 15229, 1558, 264, 3166, 624, 286, 6328, 15229, 271, 286, 442, 282, 374, 264, 729, 624, 286, 282, 284, 320, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_stack() { let mut stack = Stack::new(); assert!(stack.is_empty()); assert!(stack.len() == 0); assert!(!stack.last_is_index()); stack.push_index(0); stack.bump_index(); assert!(stack.len() == 1); assert!(stack.is_equal_to(&[StackElement::Index(1)])); assert!(stack.starts_with(&[StackElement::Index(1)])); assert!(stack.ends_with(&[StackElement::Index(1)])); assert!(stack.last_is_index()); assert!(stack.get(0) == StackElement::Index(1)); stack.push_key("foo".to_string()); assert!(stack.len() == 2); assert!(stack.is_equal_to(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.starts_with(&[StackElement::Index(1)])); assert!(stack.ends_with(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.ends_with(&[StackElement::Key("foo")])); assert!(!stack.last_is_index()); assert!(stack.get(0) == StackElement::Index(1)); assert!(stack.get(1) == StackElement::Key("foo")); stack.push_key("bar".to_string()); assert!(stack.len() == 3); assert!(stack.is_equal_to(&[StackElement::Index(1), StackElement::Key("foo"), StackElement::Key("bar")])); assert!(stack.starts_with(&[StackElement::Index(1)])); assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo"), StackElement::Key("bar")])); assert!(stack.ends_with(&[StackElement::Key("bar")])); assert!(stack.ends_with(&[StackElement::Key("foo"), StackElement::Key("bar")])); assert!(stack.ends_with(&[StackElement::Index(1), StackElement::Key("foo"), StackElement::Key("bar")])); assert!(!stack.last_is_index()); assert!(stack.get(0) == StackElement::Index(1)); assert!(stack.get(1) == StackElement::Key("foo")); assert!(stack.get(2) == StackElement::Key("bar")); stack.pop(); assert!(stack.len() == 2); assert!(stack.is_equal_to(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.starts_with(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.starts_with(&[StackElement::Index(1)])); assert!(stack.ends_with(&[StackElement::Index(1), StackElement::Key("foo")])); assert!(stack.ends_with(&[StackElement::Key("foo")])); assert!(!stack.last_is_index()); assert!(stack.get(0) == StackElement::Index(1)); assert!(stack.get(1) == StackElement::Key("foo")); }
rust_cleaned_test_functions.jsonl/67019
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1397 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15528, 368, 341, 286, 1077, 5206, 5611, 284, 14284, 486, 931, 1428, 286, 2060, 10297, 7693, 2079, 15124, 1423, 286, 2060, 10297, 7693, 19406, 368, 621, 220, 15, 317, 286, 2060, 0, 3471, 7693, 91...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_crypto_onetimeauth_poly1305_bytes() { assert!(unsafe { crypto_onetimeauth_poly1305_bytes() as usize } == crypto_onetimeauth_poly1305_BYTES) }
rust_cleaned_test_functions.jsonl/42348
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 83 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 78298, 4470, 4107, 3242, 36133, 16, 18, 15, 20, 12524, 368, 341, 262, 2060, 10297, 38157, 314, 19028, 4470, 4107, 3242, 36133, 16, 18, 15, 20, 12524, 368, 438, 22301, 335, 47761, 310, 19028, 447...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_update_guild_welcome_screen() { let route = Route::UpdateGuildWelcomeScreen { guild_id: GUILD_ID }; assert_eq!( route.to_string(), format!("guilds/{guild_id}/welcome-screen", guild_id = GUILD_ID) ); }
rust_cleaned_test_functions.jsonl/119940
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 138 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8882, 1889, 1498, 1670, 5717, 17649, 368, 341, 286, 1077, 6021, 284, 9572, 486, 4289, 72574, 13936, 7971, 314, 26411, 842, 25, 479, 18023, 3450, 2605, 286, 2060, 10714, 33673, 310, 6021, 2389, 390...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_option_while_some() { let mut i = 0; Some(10).while_some(|j| { i += 1; if (j > 0) { Some(j-1) } else { None } }); assert_eq!(i, 11); }
rust_cleaned_test_functions.jsonl/62870
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 188 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9672, 86069, 61855, 368, 341, 286, 1077, 5206, 600, 284, 220, 15, 280, 286, 4329, 7, 16, 15, 568, 3472, 61855, 22428, 73, 91, 341, 310, 600, 1421, 220, 16, 280, 310, 421, 320, 73, 861, 220, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_personal_top_three_only_one_score() { let high_scores = HighScores::new(&[40]); assert_eq!(high_scores.personal_top_three(), vec![40]); }
rust_cleaned_test_functions.jsonl/78256
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 73 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 78035, 10426, 50016, 18410, 11667, 10405, 368, 341, 262, 1077, 1550, 27198, 284, 5124, 55936, 486, 931, 2099, 58, 19, 15, 2558, 262, 2060, 10714, 10297, 11892, 27198, 30870, 278, 10426, 50016, 1507,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_basic_flow() { let (mut smp, peers) = SharedMempoolNetwork::bootstrap_validator_network_smp(2); let (peer_a, peer_b) = (peers.get(0).unwrap(), peers.get(1).unwrap()); smp.add_txns( &peer_a, vec![ TestTransaction::new(1, 0, 1), TestTransaction::new(1, 1, 1), TestTransaction::new(1, 2, 1), ], ); // A discovers new peer B smp.send_connection_event( &peer_a, ConnectionStatusNotification::NewPeer(*peer_b, Multiaddr::empty()), ); for seq in 0..3 { // A attempts to send message let transaction = smp.deliver_message(&peer_a).0; assert_eq!(transaction.sequence_number(), seq); } }
rust_cleaned_test_functions.jsonl/64442
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 351 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 34729, 27441, 368, 341, 262, 1077, 320, 6984, 274, 1307, 11, 25029, 8, 284, 16990, 44, 3262, 1749, 12320, 486, 6281, 64959, 20966, 643, 1307, 7, 17, 317, 262, 1077, 320, 16537, 4306, 11, 14397, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_simple_latin() { let stop_words = Set::default(); let analyzer = Analyzer::new(AnalyzerConfig::default_with_stopwords(&stop_words)); let orig = "The quick (\"brown\") fox can't jump 32.3 feet, right? Brr, it's 29.3°F!"; let analyzed = analyzer.analyze(orig); let mut analyzed = analyzed.tokens(); assert_eq!("the", analyzed.next().unwrap().text()); assert_eq!(" ", analyzed.next().unwrap().text()); assert_eq!("quick", analyzed.next().unwrap().text()); assert_eq!(" (\"", analyzed.next().unwrap().text()); assert_eq!("brown", analyzed.next().unwrap().text()); }
rust_cleaned_test_functions.jsonl/98413
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 273 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30015, 907, 14768, 368, 341, 286, 1077, 2936, 18981, 284, 2573, 486, 2258, 543, 286, 1077, 54660, 284, 78705, 486, 931, 7, 54911, 2648, 486, 2258, 6615, 19039, 5761, 2099, 9495, 18981, 3237, 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_elt_not_deserialize() { assert_de_tokens( &ContainsNotDeserialize { a: NotDeserializeStruct(123), b: NotDeserializeStruct(123), c: NotDeserializeStruct(123), e: NotDeserializeEnum::Trouble, }, &[Token::Struct { name: "ContainsNotDeserialize", len: 3 }, Token::StructEnd], ); }
rust_cleaned_test_functions.jsonl/58608
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 196 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 91034, 7913, 15768, 9050, 368, 341, 262, 2060, 2259, 28838, 1006, 286, 609, 23805, 2623, 64465, 341, 1797, 264, 25, 2806, 64465, 9422, 7, 16, 17, 18, 1326, 1797, 293, 25, 2806, 64465, 9422, 7, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_step() { assert_eq!((0u32..5).step_by(4).collect::<Vec<u32>>(), vec![0, 4]); assert_eq!((0u32..4).step_by(4).collect::<Vec<u32>>(), vec![0]); assert_eq!((4u32..4).step_by(4).collect::<Vec<u32>>(), vec![]); }
rust_cleaned_test_functions.jsonl/47926
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 143 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11946, 368, 341, 286, 2060, 10714, 0, 1188, 15, 84, 18, 17, 496, 20, 568, 9520, 3710, 7, 19, 568, 17384, 27638, 10050, 34837, 18, 17, 2452, 1507, 7486, 20703, 15, 11, 220, 19, 2558, 286, 206...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_team() { let value = Team { icon: Some(image_hash::ICON), id: Id::new(1), members: Vec::new(), name: "team name".into(), owner_user_id: Id::new(2), }; serde_test::assert_tokens( &value, &[ Token::Struct { name: "Team", len: 5, }, Token::Str("icon"), Token::Some, Token::Str(image_hash::ICON_INPUT), Token::Str("id"), Token::NewtypeStruct { name: "Id" }, Token::Str("1"), Token::Str("members"), Token::Seq { len: Some(0) }, Token::SeqEnd, Token::Str("name"), Token::Str("team name"), Token::Str("owner_user_id"), Token::NewtypeStruct { name: "Id" }, Token::Str("2"), Token::StructEnd, ], ); }
rust_cleaned_test_functions.jsonl/33851
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 663 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 26532, 368, 341, 286, 1077, 897, 284, 7909, 341, 310, 4603, 25, 4329, 10075, 8950, 486, 42828, 1326, 310, 877, 25, 5223, 486, 931, 7, 16, 1326, 310, 3613, 25, 11312, 486, 931, 3148, 310, 829, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_lambda_lift_simple_happy() { dangerously_reset_gensym_count(); let exp = parse( &lexpr::from_str( r#"(unpack (temp0 (pack (make-tuple (lambda ((env1 : (record)) (x : int)) : int (+ x 3)) (make-record)) (record) (exists T2 (tuple (-> T2 int int) T2))) T3) ((tuple-ref temp0 0) (tuple-ref temp0 1) 5))"#, ) .unwrap(), ) .unwrap(); let expected_fn = parse( &lexpr::from_str( r#"(lambda ((env1 : (record)) (x : int)) : int (+ x 3))"#, ) .unwrap(), ) .unwrap(); let expected_exp = parse( &lexpr::from_str( r#"(unpack (temp0 (pack (make-tuple func0 (make-record)) (record) (exists T2 (tuple (-> T2 int int) T2))) T3) ((tuple-ref temp0 0) (tuple-ref temp0 1) 5))"#, ) .unwrap(), ) .unwrap(); let expected_prog = Prog { fns: vector![(String::from("func0"), expected_fn)], exp: expected_exp, }; let prog = lambda_lift(&exp).unwrap(); assert_eq!(prog.fns, expected_prog.fns); assert_eq!(prog.exp, expected_prog.exp); assert_eq!(type_check_prog(&prog).is_err(), false); }
rust_cleaned_test_functions.jsonl/98586
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 825 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 51884, 87004, 30015, 1523, 11144, 368, 341, 262, 58494, 18983, 1889, 724, 1600, 3180, 1428, 262, 1077, 1343, 284, 4715, 1006, 286, 609, 2571, 649, 486, 1499, 2895, 1006, 310, 435, 2, 29209, 80774,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_adding_validated_oks() { let r1: Result<String, String> = Result::Ok(String::from("hello")); let r2: Result<i32, String> = Result::Ok(1); let r3: Result<i32, String> = Result::Ok(3); let v1 = r1.into_validated(); let v2 = r2.into_validated(); let v3 = r3.into_validated(); let comb = v1 + v2 + v3; assert_eq!(comb, Validated::Ok(hlist!(String::from("hello"), 1, 3))) }
rust_cleaned_test_functions.jsonl/41655
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 223 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2891, 287, 8337, 657, 19817, 82, 368, 341, 286, 1077, 435, 16, 25, 5714, 3464, 11, 923, 29, 284, 5714, 486, 11578, 2242, 486, 1499, 445, 14990, 4010, 286, 1077, 435, 17, 25, 5714, 21897, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_distance() { assert_eq!(distance(&String::from("a"), &String::from("b")), 1); assert_eq!(distance(&String::from("ab"), &String::from("ac")), 1); assert_eq!(distance(&String::from("ac"), &String::from("bc")), 1); assert_eq!(distance(&String::from("abc"), &String::from("axc")), 1); assert_eq!( distance( &String::from("xabxcdxxefxgx"), &String::from("1ab2cd34ef5g6") ), 6 ); assert_eq!( distance(&String::from("xabxcdxxefxgx"), &String::from("abcdefg")), 6 ); assert_eq!( distance(&String::from("javawasneat"), &String::from("scalaisgreat")), 7 ); assert_eq!( distance(&String::from("example"), &String::from("samples")), 3 ); assert_eq!( distance(&String::from("forward"), &String::from("drawrof")), 6 ); assert_eq!( distance(&String::from("sturgeon"), &String::from("urgently")), 6 ); assert_eq!( distance(&String::from("levenshtein"), &String::from("frankenstein")), 6 ); assert_eq!( distance(&String::from("distance"), &String::from("difference")), 5 ); assert_eq!( distance(&String::from("distance"), &String::from("eistancd")), 2 ); assert_eq!( distance(&String::from("你好世界"), &String::from("你好")), 2 ); assert_eq!( distance( &String::from("因為我是中國人所以我會說中文"), &String::from("因為我是英國人所以我會說英文") ), 2 ); assert_eq!(distance( &String::from("Morbi interdum ultricies neque varius condimentum. Donec volutpat turpis interdum metus ultricies vulputate. Duis ultricies rhoncus sapien, sit amet fermentum risus imperdiet vitae. Ut et lectus"), &String::from("Duis erat dolor, cursus in tincidunt a, lobortis in odio. Cras magna sem, pharetra et iaculis quis, faucibus quis tellus. Suspendisse dapibus sapien in justo cursus") ), 143); }
rust_cleaned_test_functions.jsonl/25022
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1228 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19464, 368, 341, 286, 2060, 10714, 10297, 19348, 2099, 703, 486, 1499, 445, 64, 3975, 609, 703, 486, 1499, 445, 65, 35674, 220, 16, 317, 286, 2060, 10714, 10297, 19348, 2099, 703, 486, 1499, 445...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_process_blockstore_with_slot_with_trailing_entry() { solana_logger::setup(); let GenesisConfigInfo { mint_keypair, genesis_config, .. } = create_genesis_config(10_000); let ticks_per_slot = genesis_config.ticks_per_slot; let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config); let blockstore = Blockstore::open(ledger_path.path()).unwrap(); let mut entries = create_ticks(ticks_per_slot, 0, blockhash); let trailing_entry = { let keypair = Keypair::new(); let tx = system_transaction::transfer(&mint_keypair, &keypair.pubkey(), 1, blockhash); next_entry(&blockhash, 1, vec![tx]) }; entries.push(trailing_entry); // Tricks blockstore into writing the trailing entry by lying that there is one more tick // per slot. let parent_slot = 0; let slot = 1; assert_matches!( blockstore.write_entries( slot, 0, 0, ticks_per_slot + 1, Some(parent_slot), true, &Arc::new(Keypair::new()), entries, 0, ), Ok(_) ); let opts = ProcessOptions { poh_verify: true, accounts_db_test_hash_calculation: true, ..ProcessOptions::default() }; let (bank_forks, ..) = test_process_blockstore(&genesis_config, &blockstore, opts); assert_eq!(frozen_bank_slots(&bank_forks), vec![0]); }
rust_cleaned_test_functions.jsonl/46792
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 852 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 11305, 7113, 4314, 6615, 27563, 6615, 3547, 14277, 9078, 368, 341, 286, 2048, 3362, 27413, 486, 15188, 1428, 286, 1077, 40788, 2648, 1731, 341, 310, 28337, 3097, 12670, 345, 310, 59366, 5332, 345, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_is_subclass() { let gil = Python::acquire_gil(); let py = gil.python(); assert!(py.is_subclass::<PyBool, PyInt>().unwrap()); assert!(!py.is_subclass::<PyBool, PyList>().unwrap()); }
rust_cleaned_test_functions.jsonl/1055
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 121 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 6892, 5228, 1040, 368, 341, 286, 1077, 342, 321, 284, 13027, 486, 580, 984, 1889, 321, 543, 286, 1077, 4510, 284, 342, 321, 43193, 543, 286, 2060, 10297, 3288, 2079, 5228, 1040, 27638, 13828, 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_url_for_external() { let mut resource = ResourceHandler::<()>::default(); resource.name("index"); let routes = vec![( Resource::external("youtube", "https://youtube.com/watch/{video_id}"), None, )]; let router = Router::new::<()>("", routes).0; let info = router.default_route_info(); assert!(!info.has_route("https://youtube.com/watch/unknown")); let req = TestRequest::default().finish_with_router(router); let url = req.url_for("youtube", &["oHg5SJYRHA0"]); assert_eq!( url.ok().unwrap().as_str(), "https://youtube.com/watch/oHg5SJYRHA0" ); }
rust_cleaned_test_functions.jsonl/30115
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 340 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2903, 5478, 47432, 368, 341, 286, 1077, 5206, 5101, 284, 11765, 3050, 27638, 368, 6831, 2258, 543, 286, 5101, 2644, 445, 1252, 797, 286, 1077, 11291, 284, 7486, 20703, 1006, 310, 11765, 486, 20921...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_changing_default_level() { assert_eq!(run("foo", "foo", Level::Trace), true); assert_eq!(run("foo", "bar", Level::Trace), false); assert_eq!(run("warn", "foo", Level::Warn), true); assert_eq!(run("warn", "foo", Level::Info), false); }
rust_cleaned_test_functions.jsonl/126009
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 133 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4138, 8595, 9993, 8274, 368, 341, 286, 2060, 10714, 10297, 6108, 445, 7975, 497, 330, 7975, 497, 9395, 486, 6550, 701, 830, 317, 286, 2060, 10714, 10297, 6108, 445, 7975, 497, 330, 2257, 497, 93...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_part2() { let path = "data/14th_day/test2_input.txt"; let program = get_program(path); let result = handle_program_memory(program); assert_eq!(result, 208); }
rust_cleaned_test_functions.jsonl/105643
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 84 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 10495, 17, 368, 341, 262, 1077, 1815, 284, 330, 691, 14, 16, 19, 339, 16763, 12697, 17, 5898, 3909, 876, 262, 1077, 2025, 284, 633, 25096, 5581, 317, 262, 1077, 1102, 284, 3705, 25096, 19195, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_conv() { let tests = vec![ ("a", 16, 2, "1010"), ("6E", 18, 8, "172"), ("-17", 10, -18, "-H"), (" -17", 10, -18, "-H"), ("-17", 10, 18, "2D3FGB0B9CG4BD1H"), ("+18aZ", 7, 36, "1"), (" +18aZ", 7, 36, "1"), ("18446744073709551615", -10, 16, "7FFFFFFFFFFFFFFF"), ("12F", -10, 16, "C"), (" FF ", 16, 10, "255"), ("TIDB", 10, 8, "0"), ("aa", 10, 2, "0"), (" A", -10, 16, "0"), ("a6a", 10, 8, "0"), ("16九a", 10, 8, "20"), ("+", 10, 8, "0"), ("-", 10, 8, "0"), ("", 2, 16, "0"), ]; for (n, f, t, e) in tests { let n = Some(n.as_bytes().to_vec()); let f = Some(f); let t = Some(t); let e = Some(e.as_bytes().to_vec()); let got = RpnFnScalarEvaluator::new() .push_param(n) .push_param(f) .push_param(t) .evaluate(ScalarFuncSig::Conv) .unwrap(); assert_eq!(got, e); } let invalid_tests = vec![ (None, Some(10), Some(10), None), (Some(b"a6a".to_vec()), Some(1), Some(8), None), ]; for (n, f, t, e) in invalid_tests { let got = RpnFnScalarEvaluator::new() .push_param(n) .push_param(f) .push_param(t) .evaluate::<Bytes>(ScalarFuncSig::Conv) .unwrap(); assert_eq!(got, e); } }
rust_cleaned_test_functions.jsonl/9501
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1073 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22716, 368, 341, 286, 1077, 7032, 284, 7486, 90515, 310, 3489, 64, 497, 220, 16, 21, 11, 220, 17, 11, 330, 16, 15, 16, 15, 4461, 310, 3489, 21, 36, 497, 220, 16, 23, 11, 220, 23, 11, 330...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_start_actor() { let count = Arc::new(AtomicUsize::new(0)); let act_count = Arc::clone(&count); System::run(move || { let addr = Arbiter::start(move |_| MyActor(act_count)); addr.do_send(Ping(1)); }); assert_eq!(count.load(Ordering::Relaxed), 1); }
rust_cleaned_test_functions.jsonl/132714
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 139 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 4906, 54818, 368, 341, 262, 1077, 1760, 284, 19689, 486, 931, 7, 65857, 52, 2141, 486, 931, 7, 15, 1106, 262, 1077, 1160, 3180, 284, 19689, 486, 19982, 2099, 1830, 626, 262, 739, 486, 6108, 34...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_invalid_input() { let input = "13a1"; let input2 = "lorem ipsum"; let mut op_interpreter = OperationInterpreter::new(); op_interpreter.lexer(input); assert_eq!(op_interpreter.parser(), Err("Error: cannot process this operation: 13a1".to_string())); op_interpreter.input = input2.to_string(); assert_eq!(op_interpreter.parser(), Err("Error: cannot process this operation: lorem ipsum".to_string())); }
rust_cleaned_test_functions.jsonl/109246
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 174 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 31433, 5898, 368, 341, 262, 1077, 1946, 284, 330, 16, 18, 64, 16, 876, 262, 1077, 1946, 17, 284, 330, 385, 1826, 26342, 3302, 262, 1077, 5206, 1179, 15318, 28637, 284, 16730, 58426, 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_vec() { assert_eq!( Level::vec(&[0, 1, 125]), vec![Level(0), Level(1), Level(125)] ); }
rust_cleaned_test_functions.jsonl/31779
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 94 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13251, 368, 341, 286, 2060, 10714, 33673, 310, 9395, 486, 4083, 2099, 58, 15, 11, 220, 16, 11, 220, 16, 17, 20, 17036, 310, 7486, 20703, 4449, 7, 15, 701, 9395, 7, 16, 701, 9395, 7, 16, 17...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_builder_open_async() { common::with_serial_ports::<_, std::convert::Infallible>(|port, _| { let baud_rate = 9600; let builder = mio_serial::new(port, baud_rate); let stream = builder.open_native_async()?; async_serial_test_helper::expect_baud_rate(&stream, baud_rate) }) }
rust_cleaned_test_functions.jsonl/107530
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 165 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 28532, 11311, 28346, 368, 341, 9401, 262, 4185, 486, 4197, 25602, 47694, 27638, 6878, 1460, 486, 14166, 486, 641, 13464, 1238, 2235, 91, 403, 11, 85137, 341, 286, 1077, 56822, 9246, 284, 220, 24, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_fq_legendre() { use ark_ff::fields::LegendreSymbol::*; assert_eq!(QuadraticResidue, Fq::one().legendre()); assert_eq!(Zero, Fq::zero().legendre()); assert_eq!( QuadraticResidue, Fq::from(BigInteger256::from(4)).legendre() ); assert_eq!( QuadraticNonResidue, Fq::from(BigInteger256::from(5)).legendre() ); }
rust_cleaned_test_functions.jsonl/3554
{ "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, 761, 80, 76612, 265, 368, 341, 262, 990, 55217, 58708, 486, 9007, 486, 39675, 265, 15090, 79304, 262, 2060, 10714, 10297, 2183, 88678, 1061, 60607, 11, 434, 80, 486, 603, 1005, 14505, 265, 1423, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_transforms_with_epoch_seconds_to_iso8601() { let expected_iso = "2021-07-20T23:18:18Z"; let mut test_value = json!({ "name": "A", "epoch_seconds_float": 1626823098.51995, "epoch_seconds_int": 1626823098, "epoch_seconds_float_string": "1626823098.51995", "epoch_seconds_int_string": "1626823098", }); let test_message = OwnedMessage::new( Some(test_value.to_string().into_bytes()), None, "test".to_string(), rdkafka::Timestamp::NotAvailable, 0, 0, None, ); let mut transforms = HashMap::new(); transforms.insert( "iso8601_from_float".to_string(), "epoch_seconds_to_iso8601(epoch_seconds_float)".to_string(), ); transforms.insert( "iso8601_from_int".to_string(), "epoch_seconds_to_iso8601(epoch_seconds_int)".to_string(), ); transforms.insert( "iso8601_from_float_string".to_string(), "epoch_seconds_to_iso8601(to_number(epoch_seconds_float_string))".to_string(), ); transforms.insert( "iso8601_from_int_string".to_string(), "epoch_seconds_to_iso8601(to_number(epoch_seconds_int_string))".to_string(), ); let transformer = Transformer::from_transforms(&transforms).unwrap(); let _ = transformer .transform(&mut test_value, Some(&test_message)) .unwrap(); let name = test_value.get("name").unwrap().as_str().unwrap(); let iso8601_from_float = test_value .get("iso8601_from_float") .unwrap() .as_str() .unwrap(); let iso8601_from_int = test_value .get("iso8601_from_int") .unwrap() .as_str() .unwrap(); let iso8601_from_float_string = test_value .get("iso8601_from_float_string") .unwrap() .as_str() .unwrap(); let iso8601_from_int_string = test_value .get("iso8601_from_int_string") .unwrap() .as_str() .unwrap(); assert_eq!("A", name); assert_eq!(expected_iso, iso8601_from_float); assert_eq!(expected_iso, iso8601_from_int); assert_eq!(expected_iso, iso8601_from_float_string); assert_eq!(expected_iso, iso8601_from_int_string); }
rust_cleaned_test_functions.jsonl/124211
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1343 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18449, 82, 6615, 20682, 34825, 2346, 49660, 23, 21, 15, 16, 368, 341, 286, 1077, 3601, 49660, 284, 330, 17, 15, 17, 16, 12, 15, 22, 12, 17, 15, 51, 17, 18, 25, 16, 23, 25, 16, 23, 57, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_data_large_than_recv_window() { let rt = rt(); rt.block_on(async { let (mut frame_sender, frame_receiver) = channel(2); let (unbound_sender, mut unbound_receiver) = unbounded(); let mut stream = StreamHandle::new( 0, unbound_sender, frame_receiver, StreamState::Init, 2, INITIAL_STREAM_WINDOW, ); let flags = Flags::from(Flag::Syn); let frame = Frame::new_data(flags, 0, BytesMut::from("1234")); frame_sender.send(frame).await.unwrap(); let mut b = [0; 1024]; assert_eq!( stream.read(&mut b).await.unwrap_err().kind(), ErrorKind::InvalidData ); let event = unbound_receiver.next().await.unwrap(); match event { StreamEvent::GoAway => (), _ => panic!("must be go away"), } }); }
rust_cleaned_test_functions.jsonl/88132
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 604 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 1769, 45228, 51613, 36118, 12571, 368, 341, 286, 1077, 16677, 284, 16677, 543, 286, 16677, 15697, 4470, 18285, 341, 310, 1077, 320, 6984, 4034, 54356, 11, 4034, 65691, 8, 284, 5496, 7, 17, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_convert_call_multiple_object_arguments() { let b = ast::BaseNode::default(); let pkg = ast::Package { base: b.clone(), path: "path".to_string(), package: "main".to_string(), files: vec![ast::File { base: b.clone(), name: "foo.flux".to_string(), metadata: String::new(), package: None, imports: Vec::new(), body: vec![ast::Statement::Expr(Box::new(ast::ExprStmt { base: b.clone(), expression: ast::Expression::Call(Box::new(ast::CallExpr { base: b.clone(), callee: ast::Expression::Identifier(ast::Identifier { base: b.clone(), name: "f".to_string(), }), lparen: None, arguments: vec![ ast::Expression::Object(Box::new(ast::ObjectExpr { base: b.clone(), lbrace: None, with: None, properties: vec![ast::Property { base: b.clone(), key: ast::PropertyKey::Identifier(ast::Identifier { base: b.clone(), name: "a".to_string(), }), separator: None, value: Some(ast::Expression::Integer(ast::IntegerLit { base: b.clone(), value: 0, })), comma: None, }], rbrace: None, })), ast::Expression::Object(Box::new(ast::ObjectExpr { base: b.clone(), lbrace: None, with: None, properties: vec![ast::Property { base: b.clone(), key: ast::PropertyKey::Identifier(ast::Identifier { base: b.clone(), name: "b".to_string(), }), separator: None, value: Some(ast::Expression::Integer(ast::IntegerLit { base: b.clone(), value: 1, })), comma: None, }], rbrace: None, })), ], rparen: None, })), }))], eof: None, }], }; let got = test_convert(pkg).err().unwrap().to_string(); assert_eq!( "arguments are more than one object expression".to_string(), got ); }
rust_cleaned_test_functions.jsonl/30449
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 2389 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 34910, 13429, 45233, 5314, 43433, 368, 341, 286, 1077, 293, 284, 11763, 486, 3978, 1955, 486, 2258, 543, 286, 1077, 24793, 284, 11763, 486, 13100, 341, 310, 2331, 25, 293, 15997, 3148, 310, 1815, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_f64() { let val = JsValue::new(42.5); assert!(val.is_number() && val.is_double()); assert_eq!(val.as_double(), 42.5); }
rust_cleaned_test_functions.jsonl/27903
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 91 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 761, 21, 19, 368, 341, 286, 1077, 1044, 284, 39122, 1130, 486, 931, 7, 19, 17, 13, 20, 317, 286, 2060, 10297, 831, 2079, 5500, 368, 1009, 1044, 2079, 24598, 1423, 286, 2060, 10714, 10297, 831,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_bench_tps_fund_keys_with_fees() { let (mut genesis_block, id) = create_genesis_block(10_000); let fee_calculator = FeeCalculator::new(11); genesis_block.fee_calculator = fee_calculator; let bank = Bank::new(&genesis_block); let client = BankClient::new(bank); let tx_count = 10; let lamports = 20; let (keypairs, _keypair_balance) = generate_and_fund_keypairs(&client, None, &id, tx_count, lamports).unwrap(); let max_fee = client .get_recent_blockhash() .unwrap() .1 .max_lamports_per_signature; for kp in &keypairs { assert_eq!( client.get_balance(&kp.pubkey()).unwrap(), lamports + max_fee ); } }
rust_cleaned_test_functions.jsonl/1529
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 435 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 880, 19762, 528, 1690, 761, 1241, 12631, 6615, 761, 5516, 368, 341, 286, 1077, 320, 6984, 59366, 7113, 11, 877, 8, 284, 1855, 16322, 13774, 7113, 7, 16, 15, 62, 15, 15, 15, 317, 286, 1077, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_bitv_set_intersection() { let mut a = BitvSet::new(); let mut b = BitvSet::new(); assert!(a.insert(11)); assert!(a.insert(1)); assert!(a.insert(3)); assert!(a.insert(77)); assert!(a.insert(103)); assert!(a.insert(5)); assert!(b.insert(2)); assert!(b.insert(11)); assert!(b.insert(77)); assert!(b.insert(5)); assert!(b.insert(3)); let expected = [3, 5, 11, 77]; let actual = a.intersection(&b).collect::<Vec<uint>>(); assert_eq!(actual, expected); }
rust_cleaned_test_functions.jsonl/119307
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 315 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13996, 85, 2602, 82558, 368, 341, 286, 1077, 5206, 264, 284, 6495, 85, 1649, 486, 931, 543, 286, 1077, 5206, 293, 284, 6495, 85, 1649, 486, 931, 1428, 286, 2060, 10297, 64, 7030, 7, 16, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_stream() { let f = Frame::Stream { fin: false, stream_id: 5.into(), offset: 0, data: vec![1, 2, 3], fill: false, }; enc_dec(&f, "0a0503010203"); // Now with offset != 0 and FIN let f = Frame::Stream { fin: true, stream_id: 5.into(), offset: 1, data: vec![1, 2, 3], fill: false, }; enc_dec(&f, "0f050103010203"); // Now to fill the packet. let f = Frame::Stream { fin: true, stream_id: 5.into(), offset: 0, data: vec![1, 2, 3], fill: true, }; enc_dec(&f, "0905010203"); }
rust_cleaned_test_functions.jsonl/30422
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 472 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 12673, 368, 341, 1789, 286, 1077, 282, 284, 16321, 486, 3027, 341, 310, 1875, 25, 895, 345, 310, 4269, 842, 25, 220, 20, 39860, 3148, 310, 4347, 25, 220, 15, 345, 310, 821, 25, 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_scaling_factor_decrement() { let mut factor = ScalingFactor::new(2.0); assert_ulps_eq!(factor.value(), 1.0); assert_eq!(factor.exponent(), 0); factor.decrement(); assert_ulps_eq!(factor.value(), 0.5); assert_eq!(factor.exponent(), -1); factor.decrement(); factor.decrement(); factor.increment(); factor.decrement(); assert_ulps_eq!(factor.value(), 0.125); assert_eq!(factor.exponent(), -3); }
rust_cleaned_test_functions.jsonl/101310
{ "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, 79216, 18588, 2259, 13477, 368, 341, 262, 1077, 5206, 8168, 284, 88001, 20661, 486, 931, 7, 17, 13, 15, 317, 262, 2060, 61039, 1690, 10714, 10297, 37591, 2824, 1507, 220, 16, 13, 15, 317, 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_extend_from_slice() { let mut v: SmallVec<[u8; 8]> = SmallVec::new(); for x in 0..4 { v.push(x); } assert_eq!(v.len(), 4); v.extend_from_slice(&[5, 6]); assert_eq!( &v.iter().map(|v| *v).collect::<Vec<_>>(), &[0, 1, 2, 3, 5, 6] ); }
rust_cleaned_test_functions.jsonl/88154
{ "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, 70265, 5673, 26488, 368, 341, 286, 1077, 5206, 348, 25, 14994, 10050, 66746, 84, 23, 26, 220, 23, 25669, 284, 14994, 10050, 486, 931, 543, 286, 369, 856, 304, 220, 15, 496, 19, 341, 310, 348, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_primitive_array_divide_with_nulls_sliced() { let a = Int32Array::from(vec![ None, None, None, None, None, None, None, None, Some(15), None, Some(8), Some(1), Some(9), None, None, ]); let b = Int32Array::from(vec![ None, None, None, None, None, None, None, None, Some(5), Some(6), Some(8), Some(9), None, None, None, ]); let a = a.slice(8, 6); let a = a.as_any().downcast_ref::<Int32Array>().unwrap(); let b = b.slice(8, 6); let b = b.as_any().downcast_ref::<Int32Array>().unwrap(); let c = divide(&a, &b).unwrap(); assert_eq!(6, c.len()); assert_eq!(3, c.value(0)); assert_eq!(true, c.is_null(1)); assert_eq!(1, c.value(2)); assert_eq!(0, c.value(3)); assert_eq!(true, c.is_null(4)); assert_eq!(true, c.is_null(5)); }
rust_cleaned_test_functions.jsonl/17857
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 805 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 84087, 3858, 16237, 577, 6615, 15162, 82, 643, 74630, 368, 341, 286, 1077, 264, 284, 1333, 18, 17, 1857, 486, 1499, 25592, 90515, 310, 2240, 345, 310, 2240, 345, 310, 2240, 345, 310, 2240, 345, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_full() { let dev_full = OpenOptions::new().write(true).open("/dev/full").unwrap(); new_ucmd!() .arg("fields_1.txt") .arg("fields_2.txt") .set_stdout(dev_full) .fails() .stderr_contains("No space left on device"); }
rust_cleaned_test_functions.jsonl/55280
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 143 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 16372, 368, 341, 262, 1077, 3483, 16372, 284, 5264, 3798, 486, 931, 1005, 4934, 3715, 568, 2508, 4283, 3583, 62975, 1827, 15454, 543, 262, 501, 68887, 2277, 0, 741, 286, 659, 858, 445, 9007, 62,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_mmap_noreserve() { serial_test(|| { with_cleanup( || { let res = mmap_noreserve(START, BYTES_IN_PAGE); assert!(res.is_ok()); // Try reserve it let res = unsafe { dzmmap(START, BYTES_IN_PAGE) }; assert!(res.is_ok()); }, || { assert!(munmap(START, BYTES_IN_PAGE).is_ok()); }, ) }) }
rust_cleaned_test_functions.jsonl/107212
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 361 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 717, 2186, 1089, 4589, 5852, 368, 341, 286, 6146, 4452, 79453, 341, 310, 448, 42444, 1006, 394, 1369, 341, 503, 1077, 592, 284, 70866, 1089, 4589, 5852, 7, 22564, 11, 7710, 28484, 2158, 19971, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
4
#[test] fn test_incorrect_full_exit_withdraw_amount() { // Transactions are expected to fail with any value of provided `success` flag. let test_vector = vec![ (10u64, 10000u64, true), // Withdraw too big and `success` set to true (0, 1, true), // Withdraw from 0 balance and `success` set to true (10, 10000, false), // Withdraw too big and `success` set to false (0, 1, false), // Withdraw from 0 balance and `success` set to false ]; const ERR_MSG: &str = "op_valid is true/enforce equal to one"; for (initial_balance, withdraw_amount, success) in test_vector { // Input data. let accounts = vec![WitnessTestAccount::new(AccountId(1), initial_balance)]; let account = &accounts[0]; let full_exit_op = FullExitOp { priority_op: FullExit { account_id: account.id, eth_address: account.account.address, token: TokenId(0), is_legacy: false, }, withdraw_amount: Some(BigUint::from(withdraw_amount).into()), creator_account_id: None, creator_address: None, serial_id: None, content_hash: None, }; #[allow(clippy::redundant_closure)] incorrect_op_test_scenario::<FullExitWitness<Bn256>, _, _>( &accounts, (full_exit_op, success), (), ERR_MSG, || vec![], |_| {}, ); } }
rust_cleaned_test_functions.jsonl/45537
{ "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, 1243, 19928, 16372, 16880, 6615, 7633, 13471, 368, 341, 1066, 262, 442, 55285, 525, 3601, 311, 3690, 448, 894, 897, 315, 3897, 1565, 5630, 63, 5181, 624, 262, 1077, 1273, 12247, 284, 7486, 90515, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_os_string() { #[cfg(not(windows))] { use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; test( r#""fo{~u80}o""#, OsStr::from_bytes(&[0x66, 0x6F, 0x80, 0x6F]).quote(), ); } #[cfg(windows)] { use std::ffi::OsString; use std::os::windows::ffi::OsStringExt; test( r#""fo{~ud800}o""#, OsString::from_wide(&[0x66, 0x6F, 0xD800, 0x6F]).quote(), ); } }
rust_cleaned_test_functions.jsonl/30103
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 312 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 29387, 3904, 368, 341, 262, 11506, 14072, 24772, 3622, 1491, 22297, 262, 341, 286, 990, 1460, 486, 53799, 486, 28867, 2580, 280, 286, 990, 1460, 486, 436, 486, 56646, 486, 53799, 486, 28867, 2580,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_decl() { use ast::Declaration; use parser::declaration; let env = &mut Env::new(); assert_eq!( declaration("struct foo S;", env).unwrap(), Declaration { specifiers: vec![StructType { kind: StructKind::Struct.into(), identifier: Some(ident("foo")), declarations: None, } .into()], declarators: vec![InitDeclarator { declarator: Declarator { kind: ident("S"), derived: vec![], extensions: vec![], } .into(), initializer: None, } .into()], } .into() ); }
rust_cleaned_test_functions.jsonl/107587
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 451 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 15126, 35814, 368, 341, 262, 990, 11763, 486, 24489, 280, 262, 990, 6729, 486, 80383, 401, 262, 1077, 6105, 284, 609, 6984, 37039, 486, 931, 1428, 262, 2060, 10714, 33673, 286, 18004, 445, 1235, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_test_file() { let env_temp_dir = temp_dir(); let mut previous_folders: Vec<PathBuf> = Vec::new(); let folder_entries = read_dir(&env_temp_dir) .expect("Error getting entries from system default temp folder."); for entry in folder_entries { let entry = entry .expect("Error getting default temp folder entries") ; let path = entry.path(); if path.is_dir() {previous_folders.push(path)} } let mut test_file_path = PathBuf::from("/"); { let test_file = TestFile::new(); test_file_path = PathBuf::from(test_file.path()); // Check this folder didn't exist previously. assert!(!previous_folders.contains(&test_file_path), "Test file already existed."); // Check now exists. assert!(test_file_path.exists(), "Test file does not exists."); } // test_file should disappear here as variable is dropped. // Check test_file does not exists now. assert!(!test_file_path.exists()); }
rust_cleaned_test_functions.jsonl/129709
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 532 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8657, 4452, 2458, 368, 341, 286, 1077, 6105, 11771, 4334, 284, 2730, 4334, 543, 286, 1077, 5206, 3681, 83928, 25, 11312, 82883, 15064, 29, 284, 11312, 486, 931, 543, 286, 1077, 8527, 26092, 284, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
3
#[test] fn test_lerp() { let black = RGB::named(BLACK); let white = RGB::named(WHITE); assert!(black.lerp(white, 0.0) == black); assert!(black.lerp(white, 1.0) == white); }
rust_cleaned_test_functions.jsonl/46382
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 109 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 907, 22632, 368, 341, 286, 1077, 3691, 284, 20978, 486, 30245, 5349, 43, 4032, 317, 286, 1077, 4158, 284, 20978, 486, 30245, 14031, 29579, 317, 286, 2060, 10297, 11453, 918, 22632, 7, 5782, 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_metrics_report_update_check_response_time() { block_on(async { let mut metrics_reporter = MockMetricsReporter::new(); let _response = StateMachineBuilder::new_stub() .metrics_reporter(&mut metrics_reporter) .oneshot() .await; // patterns yet. #[rustfmt::skip] assert_matches!( metrics_reporter.metrics.as_slice(), [ Metrics::UpdateCheckResponseTime { response_time: _, successful: true }, Metrics::RequestsPerCheck { count: 1, successful: true }, ] ); }); }
rust_cleaned_test_functions.jsonl/59682
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 394 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 37686, 14813, 8882, 7200, 9655, 3009, 368, 341, 286, 2504, 4470, 18285, 341, 310, 1077, 5206, 16734, 14813, 261, 284, 14563, 27328, 52766, 486, 931, 543, 310, 1077, 716, 2322, 284, 3234, 21605, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_send_examples() { let system = ActorSystem::create(ActorSystemConfig::default().thread_pool_size(2)); let aid = system .spawn() .with((), |_: (), context: Context, message: Message| async move { if let Some(_) = message.content_as::<i32>() { context.system.trigger_shutdown(); } Ok(Status::done(())) }) .unwrap(); match aid.send(Message::new(11)) { Ok(_) => info!("OK Then!"), Err(e) => info!("Ooops {:?}", e), } system.await_shutdown(None); }
rust_cleaned_test_functions.jsonl/51699
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 344 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13565, 45279, 368, 341, 286, 1077, 1849, 284, 24718, 2320, 486, 3182, 7, 18870, 2320, 2648, 486, 2258, 1005, 4528, 15709, 2368, 7, 17, 3237, 286, 1077, 12296, 284, 1849, 198, 310, 659, 46087, 74...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_parser () { let mut fs = position::FileSet::new(); let f = fs.add_file("testfile1.gs".to_string(), None, 1000); let s1 = r###" func (p *someobj) testFunc(a, b *int) (i int) { for 我 := range iii { a = 1; } } "###; let o = &mut Objects::new(); let el = &mut ErrorList::new(); let mut p = Parser::new(o, f, el, s1, true); p.open_scope(); p.pkg_scope = p.top_scope; p.parse_decl(Token::is_decl_start); }
rust_cleaned_test_functions.jsonl/69736
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 310 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 18517, 1719, 341, 286, 1077, 5206, 8619, 284, 2309, 486, 1703, 1649, 486, 931, 543, 286, 1077, 282, 284, 8619, 1364, 2458, 445, 1944, 1192, 16, 95568, 3263, 983, 3904, 1507, 2240, 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_goaway_frame_on_request_stream() { test_wrong_frame_on_request_stream(&[0x7, 0x1, 0x5], Error::WrongStream); }
rust_cleaned_test_functions.jsonl/10929
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 70 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 25515, 13757, 8929, 4470, 7893, 12673, 368, 341, 286, 1273, 75198, 8929, 4470, 7893, 12673, 2099, 58, 15, 87, 22, 11, 220, 15, 87, 16, 11, 220, 15, 87, 20, 1125, 4600, 486, 29185, 3027, 317, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_string_parse_from_str() { let text = "hello world"; let u: ArrayString<[_; 11]> = text.parse().unwrap(); assert_eq!(&u, text); assert_eq!(u.len(), text.len()); }
rust_cleaned_test_functions.jsonl/36784
{ "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, 3904, 21039, 5673, 2895, 368, 341, 262, 1077, 1467, 284, 330, 14990, 1879, 876, 262, 1077, 575, 25, 2910, 703, 27, 13496, 26, 220, 16, 16, 25669, 284, 1467, 4632, 1005, 15454, 543, 262, 2060, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_missing_files() { new_ucmd!() .arg("-v") .arg("groupname") .fails() .stderr_contains( "error: The following required arguments were not provided:\n <FILE>...\n", ); }
rust_cleaned_test_functions.jsonl/49275
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 130 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 40447, 10931, 368, 341, 262, 501, 68887, 2277, 0, 741, 286, 659, 858, 13645, 85, 1138, 286, 659, 858, 445, 4074, 606, 1138, 286, 659, 59631, 741, 286, 659, 36422, 63598, 1006, 310, 330, 841, 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
#[test] fn test_auto_gc() { let count = 3; let (mut cluster, first_leader_causet_storage, ctx) = new_violetabft_causet_storage_with_store_count(count, ""); let fidel_client = Arc::clone(&cluster.fidel_client); // Used to wait for all causet_storage's GC to finish let (finish_signal_tx, finish_signal_rx) = channel(); // Create causet_storage object for each store in the cluster let mut causet_storages: HashMap<_, _> = cluster .sim .rl() .causet_storages .iter() .map(|(id, engine)| { let mut config = GcConfig::default(); // Do not skip GC config.ratio_memory_barrier = 0.9; let causet_storage = SyncTestStorageBuilder::from_engine(engine.clone()) .gc_config(config) .build() .unwrap(); (*id, causet_storage) }) .collect(); let mut brane_info_accessors = cluster.sim.rl().brane_info_accessors.clone(); for (id, causet_storage) in &mut causet_storages { let tx = finish_signal_tx.clone(); let mut causet = AutoGcConfig::new_test_causet( Arc::clone(&fidel_client), brane_info_accessors.remove(id).unwrap(), *id, ); causet.post_a_round_of_gc = Some(Box::new(move || tx.lightlike(()).unwrap())); causet_storage.spacelike_auto_gc(causet); } assert_eq!(causet_storages.len(), count); // test_data will be wrote with ts < 50 let test_data: Vec<_> = [ (b"k1", b"v1"), (b"k2", b"v2"), (b"k3", b"v3"), (b"k4", b"v4"), (b"k5", b"v5"), (b"k6", b"v6"), (b"k7", b"v7"), (b"k8", b"v8"), (b"k9", b"v9"), ] .iter() .map(|(k, v)| (k.to_vec(), v.to_vec())) .collect(); let test_data2: Vec<_> = test_data .iter() .map(|(k, v)| { let mut v = v.to_vec(); v.push(b'1'); (k.to_vec(), v) }) .collect(); let test_data3: Vec<_> = test_data .iter() .map(|(k, v)| { let mut v = v.to_vec(); v.push(b'2'); (k.to_vec(), v) }) .collect(); write_test_data(&first_leader_causet_storage, &ctx, &test_data, 10); write_test_data(&first_leader_causet_storage, &ctx, &test_data2, 100); write_test_data(&first_leader_causet_storage, &ctx, &test_data3, 200); let split_tuplespaceInstanton: &[&[u8]] = &[b"k2", b"k4", b"k6", b"k8"]; for k in split_tuplespaceInstanton { let brane = cluster.get_brane(*k); cluster.must_split(&brane, *k); } check_data(&mut cluster, &causet_storages, &test_data, 50, true); check_data(&mut cluster, &causet_storages, &test_data2, 150, true); check_data(&mut cluster, &causet_storages, &test_data3, 250, true); fidel_client.set_gc_safe_point(150); for _ in 0..count { finish_signal_rx.recv().unwrap(); } check_data(&mut cluster, &causet_storages, &test_data, 50, false); check_data(&mut cluster, &causet_storages, &test_data2, 150, true); check_data(&mut cluster, &causet_storages, &test_data3, 250, true); // No more signals. finish_signal_rx .recv_timeout(Duration::from_millis(300)) .unwrap_err(); }
rust_cleaned_test_functions.jsonl/55606
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1697 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 27740, 49423, 368, 341, 262, 1077, 1760, 284, 220, 18, 280, 262, 1077, 320, 6984, 10652, 11, 1156, 79991, 666, 11855, 295, 23310, 11, 5635, 8, 284, 501, 2273, 30912, 370, 723, 666, 11855, 295, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
5
#[test] fn test_from_str() -> Result<(), Box<dyn std::error::Error>> { use alternate_bases::Allele; use chromosome::Chromosome; use reference_bases::Base; let s = "chr1\t13\tnd0\tATCG\tA\t5.8\tPASS\tSVTYPE=DEL"; let record: Record = s.parse()?; assert!(matches!(record.chromosome(), Chromosome::Name(name) if name == "chr1")); assert_eq!(i32::from(record.position()), 13); let ids = record.ids(); assert_eq!(ids.len(), 1); let id: ids::Id = "nd0".parse()?; assert!(ids.contains(&id)); let reference_bases = [Base::A, Base::T, Base::C, Base::G]; assert_eq!(&record.reference_bases()[..], &reference_bases[..]); let alternate_bases = [Allele::Bases(vec![Base::A])]; assert_eq!(&record.alternate_bases()[..], &alternate_bases[..]); assert_eq!(record.quality_score().map(f32::from), Some(5.8)); assert_eq!(record.filters(), Some(&Filters::Pass)); assert_eq!(record.info().len(), 1); assert!(record.genotypes().is_empty()); Ok(()) }
rust_cleaned_test_functions.jsonl/109138
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 527 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5673, 2895, 368, 1464, 5714, 68843, 8261, 92846, 1460, 486, 841, 486, 1454, 2452, 341, 286, 990, 24609, 96290, 486, 70451, 273, 280, 286, 990, 50715, 486, 1143, 75118, 280, 286, 990, 5785, 96290, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_filters(){ assert_eq!(filter(&b"product=eq.134"[..]), IResult::Done(&b""[..], Filter{ connector: None, condition:Condition{ left: Operand::Column("product".to_string()), equality: Equality::EQ, right: Operand::Number(134f64) }, sub_filters: vec![] } )); assert_eq!(filter(&b"product=eq.134&price=lt.100.0"[..]), IResult::Done(&b""[..], Filter{ condition:Condition{ left: Operand::Column("product".to_string()), equality: Equality::EQ, right: Operand::Number(134f64) }, connector: None, sub_filters: vec![ Filter{ connector: Some(Connector::AND), condition: Condition{ left: Operand::Column("price".to_string()), equality: Equality::LT, right: Operand::Number(100.0) }, sub_filters: vec![] } ] } )); assert_eq!(filter(&b"product=eq.134|price=lt.100.0"[..]), IResult::Done(&b""[..], Filter{ condition:Condition{ left: Operand::Column("product".to_string()), equality: Equality::EQ, right: Operand::Number(134f64) }, connector: None, sub_filters: vec![ Filter{ connector: Some(Connector::OR), condition: Condition{ left: Operand::Column("price".to_string()), equality: Equality::LT, right: Operand::Number(100.0) }, sub_filters: vec![] } ] } )); assert_eq!(filter_expr(&b"(product=eq.134|price=lt.100.0)"[..]), IResult::Done(&b""[..], Filter{ condition:Condition{ left: Operand::Column("product".to_string()), equality: Equality::EQ, right: Operand::Number(134f64) }, connector: None, sub_filters: vec![ Filter{ connector: Some(Connector::OR), condition: Condition{ left: Operand::Column("price".to_string()), equality: Equality::LT, right: Operand::Number(100.0) }, sub_filters: vec![] } ] } )); }
rust_cleaned_test_functions.jsonl/114307
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 1627 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 22481, 3032, 262, 2060, 10714, 10297, 5315, 2099, 65, 1, 3031, 28, 11006, 13, 16, 18, 19, 36864, 496, 9719, 358, 2077, 486, 17453, 2099, 65, 3014, 95874, 1125, 715, 286, 12339, 515, 310, 26989, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_de_serialize() { let mut rng = thread_rng(); let mut grid = HexGrid::new(16); let grid_points = Hexagon::from_radius(16).iter_points().collect::<Vec<_>>(); (0..128).for_each(|_| { let pos = *grid_points.as_slice().choose(&mut rng).unwrap(); let val = rng.gen_range(0..128000000); grid.insert(pos, val).unwrap(); }); let s = serde_json::to_string(&grid).unwrap(); dbg!(&s); let res: HexGrid<i32> = serde_json::from_str(s.as_str()).unwrap(); assert_eq!(res.bounds(), grid.bounds()); res.iter().zip(grid.iter()).for_each(|(act, exp)| { assert_eq!(exp, act); }); }
rust_cleaned_test_functions.jsonl/43978
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 370 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2259, 88686, 368, 341, 286, 1077, 5206, 28422, 284, 4516, 66849, 1428, 286, 1077, 5206, 5827, 284, 27228, 3543, 486, 931, 7, 16, 21, 626, 286, 1077, 5827, 12928, 284, 27228, 6113, 486, 1499, 289...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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_option_byte_size() { #[derive(Deserialize)] struct Foo { #[serde(with = "super")] size: Option<usize>, } let json = r#"{"size": "1 M"}"#; let foo = serde_json::from_str::<Foo>(json).unwrap(); assert_eq!(foo.size, Some(1_000_000)); let json2 = r#"{"size": null}"#; let foo2 = serde_json::from_str::<Foo>(json2).unwrap(); assert_eq!(foo2.size, None); }
rust_cleaned_test_functions.jsonl/95669
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 211 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21039, 9672, 19737, 2368, 368, 341, 262, 11506, 27098, 7, 64465, 5563, 262, 2036, 33428, 341, 286, 11506, 47024, 16980, 284, 330, 9522, 5422, 286, 1379, 25, 6959, 90244, 12520, 262, 555, 262, 1077...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_err_on_modified_cipher() { let mut s = StreamXChaCha20Poly1305::new(&SecretKey::from(KEY), &Nonce::from(NONCE)); let mut cipher1: [u8; 23] = [ 252u8, 164u8, 0u8, 196u8, 27u8, 198u8, 8u8, 57u8, 216u8, 118u8, 134u8, 104u8, 156u8, 45u8, 71u8, 161u8, 199u8, 28u8, 79u8, 145u8, 19u8, 239u8, 4u8, ]; let mut plain_out1 = [0u8; 23 - ABYTES]; assert!(s.open_chunk(&cipher1, None, &mut plain_out1).is_ok()); // Reset state let mut s = StreamXChaCha20Poly1305::new(&SecretKey::from(KEY), &Nonce::from(NONCE)); // Change something in the ciphertext cipher1[5] = 0b1010_1010 | cipher1[5]; assert!(s.open_chunk(&cipher1, None, &mut plain_out1).is_err()); }
rust_cleaned_test_functions.jsonl/75568
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 409 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 9266, 4470, 37749, 76692, 368, 341, 286, 1077, 5206, 274, 284, 9203, 55, 95971, 95971, 17, 15, 38164, 16, 18, 15, 20, 486, 931, 2099, 19773, 1592, 486, 1499, 37076, 701, 609, 90528, 486, 1499, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_dont_import_unused_class_template_or_specialization() { let ir = ir_from_cc("template <class T> struct Template{}; template<> struct Template<int>{};") .unwrap(); assert_ir_not_matches!(ir, quote! { Record { ... "Template" ... } }); }
rust_cleaned_test_functions.jsonl/37156
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 107 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 814, 544, 18434, 66944, 4790, 8693, 8734, 41629, 2022, 368, 341, 262, 1077, 6216, 284, 6216, 5673, 28955, 445, 4214, 366, 1040, 350, 29, 2036, 14355, 6257, 26, 3811, 21122, 2036, 14355, 4159, 29, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_aux_bibtex_3_citation_duplicate() { let input = r"\relax \citation{Thorne:1992sdb} \citation{Abramovici:1992ah} \citation{Thorne:1992sdb}" .to_string(); assert_eq!( Inspirer::init(None).aux2key(input), vec!["Abramovici:1992ah", "Thorne:1992sdb"] ); }
rust_cleaned_test_functions.jsonl/65937
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 217 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30468, 880, 20319, 327, 62, 18, 666, 7556, 70434, 368, 341, 286, 1077, 1946, 284, 435, 11934, 3748, 706, 198, 310, 1124, 83147, 90, 1001, 16907, 25, 16, 24, 24, 17, 82, 1999, 532, 310, 1124, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_execute_single() -> Result<()> { let db = checked_memory_handle(); db.execute_batch("CREATE TABLE foo(x INTEGER)")?; assert_eq!( 3, db.execute("INSERT INTO foo(x) VALUES (?), (?), (?)", [1i32, 2i32, 3i32])? ); assert_eq!(1, db.execute("INSERT INTO foo(x) VALUES (?)", [4i32])?); assert_eq!( 10i32, db.query_row::<i32, _, _>("SELECT SUM(x) FROM foo", [], |r| r.get(0))? ); Ok(()) }
rust_cleaned_test_functions.jsonl/113050
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 289 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 44329, 19487, 368, 1464, 5714, 71698, 341, 286, 1077, 2927, 284, 10067, 19195, 10630, 543, 286, 2927, 7769, 14534, 445, 22599, 14363, 15229, 2075, 30381, 68191, 69493, 286, 2060, 10714, 33673, 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...
5
#[test] fn test_simple_variable() { assert_template_result!(r#"worked"#, r#"{{test}}"#, v!({"test": "worked"})); assert_template_result!( r#"worked wonderfully"#, r#"{{test}}"#, v!({"test": "worked wonderfully"}), ); }
rust_cleaned_test_functions.jsonl/72875
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 126 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 30015, 14635, 368, 341, 262, 2060, 8693, 5287, 10297, 81, 55543, 70114, 57676, 11, 435, 55543, 2979, 1944, 23386, 60778, 348, 0, 16864, 1944, 788, 330, 70114, 9207, 3237, 262, 2060, 8693, 5287, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_amount() { let value = 19_356_465_2435_5767__u64; let amount = Amount::from_sat(value); let data = value.to_le_bytes(); test_encoding_roundtrip(&value, data).unwrap(); test_encoding_roundtrip(&amount, data).unwrap(); }
rust_cleaned_test_functions.jsonl/43971
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 132 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 13471, 368, 341, 286, 1077, 897, 284, 220, 16, 24, 62, 18, 20, 21, 62, 19, 21, 20, 62, 17, 19, 18, 20, 62, 20, 22, 21, 22, 563, 84, 21, 19, 280, 286, 1077, 3311, 284, 25783, 486, 1499,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_allocator() { let mut allocator = PortAllocator::new(vec![3000, 3001].into_iter()); let ports = (allocator.allocate(None), allocator.allocate(None)); assert!(ports == (Some(3000), Some(3001)) || ports == (Some(3001), Some(3000))); assert_eq!(allocator.allocate(None), None); }
rust_cleaned_test_functions.jsonl/82085
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 143 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 56910, 368, 341, 286, 1077, 5206, 43655, 284, 5776, 42730, 486, 931, 25592, 20703, 18, 15, 15, 15, 11, 220, 18, 15, 15, 16, 936, 18122, 11723, 1423, 286, 1077, 20325, 284, 320, 57631, 68726, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
2
#[test] fn test_calculate_weight_skips_root() { let mut tower = Tower::new(EpochStakes::new_for_tests(2), 0, 0.67); tower.lockouts.root_slot = Some(1); let stakes = vec![ ( 0, StakeLockout { stake: 1, lockout: 8, }, ), ( 1, StakeLockout { stake: 1, lockout: 8, }, ), ] .into_iter() .collect(); assert_eq!(tower.calculate_weight(&stakes), 0u128); }
rust_cleaned_test_functions.jsonl/113929
{ "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, 24005, 11207, 15876, 33811, 3077, 12993, 368, 341, 286, 1077, 5206, 21271, 284, 21938, 486, 931, 10722, 79, 4953, 623, 2050, 486, 931, 5478, 32509, 7, 17, 701, 220, 15, 11, 220, 15, 13, 21, 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_net_ip() { assert_eq!( net_types::ip::IpAddr::from(net_types::ip::Ipv4Addr::new([192, 168, 0, 1])), net_ip!("192.168.0.1") ); assert_eq!( net_types::ip::IpAddr::from(net_types::ip::Ipv6Addr::new([ 0xFF01, 0, 0, 0, 0, 0, 0, 0x0102 ])), net_ip!("ff01::0102"), ); }
rust_cleaned_test_functions.jsonl/12539
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 256 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 19722, 10385, 368, 341, 286, 2060, 10714, 33673, 310, 4179, 9763, 486, 573, 486, 23378, 13986, 486, 1499, 30723, 9763, 486, 573, 486, 80656, 19, 13986, 486, 931, 2561, 16, 24, 17, 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_flip_h() { let img = setup_default_test_image(); let operation = ImgOp::FlipHorizontal; let (xa, ya) = img.dimensions(); let mut operator = ImageEngine::new(img); let done = operator.ignite(&[Instr::Operation(operation)]); assert!(done.is_ok()); let img_result = done.unwrap(); let (xb, yb) = img_result.dimensions(); assert_eq!(xa, xb); assert_eq!(ya, yb); output_test_image_for_manual_inspection(&img_result, out_!("test_fliph.png")); }
rust_cleaned_test_functions.jsonl/21147
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 260 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 56012, 1523, 368, 341, 286, 1077, 4964, 284, 6505, 9993, 4452, 4954, 543, 286, 1077, 5666, 284, 49930, 7125, 486, 46808, 15837, 401, 286, 1077, 320, 9591, 11, 13526, 8, 284, 4964, 77892, 543, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_slice_out_of_bounds_1() { let x: Vec<int> = vec![1, 2, 3, 4, 5]; x[-1..]; }
rust_cleaned_test_functions.jsonl/98377
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 74 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 26488, 6068, 3575, 36878, 62, 16, 368, 341, 286, 1077, 856, 25, 11312, 4159, 29, 284, 7486, 20703, 16, 11, 220, 17, 11, 220, 18, 11, 220, 19, 11, 220, 20, 935, 286, 856, 7609, 16, 496, 935...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
1
#[test] fn test_substitutions_compose() -> Result<()> { for s in SUBSTITUTIONS.0.iter().chain(SUBSTITUTIONS.1.iter()) { assert_eq!(&decode(&encode(s)), s); } Ok(()) }
rust_cleaned_test_functions.jsonl/83023
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 115 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 5228, 92678, 2965, 2900, 368, 1464, 5714, 71698, 341, 286, 369, 274, 304, 16140, 25765, 28617, 50, 13, 15, 19471, 1005, 8819, 3759, 4493, 25765, 28617, 50, 13, 16, 19471, 2140, 341, 310, 2060, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]
2
#[test] fn test_legit_message() { let buf: Vec<u8> = vec![ 0x10,0x00,0x81,0x80, 0x00,0x01,0x00,0x01, 0x00,0x00,0x00,0x00, 0x03,b'w',b'w',b'w', 0x07,b'e',b'x',b'a', b'm',b'p',b'l',b'e', 0x03,b'c',b'o',b'm', 0x00, // 0 = endname 0x00,0x01,0x00,0x01, 0xC0,0x0C, 0x00,0x01,0x00,0x01, 0x00,0x00,0x00,0x02, // TTL = 2 seconds 0x00,0x04, 0x5D,0xB8,0xD8,0x22, ]; let mut decoder = BinDecoder::new(&buf); let message = Message::read(&mut decoder).unwrap(); assert_eq!(message.id(), 4096); let mut buf: Vec<u8> = Vec::with_capacity(512); { let mut encoder = BinEncoder::new(&mut buf); message.emit(&mut encoder).unwrap(); } let mut decoder = BinDecoder::new(&buf); let message = Message::read(&mut decoder).unwrap(); assert_eq!(message.id(), 4096); }
rust_cleaned_test_functions.jsonl/23871
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 499 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 64122, 275, 6462, 368, 341, 262, 1077, 6607, 25, 11312, 34837, 23, 29, 284, 7486, 90515, 220, 220, 15, 87, 16, 15, 11, 15, 87, 15, 15, 11, 15, 87, 23, 16, 11, 15, 87, 23, 15, 11, 715, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_template_metadata_with_handlebars() { let client = Client::debug(rocket()).unwrap(); let response = client.get("/hbs/test").dispatch(); assert_eq!(response.status(), Status::Ok); let response = client.get("/hbs/not_existing").dispatch(); assert_eq!(response.status(), Status::NotFound); let response = client.get("/tera/test").dispatch(); assert_eq!(response.status(), Status::NotFound); }
rust_cleaned_test_functions.jsonl/84753
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 188 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 8693, 22220, 6615, 10630, 24950, 368, 341, 286, 1077, 2943, 284, 8423, 486, 8349, 7, 46790, 6011, 15454, 1428, 286, 1077, 2033, 284, 2943, 670, 4283, 71, 1279, 12697, 1827, 18274, 543, 286, 2060, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_calc_balances() { let mut context = get_context(accounts(1)); testing_env!(context.build()); let mut contract = Contract::new(); let base_agent_storage: u128 = 2260000000000000000000; contract.calc_balances(); testing_env!(context .is_view(false) .attached_deposit(ONE_NEAR * 5) .build()); contract.create_task( accounts(3), "increment".to_string(), "0 0 */1 * * *".to_string(), Some(true), Some(U128::from(ONE_NEAR)), Some(200), None, ); contract.register_agent(Some(accounts(1))); testing_env!(context.is_view(false).build()); // recalc the balances let (surplus, rewards) = contract.calc_balances(); testing_env!(context.is_view(true).build()); assert_eq!(contract.available_balance, 0); assert_eq!(surplus.0, 0); assert_eq!(rewards.0, base_agent_storage); }
rust_cleaned_test_functions.jsonl/74940
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 516 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 38241, 56441, 3020, 368, 341, 286, 1077, 5206, 2266, 284, 633, 8467, 91868, 7, 16, 1106, 286, 7497, 15879, 10297, 2147, 13239, 1423, 286, 1077, 5206, 5116, 284, 19185, 486, 931, 543, 286, 1077, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_set_flags_6() { let (flags, rest, _) = set_flags(svec!["deno", "gist.ts", "--title", "X", "--allow-net"]).unwrap(); assert_eq!(rest, svec!["deno", "gist.ts", "--title", "X"]); assert_eq!( flags, DenoFlags { allow_net: true, ..DenoFlags::default() } ) }
rust_cleaned_test_functions.jsonl/133076
{ "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, 2602, 14130, 62, 21, 368, 341, 220, 1077, 320, 11161, 11, 2732, 11, 27439, 4035, 262, 738, 14130, 1141, 4083, 0, 1183, 5183, 78, 497, 330, 95294, 21288, 497, 14482, 2102, 497, 330, 55, 497, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_pages_needed_to_store() { let h = Header { page_size: 4096, maximum_valid_page_number: 15, }; assert_eq!(h.pages_needed_to_store(0), 0); assert_eq!(h.pages_needed_to_store(1), 1); assert_eq!(h.pages_needed_to_store(1024), 1); assert_eq!(h.pages_needed_to_store(2048), 1); assert_eq!(h.pages_needed_to_store(4095), 1); assert_eq!(h.pages_needed_to_store(4096), 1); assert_eq!(h.pages_needed_to_store(4097), 2); }
rust_cleaned_test_functions.jsonl/124302
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 331 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 21655, 57426, 2346, 14809, 368, 341, 310, 1077, 305, 284, 12104, 341, 394, 2150, 2368, 25, 220, 19, 15, 24, 21, 345, 394, 7192, 8337, 6129, 5500, 25, 220, 16, 20, 345, 310, 2605, 310, 2060, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
1
#[test] fn test_ease_point_linear() { let start = Point { x: 0.0, y: 0.0 }; let end = Point { x: 1.0, y: 1.0 }; assert_eq!(ease_point(ease_linear, start, end, 1.0), end); }
rust_cleaned_test_functions.jsonl/40069
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 110 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2204, 519, 6085, 40674, 368, 341, 286, 1077, 1191, 284, 5126, 314, 856, 25, 220, 15, 13, 15, 11, 379, 25, 220, 15, 13, 15, 2605, 286, 1077, 835, 284, 5126, 314, 856, 25, 220, 16, 13, 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_to_eps() { let plot = create_test_plot(); let dst = PathBuf::from("example.eps"); plot.to_eps(&dst, 1024, 680); assert!(dst.exists()); std::fs::remove_file(&dst); assert!(!dst.exists()); }
rust_cleaned_test_functions.jsonl/121960
{ "file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl", "token_count": 137 }
[ 262, 11506, 1944, 921, 262, 5168, 1273, 2346, 74996, 368, 341, 286, 1077, 7089, 284, 1855, 4452, 24351, 543, 286, 1077, 10648, 284, 7933, 15064, 486, 1499, 445, 8687, 85405, 797, 286, 7089, 2389, 74996, 2099, 15658, 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...
1