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_update_new_slot() {
solana_logger::setup();
let key = Keypair::new();
let mut index = AccountsIndex::<bool>::default();
let ancestors = vec![(0, 0)].into_iter().collect();
let mut gc = Vec::new();
index.insert(0, &key.pubkey(), true, &mut gc);
assert!(gc.is_empty());
index.insert(1, &key.pubkey(), false, &mut gc);
assert!(gc.is_empty());
let (list, idx) = index.get(&key.pubkey(), &ancestors).unwrap();
assert_eq!(list[idx], (0, true));
let ancestors = vec![(1, 0)].into_iter().collect();
let (list, idx) = index.get(&key.pubkey(), &ancestors).unwrap();
assert_eq!(list[idx], (1, false));
} | rust_cleaned_test_functions.jsonl/20404 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 346
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8882,
5921,
27563,
368,
341,
286,
2048,
3362,
27413,
486,
15188,
543,
286,
1077,
1376,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
5206,
1922,
284,
40655,
1552,
27638,
2641,
6831,
2258,
543,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_writer_append() {
let schema = Schema::from_str(SCHEMA).unwrap();
let mut writer = Writer::new(schema.clone(), Vec::new());
let mut record = Record::new(schema.top_node()).unwrap();
record.put("a", 27i64);
record.put("b", "foo");
let n1 = writer.append(record.clone()).unwrap();
let n2 = writer.append(record.clone()).unwrap();
let n3 = writer.flush().unwrap();
let result = writer.into_inner();
assert_eq!(n1 + n2 + n3, result.len());
let mut header = Vec::new();
header.extend(vec![b'O', b'b', b'j', b'\x01']);
let mut data = Vec::new();
zig_i64(27, &mut data);
zig_i64(3, &mut data);
data.extend(vec![b'f', b'o', b'o'].into_iter());
let data_copy = data.clone();
data.extend(data_copy);
// starts with magic
assert_eq!(
result
.iter()
.cloned()
.take(header.len())
.collect::<Vec<u8>>(),
header
);
// ends with data and sync marker
assert_eq!(
result
.iter()
.cloned()
.rev()
.skip(16)
.take(data.len())
.collect::<Vec<u8>>()
.into_iter()
.rev()
.collect::<Vec<u8>>(),
data
);
} | rust_cleaned_test_functions.jsonl/43035 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 828
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
28908,
26041,
368,
341,
286,
1077,
10802,
284,
12539,
486,
1499,
2895,
59461,
35839,
568,
15454,
543,
286,
1077,
5206,
6916,
284,
29404,
486,
931,
42735,
15997,
1507,
11312,
486,
931,
5231,
286,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_command() {
let mut buffer = [0; 128];
let value = CommandBuilder::create_test(&mut buffer, true)
.named("+TEST")
.finish()
.unwrap();
assert_eq!(core::str::from_utf8(value).unwrap(), "AT+TEST=?\r\n");
} | rust_cleaned_test_functions.jsonl/116949 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 152
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10811,
368,
341,
286,
1077,
5206,
4147,
284,
508,
15,
26,
220,
16,
17,
23,
935,
286,
1077,
897,
284,
7348,
3297,
486,
3182,
4452,
2099,
6984,
4147,
11,
830,
340,
310,
659,
30245,
34973,
10033,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_mount() {
let mut blobfs: FilesystemMock = FilesystemMock::new();
let result = match mount_filesystem(&mut blobfs) {
Ok(()) => true,
_ => false,
};
assert!(result);
assert!(blobfs.mount_called);
} | rust_cleaned_test_functions.jsonl/74757 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 144
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
57593,
368,
341,
286,
1077,
5206,
23404,
3848,
25,
2887,
8948,
11571,
284,
2887,
8948,
11571,
486,
931,
543,
286,
1077,
1102,
284,
2432,
6470,
2458,
8948,
2099,
6984,
23404,
3848,
8,
341,
310,
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... | 2 |
#[test]
fn test_merge_sorted_postinglist_sort_issue() {
create_test_index_posting_list_issue(Some(IndexSettings {
sort_by_field: Some(IndexSortByField {
field: "intval".to_string(),
order: Order::Desc,
}),
..Default::default()
}));
} | rust_cleaned_test_functions.jsonl/66288 | {
"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,
20888,
41277,
6333,
287,
1607,
18435,
53340,
368,
341,
286,
1855,
4452,
3560,
6333,
287,
2019,
53340,
65405,
45030,
6086,
341,
310,
3378,
3710,
5013,
25,
4329,
45030,
10231,
1359,
1877,
341,
394,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_string_array() {
let data = [
0xe1, 0x2e, 0x01, 0x00, 0x03, 0x00, 0x0f, 0x00, 0x0a, 0x00, 0x41, 0x72, 0x74, 0x20,
0x6f, 0x66, 0x20, 0x57, 0x61, 0x72, 0x0f, 0x00, 0x14, 0x00, 0x43, 0x6f, 0x6e, 0x71,
0x75, 0x65, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x61, 0x72, 0x61, 0x64, 0x69,
0x73, 0x65, 0x0f, 0x00, 0x0b, 0x00, 0x52, 0x65, 0x73, 0x20, 0x50, 0x75, 0x62, 0x6c,
0x69, 0x63, 0x61, 0x0f, 0x00, 0x11, 0x00, 0x57, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x20,
0x6f, 0x66, 0x20, 0x4e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x04, 0x00,
];
let tape = parse(&data[..]).unwrap();
assert_eq!(
tape.token_tape,
vec![
BinaryToken::Token(0x2ee1),
BinaryToken::Array(6),
BinaryToken::Quoted(Scalar::new(b"Art of War")),
BinaryToken::Quoted(Scalar::new(b"Conquest of Paradise")),
BinaryToken::Quoted(Scalar::new(b"Res Publica")),
BinaryToken::Quoted(Scalar::new(b"Wealth of Nations")),
BinaryToken::End(1),
]
);
} | rust_cleaned_test_functions.jsonl/109412 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 766
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3904,
3858,
368,
341,
286,
1077,
821,
284,
2278,
310,
220,
15,
8371,
16,
11,
220,
15,
87,
17,
68,
11,
220,
15,
87,
15,
16,
11,
220,
15,
87,
15,
15,
11,
220,
15,
87,
15,
18,
11,
220,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_apply_unattributed_but_bound_TuringString_with_returned() {
let mut cc = ConjoiningGerunds::default();
let mut schemaReplicant = SchemaReplicant::default();
associate_causetId(&mut schemaReplicant, Keyword::namespaced("foo", "bar"), 99);
add_attribute(&mut schemaReplicant, 99, Attribute {
value_type: MinkowskiValueType::Boolean,
..Default::default()
});
let x = ToUpper::from_valid_name("?x");
let a = ToUpper::from_valid_name("?a");
let v = ToUpper::from_valid_name("?v");
cc.input_variables.insert(a.clone());
cc.value_ConstrainedEntss.insert(a.clone(), MinkowskiType::typed_ns_keyword("foo", "bar"));
let knownCauset = KnownCauset::for_schemaReplicant(&schemaReplicant);
cc.apply_parsed_TuringString(knownCauset, TuringString {
source: None,
instanton: TuringStringNonValuePlace::ToUpper(x.clone()),
attribute: TuringStringNonValuePlace::ToUpper(a.clone()),
value: TuringStringValuePlace::ToUpper(v.clone()),
causetx: TuringStringNonValuePlace::Placeholder,
});
let d0_e = QualifiedAlias::new("Causets00".to_string(), CausetsCausetIndex::Instanton);
let d0_a = QualifiedAlias::new("Causets00".to_string(), CausetsCausetIndex::Attribute);
assert!(!cc.is_known_empty());
assert_eq!(cc.from, vec![SourceAlias(CausetsBlock::Causets, "Causets00".to_string())]);
assert_eq!(cc.known_type(&x), Some(MinkowskiValueType::Ref));
assert!(!cc.extracted_types.contains_key(&v));
assert_eq!(cc.known_type(&v), Some(MinkowskiValueType::Boolean));
assert_eq!(cc.CausetIndex_ConstrainedEntss.get(&x).unwrap(), &vec![d0_e.clone()]);
assert_eq!(cc.wheres, vec![
CausetIndexConstraint::Equals(d0_a, CausetQValue::SolitonId(99)),
].into());
} | rust_cleaned_test_functions.jsonl/32588 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 917
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
36551,
4907,
44113,
2774,
86874,
19447,
1139,
1677,
703,
6615,
12511,
291,
368,
341,
286,
1077,
5206,
12527,
284,
1200,
65205,
65397,
42950,
486,
2258,
543,
286,
1077,
5206,
10802,
18327,
35237,
284... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_str_components() {
macro_rules! t(
(b: $arg:expr, $exp:expr) => (
{
let path = Path::new($arg);
let comps = path.str_components().collect::<Vec<Option<&str>>>();
let exp: &[Option<&str>] = $exp;
assert_eq!(comps.as_slice(), exp);
let comps = path.str_components().rev().collect::<Vec<Option<&str>>>();
let exp = exp.iter().rev().map(|&x|x).collect::<Vec<Option<&str>>>();
assert_eq!(comps, exp);
}
)
)
t!(b: b"a/b/c", [Some("a"), Some("b"), Some("c")]);
t!(b: b"/\xFF/a/\x80", [None, Some("a"), None]);
t!(b: b"../../foo\xCDbar", [Some(".."), Some(".."), None]);
// the full set of tests
} | rust_cleaned_test_functions.jsonl/7699 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 513
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2895,
23258,
368,
341,
286,
18072,
21407,
0,
259,
1006,
310,
320,
65,
25,
400,
858,
96011,
11,
400,
4580,
96011,
8,
589,
2399,
394,
341,
503,
1077,
1815,
284,
7933,
486,
931,
699,
858,
317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_blob_url_simulated_dir() {
let url = "https://myaccount.blob.core.windows.net/mycontainer/mydir/myblob";
let url = into_urls(&[url]).remove(0);
let url = BlobUrl::new(url).expect("invalid blob URL");
assert_eq!(url.account(), Some("myaccount".into()));
assert_eq!(url.container(), Some("mycontainer".into()));
assert_eq!(url.name(), "mydir/myblob");
} | rust_cleaned_test_functions.jsonl/81898 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 191
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45908,
2903,
18314,
7757,
4334,
368,
341,
286,
1077,
2515,
284,
330,
2428,
1110,
2408,
4608,
96281,
4871,
68113,
5071,
34198,
3586,
34198,
3741,
34198,
35112,
876,
286,
1077,
2515,
284,
1119,
32822,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_import_statement() {
expect_printed("import \"a\";", "import \"a\";\n");
expect_printed("import a from \"b\"", "import a from \"b\";\n");
expect_printed("import { a } from \"b\"", "import { a } from \"b\";\n");
expect_printed(
"import { a, b } from \"b\"",
"import { a, b } from \"b\";\n",
);
expect_printed(
"import { a as b } from \"b\";",
"import { a as b } from \"b\";\n",
);
expect_printed(
"import { a, b } from \"b\"",
"import { a, b } from \"b\";\n",
);
expect_printed(
"import { a as b, b as c } from \"b\";",
"import { a as b, b as c } from \"b\";\n",
);
expect_printed(
"import a, { b as c } from \"b\";",
"import a, { b as c } from \"b\";\n",
);
expect_printed(
"import a, { b } from \"b\"",
"import a, { b } from \"b\";\n",
);
expect_printed("import * as a from \"b\"", "import * as a from \"b\";\n");
expect_printed(
"import a, * as b from \"b\"",
"import a, * as b from \"b\";\n",
);
} | rust_cleaned_test_functions.jsonl/93418 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 537
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18434,
37404,
368,
341,
262,
1720,
10064,
291,
445,
474,
7245,
64,
2105,
32503,
330,
474,
7245,
64,
2105,
17882,
77,
797,
262,
1720,
10064,
291,
445,
474,
264,
504,
7245,
65,
55853,
330,
474,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_twin_double_fails() {
ExternalityBuilder::build().execute_with(|| {
create_twin();
let ip = "10.2.3.3";
assert_noop!(
TfgridModule::create_twin(Origin::signed(alice()), ip.as_bytes().to_vec()),
Error::<TestRuntime>::TwinWithPubkeyExists
);
});
} | rust_cleaned_test_functions.jsonl/35354 | {
"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,
8657,
528,
7526,
24598,
761,
6209,
368,
341,
262,
1374,
4160,
2719,
3297,
486,
5834,
1005,
10257,
6615,
79453,
341,
286,
1855,
528,
7526,
1428,
286,
1077,
5997,
284,
330,
16,
15,
13,
17,
13,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_position_at_time_other_direction() {
let motion = BiArcCurveMotion::new(
0.,
Isometry::from_parts(Translation::from(Vector3::new(0., 0., 0.)), UnitQuaternion::identity()),
Vector3::new(0., 0., 1.),
Unit::new_normalize(Vector3::new(1., 0., 0.)),
45.0_f32.to_radians() as f32,
10.,
10.,
1.,
45.0_f32.to_radians() as f32,
10.,
10.,
1.,
);
assert_eq!(motion.position_at_time(-27.07106781).translation.vector, Vector3::new(0., -12.9289322, -27.07106781));
assert_eq!(motion.position_at_time(-17.07106781).translation.vector, Vector3::new(0., -2.9289322, -17.07106781));
assert_eq!(motion.position_at_time(-10.).translation.vector, Vector3::new(0., 0., -10.));
assert_eq!(motion.position_at_time(0.).translation.vector, Vector3::new(0., 0., 0.));
assert_eq!(motion.position_at_time(10.).translation.vector, Vector3::new(0., 0., 10.));
assert_eq!(motion.position_at_time(17.07106781).translation.vector, Vector3::new(0., -2.9289322, 17.07106781));
assert_eq!(motion.position_at_time(27.07106781).translation.vector, Vector3::new(0., -12.9289322, 27.07106781));
} | rust_cleaned_test_functions.jsonl/6604 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 646
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9661,
3752,
3009,
30456,
25438,
368,
341,
286,
1077,
11379,
284,
12100,
36809,
31325,
40338,
486,
931,
1006,
310,
220,
15,
38088,
310,
2160,
6988,
486,
1499,
33217,
7,
24412,
486,
1499,
20258,
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_check_program_subscribe() {
let GenesisBlockInfo {
genesis_block,
mint_keypair,
..
} = create_genesis_block(100);
let bank = Bank::new(&genesis_block);
let blockhash = bank.last_blockhash();
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let alice = Keypair::new();
let tx = system_transaction::create_account(
&mint_keypair,
&alice.pubkey(),
blockhash,
1,
16,
&morgan_budget_api::id(),
);
bank_forks
.write()
.unwrap()
.get(0)
.unwrap()
.process_transaction(&tx)
.unwrap();
let (subscriber, _id_receiver, mut transport_receiver) =
Subscriber::new_test("programNotification");
let sub_id = SubscriptionId::Number(0 as u64);
let sink = subscriber.assign_id(sub_id.clone()).unwrap();
let subscriptions = RpcSubscriptions::default();
subscriptions.add_program_subscription(&morgan_budget_api::id(), None, &sub_id, &sink);
assert!(subscriptions
.program_subscriptions
.read()
.unwrap()
.contains_key(&morgan_budget_api::id()));
subscriptions.check_program(&morgan_budget_api::id(), 0, &bank_forks);
let string = transport_receiver.poll();
if let Async::Ready(Some(response)) = string.unwrap() {
let expected = format!(r#"{{"jsonrpc":"2.0","method":"programNotification","params":{{"result":["{:?}",{{"data":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"difs":1,"executable":false,"owner":[2,203,81,223,225,24,34,35,203,214,138,130,144,208,35,77,63,16,87,51,47,198,115,123,98,188,19,160,0,0,0,0],"reputations":0}}],"subscription":0}}}}"#, alice.pubkey());
assert_eq!(expected, response);
}
subscriptions.remove_program_subscription(&sub_id);
assert!(!subscriptions
.program_subscriptions
.read()
.unwrap()
.contains_key(&morgan_budget_api::id()));
} | rust_cleaned_test_functions.jsonl/37727 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1090
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
25096,
88935,
368,
341,
286,
1077,
40788,
4713,
1731,
341,
310,
59366,
7113,
345,
310,
28337,
3097,
12670,
345,
310,
54538,
286,
335,
284,
1855,
16322,
13774,
7113,
7,
16,
15,
15,
317,
286... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_accessdenied() {
let raised: Result<(), GoogleJWTError> = Err(GoogleJWTError {
error: GoogleJWTErrorType::AccessDenied,
error_description: ACCESSDENIED_MSG.to_string(),
});
assert_eq!(raised.is_err(), true);
match raised {
Ok(_) => {}
Err(error) => {
assert_eq!(error.error, GoogleJWTErrorType::AccessDenied);
assert_eq!(error.error_description, ACCESSDENIED_MSG);
}
};
} | rust_cleaned_test_functions.jsonl/24084 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 271
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
12759,
5183,
1122,
368,
341,
286,
1077,
9226,
25,
5714,
68843,
5085,
55172,
1454,
29,
284,
15495,
6699,
2671,
55172,
1454,
341,
310,
1465,
25,
5085,
55172,
1454,
929,
486,
6054,
54481,
345,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_solid_character_null() {
let mut cmd = assert_cmd::Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
cmd.args(&["-sz", "-c", "1", "--", "tr", "[:alnum:]", "@"])
.write_stdin("ABC\nDEF\n\0GHI\nJKL")
.assert()
.stdout("@BC\nDEF\n\0@HI\nJKL");
} | rust_cleaned_test_functions.jsonl/7917 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 184
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
643,
5192,
40988,
15162,
368,
341,
286,
1077,
5206,
5439,
284,
2060,
11684,
486,
4062,
486,
66715,
21816,
16978,
17223,
34,
7581,
46,
94126,
4708,
15197,
15454,
543,
286,
5439,
16365,
2099,
1183,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_guild_update() {
let cache = InMemoryCache::new();
let guild = Guild {
afk_channel_id: None,
afk_timeout: 0,
application_id: None,
approximate_member_count: None,
approximate_presence_count: None,
banner: None,
channels: HashMap::new(),
default_message_notifications: DefaultMessageNotificationLevel::Mentions,
description: None,
discovery_splash: None,
emojis: HashMap::new(),
explicit_content_filter: ExplicitContentFilter::None,
features: Vec::new(),
icon: None,
id: GuildId(1),
joined_at: None,
large: false,
lazy: None,
max_members: None,
max_presences: None,
max_video_channel_users: None,
member_count: None,
members: HashMap::new(),
mfa_level: MfaLevel::None,
name: "test".to_owned(),
owner_id: UserId(1),
owner: None,
permissions: None,
preferred_locale: "en_us".to_owned(),
premium_subscription_count: None,
premium_tier: PremiumTier::None,
presences: HashMap::new(),
region: "us".to_owned(),
roles: HashMap::new(),
rules_channel_id: None,
splash: None,
system_channel_flags: SystemChannelFlags::empty(),
system_channel_id: None,
unavailable: false,
vanity_url_code: None,
verification_level: VerificationLevel::VeryHigh,
voice_states: HashMap::new(),
widget_channel_id: None,
widget_enabled: None,
};
cache.update(&GuildCreate(guild.clone()));
let mutation = PartialGuild {
id: guild.id,
afk_channel_id: guild.afk_channel_id,
afk_timeout: guild.afk_timeout,
application_id: guild.application_id,
banner: guild.banner,
default_message_notifications: guild.default_message_notifications,
description: guild.description,
discovery_splash: guild.discovery_splash,
emojis: guild.emojis,
explicit_content_filter: guild.explicit_content_filter,
features: guild.features,
icon: guild.icon,
max_members: guild.max_members,
max_presences: guild.max_presences,
member_count: guild.member_count,
mfa_level: guild.mfa_level,
name: "test2222".to_owned(),
owner_id: UserId(2),
owner: guild.owner,
permissions: guild.permissions,
preferred_locale: guild.preferred_locale,
premium_subscription_count: guild.premium_subscription_count,
premium_tier: guild.premium_tier,
region: guild.region,
roles: guild.roles,
rules_channel_id: guild.rules_channel_id,
splash: guild.splash,
system_channel_flags: guild.system_channel_flags,
system_channel_id: guild.system_channel_id,
verification_level: guild.verification_level,
vanity_url_code: guild.vanity_url_code,
widget_channel_id: guild.widget_channel_id,
widget_enabled: guild.widget_enabled,
};
cache.update(&GuildUpdate(mutation.clone()));
assert_eq!(cache.guild(guild.id).unwrap().name, mutation.name);
assert_eq!(cache.guild(guild.id).unwrap().owner_id, mutation.owner_id);
assert_eq!(cache.guild(guild.id).unwrap().id, mutation.id);
} | rust_cleaned_test_functions.jsonl/88893 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1846
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1889,
1498,
8882,
368,
341,
286,
1077,
6500,
284,
758,
10642,
8233,
486,
931,
543,
286,
1077,
26411,
284,
32492,
341,
310,
7977,
74,
14571,
842,
25,
2240,
345,
310,
7977,
74,
20537,
25,
220,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_basic_qc() {
let runtime = consensus_runtime();
let (pm, mut new_round_events_receiver) = make_pacemaker(&runtime);
block_on(async move {
// Wait for the initial event for the first round.
expect_qc(1, &mut new_round_events_receiver).await;
pm.process_certificates(2, None).await;
pm.process_certificates(3, None).await;
expect_qc(3, &mut new_round_events_receiver).await;
expect_qc(4, &mut new_round_events_receiver).await;
});
} | rust_cleaned_test_functions.jsonl/37899 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 228
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34729,
8976,
66,
368,
341,
262,
1077,
15592,
284,
23869,
33232,
543,
262,
1077,
320,
5187,
11,
5206,
501,
29896,
19691,
65691,
8,
284,
1281,
620,
580,
58675,
2099,
22255,
626,
262,
2504,
4470,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_serde_request() {
let id = Uuid::new_v4();
let mut request = raft_cmdpb::ReadIndexRequest::default();
request.set_start_ts(10);
let mut locked = LockInfo::default();
locked.set_lock_version(5);
let ctx = ReadIndexContext {
id,
request: Some(request),
locked: Some(locked),
};
let bytes = ctx.to_bytes();
let parsed_ctx = ReadIndexContext::parse(&bytes).unwrap();
assert_eq!(ctx, parsed_ctx);
} | rust_cleaned_test_functions.jsonl/57413 | {
"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,
75861,
450,
7893,
368,
341,
286,
1077,
877,
284,
547,
2423,
486,
931,
2273,
19,
543,
286,
1077,
5206,
1681,
284,
52455,
11684,
16650,
486,
4418,
1552,
1900,
486,
2258,
543,
286,
1681,
980,
4906,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_local_dispatcher_broadcast_message() {
let handler = Box::new(CustomHandler::new(false));
let instance = Dispatcher::default().with_handler(handler.clone());
let (sender, _) = mpsc::unbounded();
let path = Arc::new(BastionPath::root());
const DATA: &str = "A message containing data (ask).";
let message = Arc::new(SignedMessage::new(
Msg::broadcast(DATA),
RefAddr::new(path, sender),
));
instance.broadcast_message(&message);
let handler_was_called = handler.was_called();
assert_eq!(handler_was_called, true);
} | rust_cleaned_test_functions.jsonl/21759 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 277
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13564,
92189,
74923,
6462,
368,
341,
286,
1077,
7013,
284,
8261,
486,
931,
3025,
1450,
3050,
486,
931,
3576,
1106,
286,
1077,
2867,
284,
58969,
486,
2258,
1005,
4197,
10183,
36514,
15997,
1423,
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_init_size() {
assert!(new_tester(None, 0));
assert!(new_tester(None, 65));
assert!(new_tester(None, 64));
assert!(new_tester(None, 1));
let sk = SecretKey::from_slice(&[0u8; 64]).unwrap();
assert!(new_tester(Some(&sk), 0));
assert!(new_tester(Some(&sk), 65));
assert!(new_tester(Some(&sk), 64));
assert!(new_tester(Some(&sk), 1));
} | rust_cleaned_test_functions.jsonl/56748 | {
"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,
6137,
2368,
368,
341,
310,
2060,
10297,
931,
4452,
261,
26717,
11,
220,
15,
1106,
310,
2060,
10297,
931,
4452,
261,
26717,
11,
220,
21,
20,
1106,
310,
2060,
10297,
931,
4452,
261,
26717,
11,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_pause() {
let f = || {
fail_point!("pause");
};
f();
fail::cfg("pause", "pause").unwrap();
let (tx, rx) = mpsc::channel();
thread::spawn(move || {
// pause
tx.send(f()).unwrap();
tx.send(f()).unwrap();
tx.send(f()).unwrap();
});
assert!(rx.recv_timeout(Duration::from_millis(500)).is_err());
fail::cfg("pause", "pause").unwrap();
rx.recv_timeout(Duration::from_millis(500)).unwrap();
assert!(rx.recv_timeout(Duration::from_millis(500)).is_err());
fail::remove("pause");
rx.recv_timeout(Duration::from_millis(500)).unwrap();
rx.recv_timeout(Duration::from_millis(500)).unwrap();
} | rust_cleaned_test_functions.jsonl/102082 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 337
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
59989,
368,
341,
262,
1077,
282,
284,
1369,
341,
286,
3690,
6085,
17223,
27448,
797,
262,
2605,
262,
282,
1428,
262,
3690,
486,
14072,
445,
27448,
497,
330,
27448,
1827,
15454,
543,
262,
1077,
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... | 3 |
#[test]
fn test_duration_as_string() {
test_none_with_ctx_and_extra(cast_any_as_string::<Duration>);
let cs = vec![
(
Duration::parse(b"17:51:04.78", 2).unwrap(),
"17:51:04.78".to_string().into_bytes(),
"17:51:04.78".to_string(),
),
(
Duration::parse(b"-17:51:04.78", 2).unwrap(),
"-17:51:04.78".to_string().into_bytes(),
"-17:51:04.78".to_string(),
),
(
Duration::parse(b"17:51:04.78", 0).unwrap(),
"17:51:05".to_string().into_bytes(),
"17:51:05".to_string(),
),
(
Duration::parse(b"-17:51:04.78", 0).unwrap(),
"-17:51:05".to_string().into_bytes(),
"-17:51:05".to_string(),
),
];
test_as_string_helper(
cs,
cast_any_as_string::<Duration>,
"cast_any_as_string::<Duration>",
);
} | rust_cleaned_test_functions.jsonl/101792 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 653
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
25454,
11898,
3904,
368,
341,
286,
1273,
31488,
6615,
15147,
8378,
31858,
1337,
559,
37248,
11898,
3904,
27638,
12945,
29,
626,
286,
1077,
10532,
284,
7486,
90515,
310,
2399,
394,
21045,
486,
6400,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_be() {
let mut rng = thread_rng();
let num: u128 = rng.gen();
let (my, test) = get_uints(num);
assert_eq!(test.to_be_bytes(), my.into_be_bytes());
} | rust_cleaned_test_functions.jsonl/6626 | {
"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,
21263,
368,
341,
286,
1077,
5206,
28422,
284,
4516,
66849,
543,
286,
1077,
1629,
25,
575,
16,
17,
23,
284,
28422,
22822,
543,
286,
1077,
320,
2408,
11,
1273,
8,
284,
633,
15807,
82,
8068,
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 |
#[test]
fn test_bed() {
let builder = Builder::bed();
assert_eq!(builder.format, Format::Generic(CoordinateSystem::Bed));
assert_eq!(builder.reference_sequence_name_index, 1);
assert_eq!(builder.start_position_index, 2);
assert_eq!(builder.end_position_index, Some(3));
assert_eq!(builder.line_comment_prefix, b'#');
assert_eq!(builder.line_skip_count, 0);
} | rust_cleaned_test_functions.jsonl/102499 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 185
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
89079,
368,
341,
286,
1077,
7363,
284,
20626,
486,
2721,
543,
286,
2060,
10714,
10297,
17850,
8021,
11,
15042,
486,
19964,
3025,
78,
8730,
2320,
486,
15686,
1106,
286,
2060,
10714,
10297,
17850,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_steps_between() {
assert_eq!(Step::steps_between(&20_u8, &200_u8), Some(180_usize));
assert_eq!(Step::steps_between(&-20_i8, &80_i8), Some(100_usize));
assert_eq!(Step::steps_between(&-120_i8, &80_i8), Some(200_usize));
assert_eq!(Step::steps_between(&20_u32, &4_000_100_u32), Some(4_000_080_usize));
assert_eq!(Step::steps_between(&-20_i32, &80_i32), Some(100_usize));
assert_eq!(Step::steps_between(&-2_000_030_i32, &2_000_050_i32), Some(4_000_080_usize));
// Skip u64/i64 to avoid differences with 32-bit vs 64-bit platforms
assert_eq!(Step::steps_between(&20_u128, &200_u128), Some(180_usize));
assert_eq!(Step::steps_between(&-20_i128, &80_i128), Some(100_usize));
if cfg!(target_pointer_width = "64") {
assert_eq!(Step::steps_between(&10_u128, &0x1_0000_0000_0000_0009_u128), Some(usize::MAX));
}
assert_eq!(Step::steps_between(&10_u128, &0x1_0000_0000_0000_000a_u128), None);
assert_eq!(Step::steps_between(&10_i128, &0x1_0000_0000_0000_000a_i128), None);
assert_eq!(
Step::steps_between(&-0x1_0000_0000_0000_0000_i128, &0x1_0000_0000_0000_0000_i128,),
None,
);
} | rust_cleaned_test_functions.jsonl/108057 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 554
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
22731,
48302,
368,
341,
262,
2060,
10714,
10297,
8304,
486,
24080,
48302,
2099,
17,
15,
7300,
23,
11,
609,
17,
15,
15,
7300,
23,
701,
4329,
7,
16,
23,
15,
11306,
551,
1106,
262,
2060,
10714,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_serialization() {
assert_eq!(json!(MediaType::JavaScript), json!("JavaScript"));
assert_eq!(json!(MediaType::Mjs), json!("Mjs"));
assert_eq!(json!(MediaType::Cjs), json!("Cjs"));
assert_eq!(json!(MediaType::Jsx), json!("JSX"));
assert_eq!(json!(MediaType::TypeScript), json!("TypeScript"));
assert_eq!(json!(MediaType::Mts), json!("Mts"));
assert_eq!(json!(MediaType::Dts), json!("Dts"));
assert_eq!(json!(MediaType::Dmts), json!("Dmts"));
assert_eq!(json!(MediaType::Dcts), json!("Dcts"));
assert_eq!(json!(MediaType::Tsx), json!("TSX"));
assert_eq!(json!(MediaType::Json), json!("Json"));
assert_eq!(json!(MediaType::Wasm), json!("Wasm"));
assert_eq!(json!(MediaType::TsBuildInfo), json!("TsBuildInfo"));
assert_eq!(json!(MediaType::SourceMap), json!("SourceMap"));
assert_eq!(json!(MediaType::Unknown), json!("Unknown"));
} | rust_cleaned_test_functions.jsonl/53922 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 400
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
25602,
2022,
368,
341,
262,
2060,
10714,
10297,
2236,
10297,
65000,
486,
29475,
701,
2951,
17223,
29475,
4010,
262,
2060,
10714,
10297,
2236,
10297,
65000,
486,
44,
2519,
701,
2951,
17223,
44,
2519,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_registration_from_yaml_file() -> Result<()> {
let registration = AppServiceRegistration::try_from_yaml_file("./tests/registration.yaml")?;
assert_eq!(registration.id, "appservice");
Ok(())
} | rust_cleaned_test_functions.jsonl/34973 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 104
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
49101,
5673,
64380,
2458,
368,
1464,
5714,
71698,
341,
286,
1077,
12227,
284,
1845,
1860,
23365,
486,
1539,
5673,
64380,
2458,
13988,
23841,
14,
25862,
33406,
899,
69493,
286,
2060,
10714,
10297,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 2 |
#[test]
fn test_7_4() {
let favourite = 10 as usize;
assert_eq!(11, get_shortest_route(&favourite, (7, 4), None).unwrap());
} | rust_cleaned_test_functions.jsonl/93853 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 76
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
22,
62,
19,
368,
341,
286,
1077,
18696,
284,
220,
16,
15,
438,
22301,
401,
286,
2060,
10714,
10297,
16,
16,
11,
633,
16673,
477,
28109,
2099,
69,
51388,
11,
320,
22,
11,
220,
19,
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 |
#[test]
fn test_category() {
assert!(from_str::<String>("123").unwrap_err().is_data());
assert!(from_str::<String>("]").unwrap_err().is_syntax());
assert!(from_str::<String>("").unwrap_err().is_eof());
assert!(from_str::<String>("\"").unwrap_err().is_eof());
assert!(from_str::<String>("\"\\").unwrap_err().is_eof());
assert!(from_str::<String>("\"\\u").unwrap_err().is_eof());
assert!(from_str::<String>("\"\\u0").unwrap_err().is_eof());
assert!(from_str::<String>("\"\\u00").unwrap_err().is_eof());
assert!(from_str::<String>("\"\\u000").unwrap_err().is_eof());
assert!(from_str::<Vec<usize>>("[").unwrap_err().is_eof());
assert!(from_str::<Vec<usize>>("[0").unwrap_err().is_eof());
assert!(from_str::<Vec<usize>>("[0,").unwrap_err().is_eof());
assert!(
from_str::<BTreeMap<String, usize>>("{")
.unwrap_err()
.is_eof()
);
assert!(
from_str::<BTreeMap<String, usize>>("{\"k\"")
.unwrap_err()
.is_eof()
);
assert!(
from_str::<BTreeMap<String, usize>>("{\"k\":")
.unwrap_err()
.is_eof()
);
assert!(
from_str::<BTreeMap<String, usize>>("{\"k\":0")
.unwrap_err()
.is_eof()
);
assert!(
from_str::<BTreeMap<String, usize>>("{\"k\":0,")
.unwrap_err()
.is_eof()
);
let fail = FailReader(io::ErrorKind::NotConnected);
assert!(from_reader::<_, String>(fail).unwrap_err().is_io());
} | rust_cleaned_test_functions.jsonl/29868 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 795
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11847,
368,
341,
262,
2060,
10297,
1499,
2895,
27638,
703,
13211,
16,
17,
18,
1827,
15454,
9266,
1005,
285,
1769,
5231,
262,
2060,
10297,
1499,
2895,
27638,
703,
13211,
44891,
15454,
9266,
1005,
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_profile_data() {
let stream = {
let mut stream = Stream::default();
let t0 = stream.begin_scope(100, "top", "top.rs", "data_top");
let m1 = stream.begin_scope(200, "middle_0", "middle.rs", "data_middle_0");
stream.end_scope(m1, 300);
let m1 = stream.begin_scope(300, "middle_1", "middle.rs:42", "data_middle_1");
stream.end_scope(m1, 400);
stream.end_scope(t0, 400);
stream
};
let top_scopes = Reader::from_start(&stream).read_top_scopes().unwrap();
assert_eq!(top_scopes.len(), 1);
let middle_scopes = Reader::with_offset(&stream, top_scopes[0].child_begin_position)
.unwrap()
.read_top_scopes()
.unwrap();
assert_eq!(
top_scopes[0].record,
Record {
start_ns: 100,
duration_ns: 300,
id: "top",
location: "top.rs",
data: "data_top",
}
);
assert_eq!(
top_scopes[0].next_sibling_position,
stream.len() as u64,
"Top scope has no siblings"
);
assert_eq!(middle_scopes.len(), 2);
assert_eq!(
middle_scopes[0].record,
Record {
start_ns: 200,
duration_ns: 100,
id: "middle_0",
location: "middle.rs",
data: "data_middle_0",
}
);
assert_eq!(
middle_scopes[1].record,
Record {
start_ns: 300,
duration_ns: 100,
id: "middle_1",
location: "middle.rs:42",
data: "data_middle_1",
}
);
} | rust_cleaned_test_functions.jsonl/7463 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 860
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13789,
1769,
368,
341,
262,
1077,
4269,
284,
341,
286,
1077,
5206,
4269,
284,
9203,
486,
2258,
543,
286,
1077,
259,
15,
284,
4269,
6848,
23199,
7,
16,
15,
15,
11,
330,
3481,
497,
330,
3481,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_serialize_vector() -> Result<(), Box<dyn std::error::Error>> {
let lua = Lua::new();
let globals = lua.globals();
globals.set(
"vector",
lua.create_function(|_, (x, y, z)| Ok(Value::Vector(x, y, z)))?,
)?;
let val = lua.load("{_vector = vector(1, 2, 3)}").eval::<Value>()?;
let json = serde_json::json!({
"_vector": [1.0, 2.0, 3.0],
});
assert_eq!(serde_json::to_value(&val)?, json);
let expected_json = lua.from_value::<serde_json::Value>(val)?;
assert_eq!(expected_json, json);
Ok(())
} | rust_cleaned_test_functions.jsonl/50703 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 278
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
88686,
12247,
368,
1464,
5714,
68843,
8261,
92846,
1460,
486,
841,
486,
1454,
2452,
341,
262,
1077,
20357,
284,
37662,
486,
931,
1428,
262,
1077,
37785,
284,
20357,
1302,
16616,
543,
262,
37785,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 6 |
#[test]
fn test_stb() {
test_interpreter_and_jit_asm!(
"
stb [r1+2], 0x11
ldxb r0, [r1+2]
exit",
[0xaa, 0xbb, 0xff, 0xcc, 0xdd],
(),
{ |_vm, res: Result| { res.unwrap() == 0x11 } },
3
);
} | rust_cleaned_test_functions.jsonl/58993 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 175
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1261,
65,
368,
341,
262,
1273,
15318,
28637,
8378,
5374,
275,
67529,
33673,
286,
6228,
286,
357,
65,
508,
81,
16,
10,
17,
1125,
220,
15,
87,
16,
16,
198,
286,
26129,
7929,
435,
15,
11,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_read_conn_aborted() {
let pool = mocked!();
pool.connect("127.0.0.1", 3000, "http").unwrap();
let mut stream = pool.connect("127.0.0.1", 3000, "http").unwrap();
let err = stream.read(&mut [0]).unwrap_err();
assert_eq!(err.kind(), ::std::io::ErrorKind::ConnectionAborted);
drop(stream);
let locked = pool.inner.lock().unwrap();
assert_eq!(locked.conns.len(), 0);
} | rust_cleaned_test_functions.jsonl/53081 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 208
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
17241,
22885,
13595,
368,
341,
286,
1077,
7314,
284,
46149,
0,
1428,
286,
7314,
10800,
445,
16,
17,
22,
13,
15,
13,
15,
13,
16,
497,
220,
18,
15,
15,
15,
11,
330,
1254,
1827,
15454,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_interval_ym_add_sub_interval_ym() {
assert!(IntervalYM::try_from_ym(178000000, 0)
.unwrap()
.add_interval_ym(IntervalYM::try_from_ym(0, 1).unwrap())
.is_err());
assert!(IntervalYM::try_from_ym(178000000, 0)
.unwrap()
.sub_interval_ym(-IntervalYM::try_from_ym(0, 1).unwrap())
.is_err());
assert!(IntervalYM::try_from_ym(178000000, 0)
.unwrap()
.negate()
.sub_interval_ym(IntervalYM::try_from_ym(0, 1).unwrap())
.is_err());
assert!((-IntervalYM::try_from_ym(178000000, 0).unwrap())
.add_interval_ym(-IntervalYM::try_from_ym(0, 1).unwrap())
.is_err());
assert_eq!(
IntervalYM::try_from_ym(123456, 5)
.unwrap()
.add_interval_ym(IntervalYM::try_from_ym(123, 7).unwrap())
.unwrap(),
IntervalYM::try_from_ym(123580, 0).unwrap()
);
assert_eq!(
IntervalYM::try_from_ym(123456, 5)
.unwrap()
.sub_interval_ym(IntervalYM::try_from_ym(123, 7).unwrap())
.unwrap(),
IntervalYM::try_from_ym(123332, 10).unwrap()
);
} | rust_cleaned_test_functions.jsonl/51037 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 758
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20541,
62,
1600,
2891,
5228,
20541,
62,
1600,
368,
341,
286,
2060,
10297,
10256,
63787,
486,
1539,
5673,
62,
1600,
7,
16,
22,
23,
15,
15,
15,
15,
15,
15,
11,
220,
15,
340,
310,
659,
15454,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_should_preserve_final_newline_when_line_longer_than_fold() {
new_ucmd!()
.arg("-w2")
.pipe_in("1234\n")
.succeeds()
.stdout_is("12\n34\n");
} | rust_cleaned_test_functions.jsonl/23273 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 116
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
43378,
32116,
5852,
20676,
5921,
1056,
47636,
6528,
17799,
261,
51613,
61187,
368,
341,
262,
501,
68887,
2277,
0,
741,
286,
659,
858,
13645,
86,
17,
1138,
286,
659,
13768,
1243,
445,
16,
17,
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_repair_with_repair_validators() {
let cluster_slots = ClusterSlots::default();
let me = ContactInfo::new_localhost(&analog_sdk::pubkey::new_rand(), timestamp());
let cluster_info = Arc::new(new_test_cluster_info(me.clone()));
// Insert two peers on the network
let contact_info2 =
ContactInfo::new_localhost(&analog_sdk::pubkey::new_rand(), timestamp());
let contact_info3 =
ContactInfo::new_localhost(&analog_sdk::pubkey::new_rand(), timestamp());
cluster_info.insert_info(contact_info2.clone());
cluster_info.insert_info(contact_info3.clone());
let serve_repair = ServeRepair::new(cluster_info);
// If:
// 1) repair validator set doesn't exist in gossip
// 2) repair validator set only includes our own id
// then no repairs should be generated
for pubkey in &[analog_sdk::pubkey::new_rand(), me.id] {
let trusted_validators = Some(vec![*pubkey].into_iter().collect());
assert!(serve_repair.repair_peers(&trusted_validators, 1).is_empty());
assert!(serve_repair
.repair_request(
&cluster_slots,
ShredRepairType::Shred(0, 0),
&mut LruCache::new(100),
&mut RepairStats::default(),
&trusted_validators,
&mut OutstandingShredRepairs::default(),
)
.is_err());
}
let trusted_validators = Some(vec![contact_info2.id].into_iter().collect());
let repair_peers = serve_repair.repair_peers(&trusted_validators, 1);
assert_eq!(repair_peers.len(), 1);
assert_eq!(repair_peers[0].id, contact_info2.id);
assert!(serve_repair
.repair_request(
&cluster_slots,
ShredRepairType::Shred(0, 0),
&mut LruCache::new(100),
&mut RepairStats::default(),
&trusted_validators,
&mut OutstandingShredRepairs::default(),
)
.is_ok());
// Using no trusted validators should default to all
let repair_peers: HashSet<Pubkey> = serve_repair
.repair_peers(&None, 1)
.into_iter()
.map(|c| c.id)
.collect();
assert_eq!(repair_peers.len(), 2);
assert!(repair_peers.contains(&contact_info2.id));
assert!(repair_peers.contains(&contact_info3.id));
assert!(serve_repair
.repair_request(
&cluster_slots,
ShredRepairType::Shred(0, 0),
&mut LruCache::new(100),
&mut RepairStats::default(),
&None,
&mut OutstandingShredRepairs::default(),
)
.is_ok());
} | rust_cleaned_test_functions.jsonl/3910 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1470
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1288,
12670,
6615,
1288,
12670,
8337,
2973,
368,
341,
286,
1077,
10652,
54161,
284,
35380,
51647,
486,
2258,
543,
286,
1077,
752,
284,
9180,
1731,
486,
931,
62,
8301,
2099,
276,
30951,
61783,
486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_matrix_swap_columns() {
let mut result = Matrix2x2::new(1, 2, 3, 4);
result.swap_columns(0, 1);
let expected = Matrix2x2::new(3, 4, 1, 2);
assert_eq!(result, expected);
} | rust_cleaned_test_functions.jsonl/128984 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 128
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10193,
40991,
22590,
368,
341,
286,
1077,
5206,
1102,
284,
11631,
17,
87,
17,
486,
931,
7,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
317,
286,
1102,
54537,
22590,
7,
15,
11,
220,
16,
317,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_mv_rename_dir() {
let (at, mut ucmd) = at_and_ucmd!();
let dir1 = "test_mv_rename_dir";
let dir2 = "test_mv_rename_dir2";
at.mkdir(dir1);
ucmd.arg(dir1).arg(dir2).succeeds().no_stderr();
assert!(at.dir_exists(dir2));
} | rust_cleaned_test_functions.jsonl/41602 | {
"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,
73187,
79399,
4334,
368,
341,
262,
1077,
320,
266,
11,
5206,
575,
8710,
8,
284,
518,
8378,
68887,
2277,
0,
543,
262,
1077,
5419,
16,
284,
330,
1944,
73187,
79399,
4334,
876,
262,
1077,
5419,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_input_stream_must_support_read() {
let mut ctx = TestContext::new("");
let is = ctx.as_stream(
/*isatty=*/ true, /*support_read=*/ false, /*support_write=*/ false,
);
let os = ctx.as_stream(
/*isatty=*/ true, /*support_read=*/ false, /*support_write=*/ true,
);
assert!(prompt_for_string(is, os, TEST_PROMPT, /*is_sensitive=*/ false).is_err());
} | rust_cleaned_test_functions.jsonl/110976 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 180
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5898,
12673,
717,
590,
25827,
6443,
368,
341,
262,
1077,
5206,
5635,
284,
3393,
1972,
486,
931,
13056,
262,
1077,
374,
284,
5635,
5357,
12673,
1006,
286,
1391,
285,
22908,
81813,
830,
11,
1391,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_storage() {
let backend = make_local_backend(Path::new("/tmp/a"));
create_storage(&backend).unwrap();
let backend = make_noop_backend();
create_storage(&backend).unwrap();
let backend = StorageBackend::default();
assert!(create_storage(&backend).is_err());
} | rust_cleaned_test_functions.jsonl/33024 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 146
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8657,
23310,
368,
341,
286,
1077,
19163,
284,
1281,
13564,
40011,
33030,
486,
931,
4283,
5173,
14186,
4010,
286,
1855,
23310,
2099,
20942,
568,
15454,
1428,
286,
1077,
19163,
284,
1281,
6536,
453,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_rpc_format_user_activated_protocol_overrides() -> Result<(), failure::Error> {
let expected_json = serde_json::json!(
[
{
"replaced_protocol": "PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU",
"replacement_protocol": "PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS"
}
]
);
let protocol_overrides = ProtocolOverrides {
user_activated_upgrades: vec![],
user_activated_protocol_overrides: vec![(
"PsBABY5HQTSkA4297zNHfsZNKtxULfL18y95qb3m53QJiXGmrbU".to_string(),
"PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS".to_string(),
)],
};
assert_json_eq!(
expected_json,
serde_json::to_value(
protocol_overrides.user_activated_protocol_overrides_to_rpc_json()
)?
);
Ok(())
} | rust_cleaned_test_functions.jsonl/24461 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 579
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
60799,
8955,
3317,
62,
30162,
34880,
15431,
18245,
368,
1464,
5714,
68843,
7901,
486,
1454,
29,
341,
286,
1077,
3601,
9455,
284,
61570,
9455,
486,
2236,
33673,
310,
2278,
1060,
341,
394,
330,
265,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_read_bitfield() {
let mut r = Reader::new();
r.state = State::Len;
let v = vec![0u8, 0, 0, 5, 5, 0xff, 0xff, 0xff, 0xff];
let mut data = Cursor::new(&v);
// Test one shot
match r.readable(&mut data).unwrap().unwrap() {
Message::Bitfield(ref pf) => {
for i in 0..32 {
assert!(pf.has_bit(i as u64));
}
}
_ => {
unreachable!();
}
}
} | rust_cleaned_test_functions.jsonl/46449 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 317
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
13996,
2566,
368,
341,
286,
1077,
5206,
435,
284,
25166,
486,
931,
543,
286,
435,
3467,
284,
3234,
486,
11271,
280,
286,
1077,
348,
284,
7486,
20703,
15,
84,
23,
11,
220,
15,
11,
220,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_for_loop_with_specified_next_counter() {
let input = "
FOR i% = 1 TO 5
PRINT i%
NEXT i%
";
let interpreter = interpret(input);
let stdlib = interpreter.stdlib;
assert_eq!(stdlib.output, vec!["1", "2", "3", "4", "5"]);
} | rust_cleaned_test_functions.jsonl/109183 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 164
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5478,
17198,
6615,
13594,
1870,
11257,
15730,
368,
341,
286,
1077,
1946,
284,
6228,
286,
4613,
600,
4,
284,
220,
16,
5146,
220,
20,
198,
310,
35893,
600,
13744,
286,
45011,
600,
13744,
286,
7620... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_b_type() {
let i = Instr {
bits: 0b10101_01010_11001_1101110_011_0000000,
format: Format::B(BType {}),
};
match i.format {
Format::B(f) => {
assert_eq!(0b01010, f.rs1(i.bits));
assert_eq!(0b11001, f.rs2(i.bits));
assert_eq!(0b101011101110, f.imm(i.bits));
assert_eq!(0b011, f.funct3(i.bits));
}
_ => panic!("Expecting BType format"),
}
} | rust_cleaned_test_functions.jsonl/60975 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 266
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
1819,
368,
341,
262,
1077,
600,
284,
758,
495,
341,
286,
9472,
25,
220,
15,
65,
16,
15,
16,
15,
16,
62,
15,
16,
15,
16,
15,
62,
16,
16,
15,
15,
16,
62,
16,
16,
15,
16,
16,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_join_absolute_path() {
assert_eq!(
PathBuf::from("sample/a/")
.join_absolute_path(&PathBuf::from("/b"))
.unwrap(),
PathBuf::from("sample/a/b")
);
} | rust_cleaned_test_functions.jsonl/55641 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 147
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31017,
50874,
2638,
368,
341,
286,
2060,
10714,
33673,
310,
7933,
15064,
486,
1499,
445,
13611,
14186,
53006,
394,
659,
5987,
50874,
2638,
2099,
1820,
15064,
486,
1499,
4283,
65,
5455,
394,
659,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_yclip_suffix_custom() {
let y = b"GAAAA";
let x = b"CG";
let score = |a: u8, b: u8| if a == b { 1i32 } else { -3i32 };
let scoring = Scoring::new(-5, -1, &score).yclip(-5).xclip(0);
let mut aligner = banded::Aligner::with_scoring(scoring, 10, 10);
let alignment = aligner.custom(x, y);
assert_eq!(alignment.operations, [Xclip(1), Match, Yclip(4)]);
} | rust_cleaned_test_functions.jsonl/126762 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 214
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4178,
7974,
37151,
15875,
368,
341,
286,
1077,
379,
284,
293,
89199,
25699,
876,
286,
1077,
856,
284,
293,
1,
8798,
3302,
286,
1077,
5456,
284,
760,
64,
25,
575,
23,
11,
293,
25,
575,
23,
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... | 2 |
#[test]
fn test_increase_total_stake_panic_overflow() {
new_test_ext().execute_with(|| {
let initial_total_stake = u64::MAX;
let increment : u64 = 1;
// Setup initial total stake
Subtensor::increase_total_stake(initial_total_stake);
Subtensor::increase_total_stake(increment); // Should trigger panic
});
} | rust_cleaned_test_functions.jsonl/17167 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 131
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
73807,
10784,
1261,
726,
620,
31270,
79073,
368,
341,
8638,
4452,
9927,
1005,
10257,
6615,
79453,
341,
286,
1077,
2856,
10784,
1261,
726,
284,
575,
21,
19,
486,
10586,
280,
197,
10217,
16252,
549,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_records() -> io::Result<()> {
let data = b"\
##gff-version 3
sq0\tNOODLES\tgene\t8\t13\t.\t+\t.\tgene_id=ndls0;gene_name=gene0
";
let mut reader = Reader::new(&data[..]);
let mut n = 0;
for result in reader.records() {
let _ = result?;
n += 1;
}
assert_eq!(n, 1);
Ok(())
} | rust_cleaned_test_functions.jsonl/69014 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 219
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31279,
368,
1464,
6399,
486,
2077,
71698,
341,
286,
1077,
821,
284,
293,
83383,
565,
70,
542,
45367,
220,
18,
198,
28343,
15,
4955,
8996,
2069,
14017,
4955,
42371,
4955,
23,
4955,
16,
18,
4955,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_concat() {
let gil = Python::acquire_gil();
let py = gil.python();
let d = [("ByteSequence", py.get_type::<ByteSequence>())].into_py_dict(py);
let run = |code| py.run(code, None, Some(d)).unwrap();
let err = |code| py.run(code, None, Some(d)).unwrap_err();
run("s1 = ByteSequence([1, 2]); s2 = ByteSequence([3, 4]); assert list(s1+s2) == [1, 2, 3, 4]");
err("s1 = ByteSequence([1, 2]); s2 = 'hello'; s1 + s2");
} | rust_cleaned_test_functions.jsonl/64049 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 210
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
57478,
368,
341,
262,
1077,
342,
321,
284,
13027,
486,
580,
984,
1889,
321,
543,
262,
1077,
4510,
284,
342,
321,
43193,
1428,
262,
1077,
294,
284,
84019,
7153,
14076,
497,
4510,
670,
1819,
27638... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_week_without_mode() {
let cases = vec![
("2000-01-01", Some(0i64)),
("2008-02-20", Some(7i64)),
("2017-01-01", Some(1i64)),
("0000-00-00", None),
("2018-12-00", None),
("2018-00-03", None),
];
let mut ctx = EvalContext::default();
for (datetime, exp) in cases {
let datetime = DateTime::parse_datetime(&mut ctx, datetime, MAX_FSP, true).unwrap();
let output = RpnFnScalarEvaluator::new()
.push_param(datetime)
.evaluate(ScalarFuncSig::WeekWithoutMode)
.unwrap();
assert_eq!(output, exp);
}
} | rust_cleaned_test_functions.jsonl/36232 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 398
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31277,
39904,
7302,
368,
341,
286,
1077,
5048,
284,
7486,
90515,
310,
3489,
17,
15,
15,
15,
12,
15,
16,
12,
15,
16,
497,
4329,
7,
15,
72,
21,
19,
6965,
310,
3489,
17,
15,
15,
23,
12,
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... | 2 |
#[test]
fn test_primitive_writer_schema() {
let valid_reader = Schema::String;
assert!(SchemaCompatibility::can_read(
&Schema::String,
&valid_reader
));
assert_eq!(
SchemaCompatibility::can_read(&Schema::Int, &Schema::String),
false
);
} | rust_cleaned_test_functions.jsonl/21775 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 176
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
84087,
28908,
25371,
368,
341,
286,
1077,
2697,
22306,
284,
12539,
486,
703,
280,
286,
2060,
10297,
8632,
85880,
486,
4814,
6443,
1006,
310,
609,
8632,
486,
703,
345,
310,
609,
1891,
22306,
198,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_array() -> Result<()> {
generic_test_array(
ScalarValue::Utf8(Some("aa".to_string())),
ScalarValue::Utf8(Some("aa".to_string())),
DataType::Utf8,
"StringArray\n[\n \"aa\",\n \"aa\",\n]",
)?;
generic_test_array(
ScalarValue::from(1u32),
ScalarValue::from(1u64),
DataType::UInt64,
"PrimitiveArray<UInt64>\n[\n 1,\n 1,\n]",
)?;
generic_test_array(
ScalarValue::from(1u64),
ScalarValue::from(1u32),
DataType::UInt64,
"PrimitiveArray<UInt64>\n[\n 1,\n 1,\n]",
)
} | rust_cleaned_test_functions.jsonl/21908 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 431
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3858,
368,
1464,
5714,
71698,
341,
286,
13954,
4452,
3858,
1006,
310,
35176,
1130,
486,
38980,
23,
65405,
445,
5305,
3263,
983,
3904,
73727,
310,
35176,
1130,
486,
38980,
23,
65405,
445,
5305,
326... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_get_header_type_with_invalid_object() {
let header = [0x65, 32u8, 0x31, 0x35, 0x0];
let _ = get_header_type(&header);
} | rust_cleaned_test_functions.jsonl/108329 | {
"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,
3062,
8757,
1819,
6615,
31433,
5314,
368,
341,
286,
1077,
4247,
284,
508,
15,
87,
21,
20,
11,
220,
18,
17,
84,
23,
11,
220,
15,
87,
18,
16,
11,
220,
15,
87,
18,
20,
11,
220,
15,
87,
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 |
#[test]
fn test_set_memory() {
let mut xs = [0u8, ..20];
let ptr = xs.as_mut_ptr();
unsafe { set_memory(ptr, 5u8, xs.len()); }
assert!(xs == [5u8, ..20]);
} | rust_cleaned_test_functions.jsonl/86 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 112
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
19195,
368,
341,
286,
1077,
5206,
11943,
284,
508,
15,
84,
23,
11,
5241,
17,
15,
935,
286,
1077,
10087,
284,
11943,
5357,
29523,
4348,
543,
286,
19860,
314,
738,
19195,
23866,
11,
220,
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_register_worker() {
new_test_ext().execute_with(|| {
set_block_1();
setup_relaychain_genesis_allowlist();
// New registration without valid genesis_block_hash
assert_noop!(
PhalaRegistry::register_worker(
Origin::signed(1),
WorkerRegistrationInfo::<u64> {
version: 1,
machine_id: Default::default(),
pubkey: worker_pubkey(1),
ecdh_pubkey: ecdh_pubkey(1),
genesis_block_hash: Default::default(),
features: vec![4, 1],
operator: Some(1),
},
Attestation::SgxIas {
ra_report: Vec::new(),
signature: Vec::new(),
raw_signing_cert: Vec::new(),
}
),
Error::<Test>::GenesisBlockHashRejected
);
// New registration
assert_ok!(PhalaRegistry::register_worker(
Origin::signed(1),
WorkerRegistrationInfo::<u64> {
version: 1,
machine_id: Default::default(),
pubkey: worker_pubkey(1),
ecdh_pubkey: ecdh_pubkey(1),
genesis_block_hash: H256::repeat_byte(1),
features: vec![4, 1],
operator: Some(1),
},
Attestation::SgxIas {
ra_report: Vec::new(),
signature: Vec::new(),
raw_signing_cert: Vec::new(),
},
));
let worker = Workers::<Test>::get(worker_pubkey(1)).unwrap();
assert_eq!(worker.operator, Some(1));
// Refreshed validator
elapse_seconds(100);
assert_ok!(PhalaRegistry::register_worker(
Origin::signed(1),
WorkerRegistrationInfo::<u64> {
version: 1,
machine_id: Default::default(),
pubkey: worker_pubkey(1),
ecdh_pubkey: ecdh_pubkey(1),
genesis_block_hash: H256::repeat_byte(1),
features: vec![4, 1],
operator: Some(2),
},
Attestation::SgxIas {
ra_report: Vec::new(),
signature: Vec::new(),
raw_signing_cert: Vec::new(),
},
));
let worker = Workers::<Test>::get(worker_pubkey(1)).unwrap();
assert_eq!(worker.last_updated, 100);
assert_eq!(worker.operator, Some(2));
});
} | rust_cleaned_test_functions.jsonl/23211 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1001
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14000,
40385,
368,
341,
298,
8638,
4452,
9927,
1005,
10257,
6615,
79453,
341,
571,
8196,
7113,
62,
16,
543,
571,
84571,
1288,
6651,
8819,
16322,
13774,
55731,
1607,
1428,
571,
197,
322,
1532,
1222... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_vectors() -> Result<()> {
let lua = Lua::new();
let v: [f32; 3] = lua.load("vector(1, 2, 3) + vector(3, 2, 1)").eval()?;
assert_eq!(v, [4.0, 4.0, 4.0]);
// Test vector methods
lua.load(
r#"
local v = vector(1, 2, 3)
assert(v.x == 1)
assert(v.y == 2)
assert(v.z == 3)
"#,
)
.exec()?;
lua.load(
r#"
local v = vector(1, 2, 3)
assert(v.x == 1)
assert(v.y == 2)
assert(v.z == 3)
"#,
)
.set_compiler(Compiler::new().set_vector_ctor(Some("vector".to_string())))
.exec()?;
Ok(())
} | rust_cleaned_test_functions.jsonl/57440 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 366
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
49158,
368,
1464,
5714,
71698,
341,
262,
1077,
20357,
284,
37662,
486,
931,
1428,
262,
1077,
348,
25,
508,
69,
18,
17,
26,
220,
18,
60,
284,
20357,
5104,
445,
3215,
7,
16,
11,
220,
17,
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... | 4 |
#[test]
fn test_part_1() {
assert_eq!(run(INPUT, 10), 1588);
assert_eq!(run(include_str!("../../input/14.txt"), 10), 2068);
} | rust_cleaned_test_functions.jsonl/4499 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 80
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10495,
62,
16,
368,
341,
286,
2060,
10714,
10297,
6108,
57911,
11,
220,
16,
15,
701,
220,
16,
20,
23,
23,
317,
286,
2060,
10714,
10297,
6108,
77863,
2895,
17223,
2748,
1355,
14,
16,
19,
3909,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_scheme() -> Result<(), Box<dyn Error>> {
assert_eq!(
ShardScheme::Range {
from: 0,
to: 9,
total: 10,
},
ShardScheme::try_from((0..=9, 10))?
);
Ok(())
} | rust_cleaned_test_functions.jsonl/28586 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 185
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53293,
368,
1464,
5714,
68843,
8261,
92846,
4600,
2452,
341,
286,
2060,
10714,
33673,
310,
95366,
28906,
486,
6046,
341,
394,
504,
25,
220,
15,
345,
394,
311,
25,
220,
24,
345,
394,
2790,
25,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_verifier_find_message_to_handle_from_initiated_state() {
let _setup = SetupAriesMocks::init();
let verifier = _verifier_sm();
// No messages
{
let messages = map!(
"key_1".to_string() => A2AMessage::PresentationProposal(_presentation_proposal()),
"key_2".to_string() => A2AMessage::Presentation(_presentation()),
"key_3".to_string() => A2AMessage::PresentationRequest(_presentation_request()),
"key_4".to_string() => A2AMessage::PresentationAck(_ack()),
"key_5".to_string() => A2AMessage::CommonProblemReport(_problem_report())
);
assert!(verifier.find_message_to_handle(messages).is_none());
}
} | rust_cleaned_test_functions.jsonl/57253 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 426
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
26042,
3049,
21814,
6462,
2346,
10630,
5673,
6137,
10029,
4387,
368,
341,
310,
1077,
716,
15188,
284,
18626,
32,
4019,
72577,
486,
2327,
1428,
310,
1077,
88737,
284,
716,
423,
3049,
15874,
1428,
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... | 1 |
#[test]
fn test_scrypt() {
let tests = tests();
for t in tests.iter() {
let mut result = Vec::from_elem(t.expected.len(), 0u8);
let params = ScryptParams::new(t.log_n, t.r, t.p);
scrypt(t.password.as_bytes(), t.salt.as_bytes(), ¶ms, result[mut]);
assert!(result == t.expected);
}
} | rust_cleaned_test_functions.jsonl/13236 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 190
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13171,
3571,
368,
341,
286,
1077,
7032,
284,
7032,
543,
286,
369,
259,
304,
7032,
19471,
368,
341,
310,
1077,
5206,
1102,
284,
11312,
486,
1499,
28179,
1155,
56835,
19406,
1507,
220,
15,
84,
23,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_default_reshaping() {
let cases = [
("چۆمان", "ﭼﯚﻣﺎﻥ"),
("گۆیژە", "ﮔﯚﯾﮋە"),
("ﺧﯚﻣﺎﻥ ﺧﯚﺵ", "ﺧﯚﻣﺎﻥ ﺧﯚﺵ"),
];
cases.iter().for_each(|case| {
assert_eq!(arabic_reshape(case.0), case.1);
});
} | rust_cleaned_test_functions.jsonl/9521 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 214
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9993,
62,
2488,
14216,
368,
341,
262,
1077,
5048,
284,
2278,
286,
3489,
144751,
145576,
125559,
497,
330,
147609,
149840,
144253,
140672,
144614,
4461,
286,
3489,
63732,
145576,
14391,
145837,
145151,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_client_pref() {
let client = vec![
CipherSuite::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
CipherSuite::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
];
let server = vec![
&super::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
&super::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
];
let chosen = super::choose_ciphersuite_preferring_client(&client, &server);
assert!(chosen.is_some());
assert_eq!(
chosen.unwrap(),
&super::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
);
} | rust_cleaned_test_functions.jsonl/54997 | {
"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,
8179,
43331,
368,
341,
286,
1077,
2943,
284,
7486,
90515,
310,
63288,
28000,
486,
45439,
2089,
6484,
1799,
76994,
23929,
69381,
62,
16,
17,
23,
2646,
9985,
38096,
17,
20,
21,
345,
310,
63288,
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_length_of_list_in_if() {
let env = add_builtins(Env::new_empty());
let nine = "(if (> 1 (length (list 1 2 3))) (quote conseq) (quote alt))".to_string();
let (out_expr, _) = test_eval!(nine, env);
assert_eq!(out_expr.unwrap().print().unwrap(), "alt".to_string());
} | rust_cleaned_test_functions.jsonl/67643 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 148
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5118,
3575,
2019,
1243,
11119,
368,
341,
286,
1077,
6105,
284,
912,
880,
11227,
1330,
7,
14359,
486,
931,
15124,
1423,
286,
1077,
11627,
284,
11993,
333,
76852,
220,
16,
320,
4129,
320,
1607,
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_fq12_mul_by_014() {
let mut rng = ark_std::test_rng();
for _ in 0..1000 {
let c0 = Fq2::rand(&mut rng);
let c1 = Fq2::rand(&mut rng);
let c5 = Fq2::rand(&mut rng);
let mut a = Fq12::rand(&mut rng);
let mut b = a;
a.mul_by_014(&c0, &c1, &c5);
b.mul_assign(&Fq12::new(
Fq6::new(c0, c1, Fq2::zero()),
Fq6::new(Fq2::zero(), c5, Fq2::zero()),
));
assert_eq!(a, b);
}
} | rust_cleaned_test_functions.jsonl/3560 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 306
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
761,
80,
16,
17,
24944,
3710,
62,
15,
16,
19,
368,
341,
262,
1077,
5206,
28422,
284,
55217,
15656,
486,
1944,
66849,
1428,
262,
369,
716,
304,
220,
15,
496,
16,
15,
15,
15,
341,
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... | 2 |
#[test]
fn test_igmp_integration_delay_reset_timer() {
let mut ctx = setup_simple_test_environment();
// This seed value was chosen to later produce a timer duration > 100ms.
ctx.seed_rng(123456);
ctx.igmp_join_group(DummyLinkDeviceId, GROUP_ADDR);
assert_eq!(ctx.timers().len(), 1);
let instant1 = ctx.timers()[0].0.clone();
let start = ctx.now();
let duration = Duration::from_micros(((instant1 - start).as_micros() / 2) as u64);
assert!(duration.as_millis() > 100);
receive_igmp_query(&mut ctx, duration);
assert_eq!(ctx.frames().len(), 1);
assert_eq!(ctx.timers().len(), 1);
let instant2 = ctx.timers()[0].0.clone();
assert!(instant2 <= instant1);
assert!(ctx.trigger_next_timer());
assert!(ctx.now() - start <= duration);
assert_eq!(ctx.frames().len(), 2);
// make sure it is a V2 report
assert_eq!(ctx.frames().last().unwrap().1[24], 0x16);
ensure_ttl_ihl_rtr(&ctx);
} | rust_cleaned_test_functions.jsonl/128911 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 490
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
343,
1307,
90250,
22198,
18983,
16255,
368,
341,
286,
1077,
5206,
5635,
284,
6505,
30015,
4452,
51774,
543,
286,
442,
1096,
10320,
897,
572,
11882,
311,
2937,
8193,
264,
9021,
8090,
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... | 1 |
#[test]
fn test_buffered_read() {
let data = vec![1, 2, 3, 4];
let bytes: i64 = -1;
let mut buffered = BufferedIO {
cursor: Cursor::new(data.clone()),
};
assert_eq!(buffered.read(bytes).unwrap(), data);
} | rust_cleaned_test_functions.jsonl/123339 | {
"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,
7776,
291,
6443,
368,
341,
286,
1077,
821,
284,
7486,
20703,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
935,
286,
1077,
5820,
25,
600,
21,
19,
284,
481,
16,
280,
286,
1077,
5206,
53057,
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_separate() {
for (msg, expect) in &[
("abc", "abc"),
("zyx", "zyx"),
(
"abcdefghijklmnopqrstuvwxyz",
"abcde fghij klmno pqrst uvwxy z",
),
(
"thequickbrownfoxjumpedoverthelazydog",
"thequ ickbr ownfo xjump edove rthel azydo g",
),
(
"abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz",
"abcde fghij klmno pqrst uvwxy zabcd efghi jklmn opqrs tuvwx yz",
),
] {
let got: String = msg.chars().separate(' ', 5);
assert_eq!(&got, expect,);
}
} | rust_cleaned_test_functions.jsonl/108454 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 456
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3453,
67598,
368,
341,
286,
369,
320,
3236,
11,
1720,
8,
304,
609,
9640,
310,
3489,
13683,
497,
330,
13683,
4461,
310,
3489,
4246,
87,
497,
330,
4246,
87,
4461,
310,
2399,
394,
330,
67512,
756... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_amoskvin() {
#[derive(Debug, Deserialize, PartialEq, Serialize)]
struct Root {
foo: Vec<Foo>,
}
#[derive(Debug, Deserialize, PartialEq, Serialize)]
struct Foo {
a: String,
b: Option<String>,
}
test_parse_ok(&[(
"
<root>
<foo>
<a>Hello</a>
<b>World</b>
</foo>
<foo>
<a>Hi</a>
</foo>
</root>",
Root {
foo: vec![
Foo {
a: "Hello".to_string(),
b: Some("World".to_string()),
},
Foo {
a: "Hi".to_string(),
b: None,
},
],
},
)]);
} | rust_cleaned_test_functions.jsonl/54628 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 439
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
10585,
74,
9603,
368,
341,
262,
11506,
27098,
42618,
11,
48440,
11,
55039,
11,
39900,
5563,
262,
2036,
18854,
341,
286,
15229,
25,
11312,
30499,
2624,
12520,
262,
555,
262,
11506,
27098,
42618... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_legal_moves_banmen_with_kin_7_squares_and_contiguous_self_gote() {
test_legal_moves_banmen_with_kin_7_squares_and_contiguous_self_gote_impl(GKin)
} | rust_cleaned_test_functions.jsonl/81251 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 82
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
82324,
45390,
880,
276,
5676,
6615,
4698,
258,
62,
22,
643,
40856,
8378,
10260,
27029,
25637,
1889,
1272,
368,
972,
18185,
82324,
45390,
880,
276,
5676,
6615,
4698,
258,
62,
22,
643,
40856,
8378,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_proof_path_suffix_overflow() {
let b = ProofPath::from_raw(*b"\x00qwertyuiopasdfghjklzxcvbnm123456\xFF");
assert_eq!(b"\x01qwertyuiopasdfghjklzxcvbnm123456\x00".len(), 34);
b.suffix(255).suffix(2);
} | rust_cleaned_test_functions.jsonl/25540 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 122
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
86757,
2638,
37151,
79073,
368,
341,
262,
1077,
293,
284,
36991,
1820,
486,
1499,
16067,
4071,
65,
11934,
87,
15,
15,
69291,
1344,
1963,
453,
76615,
866,
73,
10561,
89,
8148,
85,
11081,
76,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_no_xcheck() {
#[cross_check(none)]
fn abcd() {}
abcd();
expect_xcheck(FUNCTION_ENTRY_TAG, 0x7c93ee4f_u64);
expect_xcheck(FUNCTION_EXIT_TAG, 0x7c93ee4f_u64);
expect_no_xchecks();
} | rust_cleaned_test_functions.jsonl/41186 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 148
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6536,
3212,
2028,
368,
341,
286,
11506,
28842,
7200,
1445,
603,
5563,
286,
5168,
668,
4385,
368,
10086,
286,
668,
4385,
543,
286,
1720,
3212,
2028,
7832,
9083,
22659,
16592,
11,
220,
15,
87,
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_array_unsigned_long_long() {
check([] as [u64; 0], Some(0));
check([0u64, 1, 2], Some(24));
} | rust_cleaned_test_functions.jsonl/79674 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 61
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3858,
67830,
17799,
17799,
368,
341,
262,
1779,
10556,
438,
508,
84,
21,
19,
26,
220,
15,
1125,
4329,
7,
15,
1106,
262,
1779,
2561,
15,
84,
21,
19,
11,
220,
16,
11,
220,
17,
1125,
4329,
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 |
#[test]
fn test_random_poly_sum_difference() {
// Test sum and difference of randomly generated polynomials.
let num_test_cases = 100;
let mut rng = rand::thread_rng();
let start = Instant::now();
for _ in 0..num_test_cases {
let left = UnivarPolynomial::random(rng.gen_range(1, 100));
let right = UnivarPolynomial::random(rng.gen_range(1, 100));
let sum = UnivarPolynomial::sum(&left, &right);
// sum is commutative
assert_eq!(sum, UnivarPolynomial::sum(&right, &left));
// Test overloaded operator
assert_eq!(sum, &left + &right);
// sum - left == right
let mut diff_1 = UnivarPolynomial::difference(&sum, &right);
// Test overloaded operator
assert_eq!(diff_1, &sum - &right);
// Since degree of difference is same as degree of `sum` but the higher degree coeffs
// then do equality comparison with `left`
while diff_1.degree() > left.degree() {
let c = diff_1.0.pop().unwrap();
assert!(c.is_zero());
}
assert_eq!(diff_1, left);
// sum - right == left
let mut diff_2 = UnivarPolynomial::difference(&sum, &left);
// Test overloaded operator
assert_eq!(diff_2, &sum - &left);
// Since degree of difference is same as degree of `sum` but the higher degree coeffs
// then do equality comparison with `right`
while diff_2.degree() > right.degree() {
let c = diff_2.0.pop().unwrap();
assert!(c.is_zero());
}
assert_eq!(diff_2, right);
}
println!(
"Sum diff time for {} elems = {:?}",
num_test_cases,
start.elapsed()
);
} | rust_cleaned_test_functions.jsonl/51314 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 947
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
22644,
36133,
10160,
47525,
368,
341,
286,
442,
3393,
2629,
323,
6672,
315,
26618,
7907,
1471,
76961,
624,
286,
1077,
1629,
4452,
41427,
284,
220,
16,
15,
15,
280,
286,
1077,
5206,
28422,
284,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 4 |
#[test]
fn test_find_mut() {
let mut m = HashMap::new();
assert!(m.insert(1, 12).is_none());
assert!(m.insert(2, 8).is_none());
assert!(m.insert(5, 14).is_none());
let new = 100;
match m.get_mut(&5) {
None => panic!(),
Some(x) => *x = new,
}
assert_eq!(m.get(&5), Some(&new));
} | rust_cleaned_test_functions.jsonl/8503 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 212
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21814,
29523,
368,
341,
286,
1077,
5206,
296,
284,
10528,
486,
931,
543,
286,
2060,
10297,
76,
7030,
7,
16,
11,
220,
16,
17,
568,
285,
31488,
1423,
286,
2060,
10297,
76,
7030,
7,
17,
11,
220... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_blocktxids_cache_hit_and_miss() {
let block1: BlockHash = gen_hash(1);
let block2: BlockHash = gen_hash(2);
let block3: BlockHash = gen_hash(3);
let txids: Vec<Txid> = vec![gen_hash(4), gen_hash(5)];
let misses: Mutex<usize> = Mutex::new(0);
let miss_func = || {
*misses.lock().unwrap() += 1;
Ok(txids.clone())
};
let dummy_metrics = Metrics::new("127.0.0.1:60000".parse().unwrap());
let cache = BlockTxIDsCache::new(200, &dummy_metrics);
// cache miss
let result = cache.get_or_else(&block1, &miss_func).unwrap();
assert_eq!(1, *misses.lock().unwrap());
assert_eq!(txids, result);
// cache hit
let result = cache.get_or_else(&block1, &miss_func).unwrap();
assert_eq!(1, *misses.lock().unwrap());
assert_eq!(txids, result);
cache.get_or_else(&block2, &miss_func).unwrap();
assert_eq!(2, *misses.lock().unwrap());
cache.get_or_else(&block3, &miss_func).unwrap();
assert_eq!(3, *misses.lock().unwrap());
cache.get_or_else(&block1, &miss_func).unwrap();
assert_eq!(4, *misses.lock().unwrap());
// cache hits
cache.get_or_else(&block3, &miss_func).unwrap();
cache.get_or_else(&block1, &miss_func).unwrap();
assert_eq!(4, *misses.lock().unwrap());
} | rust_cleaned_test_functions.jsonl/58477 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 709
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7113,
3998,
3365,
11529,
37697,
8378,
67722,
368,
341,
286,
1077,
2504,
16,
25,
8362,
6370,
284,
4081,
8950,
7,
16,
317,
286,
1077,
2504,
17,
25,
8362,
6370,
284,
4081,
8950,
7,
17,
317,
286,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_fx55_dump_registers() {
let mut machine = Machine::new(TestContext::new());
machine.idx = 0xBCD;
machine.register_set(0, 0xC);
machine.register_set(1, 4);
machine.register_set(2, 123);
machine.register_set(3, 98);
machine.register_set(4, 12);
machine.test_opcode(0xF355);
// Should store V0 thorugh VX inclusive to memory starting at the index pointer
let i = machine.idx;
assert_eq!(machine.memory_get(i), 0xC);
assert_eq!(machine.memory_get(i + 1), 4);
assert_eq!(machine.memory_get(i + 2), 123);
assert_eq!(machine.memory_get(i + 3), 98);
assert_eq!(machine.memory_get(i + 4), 0);
// Should not modify the index pointer
assert_eq!(machine.idx, 0xBCD);
// Should not modify the registers
assert_eq!(machine.register_get(0), 0xC);
assert_eq!(machine.register_get(1), 4);
assert_eq!(machine.register_get(2), 123);
assert_eq!(machine.register_get(3), 98);
assert_eq!(machine.register_get(4), 12);
// Should increment program counter by two
assert_eq!(machine.pc, PC_BEGIN + 2);
} | rust_cleaned_test_functions.jsonl/127976 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 455
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62691,
20,
20,
18296,
78360,
368,
341,
262,
1077,
5206,
5662,
284,
12960,
486,
931,
31159,
1972,
486,
931,
1423,
262,
5662,
51806,
284,
220,
15,
80979,
35,
280,
262,
5662,
9929,
2602,
7,
15,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_a_ray_through_the_near_corner_of_the_canvas() {
let camera = camera::Camera::new(201, 101, std::f64::consts::PI / 2.0);
let ray = camera.ray_for_pixel(0, 0);
assert_tuple_approx_eq!(ray.origin, tuple::Point::new(0.0, 0.0, 0.0));
assert_tuple_approx_eq!(
ray.direction,
tuple::Vector::new(0.66519, 0.33259, -0.66851)
);
} | rust_cleaned_test_functions.jsonl/116187 | {
"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,
4306,
72690,
87399,
16068,
76340,
66884,
3575,
16068,
47136,
368,
341,
286,
1077,
6249,
284,
6249,
486,
13445,
486,
931,
7,
17,
15,
16,
11,
220,
16,
15,
16,
11,
1460,
486,
69,
21,
19,
486,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_mmds_version() {
let mut mmds = Mmds::new().unwrap();
// Test default MMDS version.
assert_eq!(mmds.version().to_string(), MmdsVersion::V2.to_string());
// Test setting MMDS version to v1.
mmds.set_version(MmdsVersion::V1).unwrap();
assert_eq!(mmds.version().to_string(), MmdsVersion::V1.to_string());
// Test setting MMDS version back to default.
mmds.set_version(MmdsVersion::V2).unwrap();
assert_eq!(mmds.version().to_string(), MmdsVersion::V2.to_string());
} | rust_cleaned_test_functions.jsonl/40961 | {
"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,
717,
2277,
82,
9438,
368,
341,
286,
1077,
5206,
296,
2277,
82,
284,
386,
2277,
82,
486,
931,
1005,
15454,
1428,
286,
442,
3393,
1638,
21665,
5936,
2319,
624,
286,
2060,
10714,
10297,
76,
2277,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sampler() {
// set the time decay parameter large enough that it should be very
// rare for a new point to not be accepted into the sampler
let mut sampler = StreamSampler::new(2, 100000.0);
assert_eq!(sampler.capacity(), 2);
assert_eq!(sampler.size(), 0);
assert_eq!(sampler.is_full(), false);
match sampler.sample("Without education we", 0) {
SamplerResult::Accepted(evicted) => {
assert!(evicted.is_none());
assert_eq!(sampler.size(), 1);
assert_eq!(sampler.is_full(), false);
}
SamplerResult::Ignored => panic!("Expected data accepted")
}
match sampler.sample("are in a horrible and", 10) {
SamplerResult::Accepted(evicted) => {
assert!(evicted.is_none());
assert_eq!(sampler.size(), 2);
assert_eq!(sampler.is_full(), true);
}
SamplerResult::Ignored => panic!("Expected data accepted")
}
match sampler.sample("deadly danger of taking", 100) {
SamplerResult::Accepted(evicted) => match evicted {
Some(evicted) => {
assert_eq!(evicted.value(), &"Without education we");
assert_eq!(sampler.size(), 2);
assert_eq!(sampler.is_full(), true);
}
None => panic!("Expected evicted point")
}
SamplerResult::Ignored => panic!("Expected data accepted")
}
match sampler.sample("educated people seriously.", 1000) {
SamplerResult::Accepted(evicted) => match evicted {
Some(evicted) => {
assert_eq!(evicted.value(), &"are in a horrible and");
assert_eq!(sampler.size(), 2);
assert_eq!(sampler.is_full(), true);
}
None => panic!("Expected evicted point")
}
SamplerResult::Ignored => panic!("Expected data accepted")
}
match sampler.sample("-- G. K. Chesterton", 10000) {
SamplerResult::Accepted(evicted) => match evicted {
Some(evicted) => {
assert_eq!(evicted.value(), &"deadly danger of taking");
assert_eq!(sampler.size(), 2);
assert_eq!(sampler.is_full(), true);
}
None => panic!("Expected evicted point")
}
SamplerResult::Ignored => panic!("Expected data accepted")
}
} | rust_cleaned_test_functions.jsonl/48754 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1352
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
72812,
368,
341,
286,
442,
738,
279,
882,
30715,
5733,
3460,
3322,
429,
432,
1265,
387,
1602,
198,
286,
442,
8848,
369,
264,
501,
1459,
311,
537,
387,
11666,
1119,
279,
41799,
198,
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... | 9 |
#[test]
fn test_to_lower_snake_case() {
check(to_lower_snake_case, "lower_snake_case", expect![[""]]);
check(to_lower_snake_case, "UPPER_SNAKE_CASE", expect![["upper_snake_case"]]);
check(to_lower_snake_case, "Weird_Case", expect![["weird_case"]]);
check(to_lower_snake_case, "CamelCase", expect![["camel_case"]]);
check(to_lower_snake_case, "lowerCamelCase", expect![["lower_camel_case"]]);
check(to_lower_snake_case, "a", expect![[""]]);
} | rust_cleaned_test_functions.jsonl/87745 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 238
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2346,
30425,
28022,
726,
19096,
368,
341,
286,
1779,
12186,
30425,
28022,
726,
19096,
11,
330,
14772,
28022,
726,
19096,
497,
1720,
20703,
1183,
1341,
2558,
286,
1779,
12186,
30425,
28022,
726,
1909... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_v6_inode_compact() {
let pa = TempDir::new().unwrap();
let pa_reg = TempFile::new_in(pa.as_path()).unwrap();
let pa_pyc = pa.as_path().join("foo.pyc");
let _ = File::create(&pa_pyc).unwrap();
let reg_node = Node::new(
RafsVersion::V6,
pa.as_path().to_path_buf(),
pa_reg.as_path().to_path_buf(),
Overlay::UpperAddition,
RAFS_DEFAULT_CHUNK_SIZE as u32,
false,
)
.unwrap();
assert_eq!(reg_node.v6_compact_inode, true);
let pyc_node = Node::new(
RafsVersion::V6,
pa.as_path().to_path_buf(),
pa_pyc.as_path().to_path_buf(),
Overlay::UpperAddition,
RAFS_DEFAULT_CHUNK_SIZE as u32,
false,
)
.unwrap();
assert_eq!(pyc_node.v6_compact_inode, false);
std::fs::remove_file(&pa_pyc).unwrap();
} | rust_cleaned_test_functions.jsonl/98421 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 549
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
2273,
21,
46748,
18177,
531,
368,
341,
286,
1077,
7106,
284,
19944,
6184,
486,
931,
1005,
15454,
543,
286,
1077,
7106,
4920,
284,
19944,
1703,
486,
931,
1243,
78637,
5357,
2638,
6011,
15454,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_strore_bcd_of_vx_to_i() {
let mut vm = VirtualMachine::new();
vm.v[0].0 = 146;
vm.i = 0;
vm.store_bcd_of_vx_to_i(0);
assert!(vm.ram[0] == 1);
assert!(vm.ram[1] == 4);
assert!(vm.ram[2] == 6);
} | rust_cleaned_test_functions.jsonl/99212 | {
"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,
1261,
299,
265,
880,
4385,
3575,
2273,
87,
2346,
5318,
368,
341,
262,
1077,
5206,
10995,
284,
20721,
21605,
486,
931,
543,
262,
10995,
3133,
58,
15,
936,
15,
284,
220,
16,
19,
21,
280,
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_array_convert() {
let from = "EPSG:2230";
let to = "EPSG:26946";
let ft_to_m = Proj::new_known_crs(&from, &to, None).unwrap();
let mut v = vec![
MyPoint::new(4760096.421921, 3744293.729449),
MyPoint::new(4760197.421921, 3744394.729449),
];
ft_to_m.convert_array(&mut v).unwrap();
assert_relative_eq!(v[0].x(), 1450880.2910605022f64);
assert_relative_eq!(v[1].y(), 1141293.7960220438);
} | rust_cleaned_test_functions.jsonl/133389 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 274
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3858,
34910,
368,
341,
286,
1077,
504,
284,
330,
45177,
38,
25,
17,
17,
18,
15,
876,
286,
1077,
311,
284,
330,
45177,
38,
25,
17,
21,
24,
19,
21,
876,
286,
1077,
10482,
2346,
717,
284,
429... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_dummy_excluded() {
let opt = Default::default();
let m = mount_info("ext4", "/mnt/foo", false, true);
assert!(!is_included(&m, &opt));
} | rust_cleaned_test_functions.jsonl/7068 | {
"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,
60321,
2702,
10181,
368,
341,
310,
1077,
3387,
284,
7899,
486,
2258,
543,
310,
1077,
296,
284,
6470,
3109,
445,
427,
19,
497,
3521,
40882,
60555,
497,
895,
11,
830,
317,
310,
2060,
0,
3471,
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 |
#[test]
fn test_validate_email() {
// Test cases taken from Django
let tests = vec![
("email@here.com", true),
("weirder-email@here.and.there.com", true),
(r#"!def!xyz%abc@example.com"#, true),
("email@[127.0.0.1]", true),
("email@[2001:dB8::1]", true),
("email@[2001:dB8:0:0:0:0:0:1]", true),
("email@[::fffF:127.0.0.1]", true),
("example@valid-----hyphens.com", true),
("example@valid-with-hyphens.com", true),
("test@domain.with.idn.tld.उदाहरण.परीक्षा", true),
(r#""test@test"@example.com"#, false),
// max length for domain naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", true),
("a@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.atm", true),
(
"a@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.bbbbbbbbbb.atm",
true,
),
("a@atm.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", true),
("", false),
("abc", false),
("abc@", false),
("abc@bar", true),
("a @x.cz", false),
// TODO: make that one bel", false),
somewhere.com", false),
("email@127.0.0.1", true),
("email@[127.0.0.256]", false),
("email@[2001:db8::12345]", false),
("email@[2001:db8:0:0:0:0:1]", false),
("email@[::ffff:127.0.0.256]", false),
("example@invalid-.com", false),
("example@-invalid.com", false),
("example@invalid.com-", false),
("example@inv-.alid-.com", false),
("example@inv-.-alid.com", false),
(r#"test@example.com\n\n<script src="x.js">"#, false),
(r#""\\\011"@here.com"#, false),
(r#""\\\012"@here.com"#, false),
("trailingdot@shouldfail.com.", false),
// Trailing newlines in us false),
("a\n@b.com", false),
(r#""test@test"\n@example.com"#, false),
("a@[127.0.0.1]\n", false),
];
for (input, expected) in tests {
// println!("{} - {}", inplidate_email(input), expected);
}
} | rust_cleaned_test_functions.jsonl/133238 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1264
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
42681,
9172,
368,
341,
286,
442,
3393,
5048,
4429,
504,
52604,
8945,
286,
1077,
7032,
284,
7486,
90515,
310,
3489,
2332,
31,
6739,
905,
497,
830,
1326,
310,
3489,
896,
404,
1107,
42117,
31,
6739... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ticks_change_state() {
let (genesis_config, _) = create_genesis_config(500);
let bank = Arc::new(Bank::new(&genesis_config));
let bank1 = new_from_parent(&bank);
let hash1 = bank1.hash_internal_state();
// ticks don't change its state unless a block boundary is crossed
for _ in 0..genesis_config.ticks_per_slot {
assert_eq!(bank1.hash_internal_state(), hash1);
bank1.register_tick(&Hash::default());
}
assert_ne!(bank1.hash_internal_state(), hash1);
} | rust_cleaned_test_functions.jsonl/2615 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 251
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
49961,
15947,
4387,
368,
341,
286,
1077,
320,
77894,
5332,
11,
27439,
284,
1855,
16322,
13774,
5332,
7,
20,
15,
15,
317,
286,
1077,
6073,
284,
19689,
486,
931,
5349,
1180,
486,
931,
2099,
77894,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_indexed_reader_by_rid_all() {
_test_indexed_reader_by_rid_all(&FASTA_FILE, &FAI_FILE, _read_buffer_by_rid_all);
} | rust_cleaned_test_functions.jsonl/62837 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 76
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3560,
291,
22306,
3710,
1710,
307,
5705,
368,
341,
286,
716,
1944,
3560,
291,
22306,
3710,
1710,
307,
5705,
2099,
59206,
32,
8087,
11,
609,
3627,
40,
8087,
11,
716,
878,
7776,
3710,
1710,
307,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_224() {
assert_eq!(Solution::calculate("(1+(4+5+2)-3)+(6+8)".to_owned()), 23);
assert_eq!(Solution::calculate("1+1".to_owned()), 2);
assert_eq!(Solution::calculate("0".to_owned()), 0);
assert_eq!(Solution::calculate("2147483647".to_owned()), 2147483647);
} | rust_cleaned_test_functions.jsonl/49288 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 159
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
17,
17,
19,
368,
341,
286,
2060,
10714,
10297,
36842,
486,
35597,
31732,
16,
13362,
19,
10,
20,
10,
17,
7287,
18,
41794,
21,
10,
23,
94010,
983,
51973,
11858,
220,
17,
18,
317,
286,
2060... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_call_with_bad_args() {
let output = Command::new("./target/release/tio")
.arg("bad-command")
.output()
.expect("failed to execute binary");
assert_eq!(String::from_utf8_lossy(&output.stderr), INVALID_COMMAND)
} | rust_cleaned_test_functions.jsonl/41465 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 144
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13429,
6615,
34199,
8384,
368,
341,
286,
1077,
2550,
284,
7348,
486,
931,
13988,
5657,
88648,
5523,
815,
1138,
310,
659,
858,
445,
13855,
48419,
1138,
310,
659,
3006,
741,
310,
659,
17119,
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_which_re_in_without_matches() {
let f = TestFixture::new();
let re = Regex::new(r"bi[^n]").unwrap();
let result: Vec<PathBuf> = which::which_re_in(re, Some(f.paths))
.unwrap()
.into_iter()
.collect();
assert_eq!(result, Vec::<PathBuf>::new())
} | rust_cleaned_test_functions.jsonl/13396 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 152
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
8206,
1288,
1243,
39904,
38344,
368,
341,
262,
1077,
282,
284,
3393,
18930,
486,
931,
543,
262,
1077,
312,
284,
26146,
486,
931,
2601,
1,
8221,
38813,
77,
44891,
15454,
1428,
262,
1077,
1102... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_merge_with_overflows() {
let mut testing_hll = TestingHll::new(12);
let mut hll1 = DenseHll::new(12);
let mut hll2 = DenseHll::new(12);
// these two numbers cause overflows
// TODO: ported directly from Java.
// Ensure hashes for the numbers are the same in rust implementation.
let mut hasher1 = XxHash64::default();
hasher1.write_i32(25130);
let hash1 = hasher1.finish();
let mut hasher2 = XxHash64::default();
hasher2.write_i32(227291);
let hash2 = hasher2.finish();
hll1.insert_hash(hash1);
testing_hll.insert_hash(hash1);
hll2.insert_hash(hash2);
testing_hll.insert_hash(hash2);
hll1.merge_with(&hll2);
hll1.verify();
for i in 0..testing_hll.buckets().len() {
assert_eq!(hll1.get_value(i as u32), testing_hll.buckets()[i]);
}
} | rust_cleaned_test_functions.jsonl/78018 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 552
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20888,
6615,
15431,
38140,
368,
341,
310,
1077,
5206,
7497,
1523,
654,
284,
26768,
39,
654,
486,
931,
7,
16,
17,
317,
310,
1077,
5206,
305,
654,
16,
284,
42522,
39,
654,
486,
931,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_serialize_empty_setoption() {
assert_eq!(UciMessage::SetOption {
name: "ABC".to_string(),
value: Some(String::from("")),
}.serialize(), "setoption name ABC value <empty>")
} | rust_cleaned_test_functions.jsonl/19072 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 114
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
88686,
15124,
2602,
2047,
368,
341,
286,
2060,
10714,
10297,
52,
5855,
2052,
486,
1649,
5341,
341,
310,
829,
25,
330,
25411,
3263,
983,
3904,
3148,
310,
897,
25,
4329,
2242,
486,
1499,
445,
3015... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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();
check_stack(&stack, vec![None]);
stack.push(1);
check_stack(&stack, vec![None, Some(1)]);
stack.push(2);
check_stack(&stack, vec![None, Some(1), Some(2)]);
stack.enter();
check_stack(&stack, vec![None, Some(1), Some(2), None]);
stack.push(3);
check_stack(&stack, vec![None, Some(1), Some(2), None, Some(3)]);
stack.discard();
check_stack(&stack, vec![None, Some(1), Some(2)]);
stack.enter();
check_stack(&stack, vec![None, Some(1), Some(2), None]);
stack.push(4);
check_stack(&stack, vec![None, Some(1), Some(2), None, Some(4)]);
stack.enter();
check_stack(&stack, vec![None, Some(1), Some(2), None, Some(4), None]);
stack.push(5);
check_stack(
&stack,
vec![None, Some(1), Some(2), None, Some(4), None, Some(5)],
);
stack.commit();
check_stack(&stack, vec![None, Some(1), Some(2), None, Some(4), Some(5)]);
stack.discard();
check_stack(&stack, vec![None, Some(1), Some(2)]);
stack.push(6);
check_stack(&stack, vec![None, Some(1), Some(2), Some(6)]);
stack.enter();
check_stack(&stack, vec![None, Some(1), Some(2), Some(6), None]);
stack.enter();
check_stack(&stack, vec![None, Some(1), Some(2), Some(6), None, None]);
stack.enter();
check_stack(
&stack,
vec![None, Some(1), Some(2), Some(6), None, None, None],
);
stack.commit();
check_stack(&stack, vec![None, Some(1), Some(2), Some(6), None, None]);
stack.discard();
check_stack(&stack, vec![None, Some(1), Some(2), Some(6), None]);
stack.push(7);
assert_eq!(stack.into_vec(), vec![1, 2, 6, 7]);
} | rust_cleaned_test_functions.jsonl/13445 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 958
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15528,
368,
341,
286,
1077,
5206,
5611,
284,
14284,
486,
931,
2129,
715,
286,
1779,
15528,
2099,
7693,
11,
7486,
20703,
4064,
10149,
286,
5611,
2552,
7,
16,
1215,
715,
286,
1779,
15528,
2099,
76... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_read_overflow_arithmetic() {
let pos = <u32>::max_value();
let buf = vec![255; 0];
<Vec<u8> as Field>::check(&buf, pos.into(), 8.into(), pos.into())
.expect("Found error in check");
} | rust_cleaned_test_functions.jsonl/118837 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 103
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
79073,
25842,
25922,
368,
341,
262,
1077,
1133,
284,
366,
84,
18,
17,
6831,
2810,
3142,
543,
262,
1077,
6607,
284,
7486,
20703,
17,
20,
20,
26,
220,
15,
4821,
262,
366,
10050,
34837,
23,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_states_index_iterator() -> Fallible<()> {
let mut fst = VectorFst::new();
// States
let s1 = fst.add_state();
let s2 = fst.add_state();
let s3 = fst.add_state();
fst.set_start(s1)?;
// Arcs
let arc_1_2 = Arc::new(0, 0, ProbabilityWeight::new(1.0), s2);
let arc_1_2_bis = Arc::new(0, 0, ProbabilityWeight::new(1.0), s2);
let arc_2_3 = Arc::new(0, 0, ProbabilityWeight::new(1.0), s3);
let arc_2_3_bis = Arc::new(0, 0, ProbabilityWeight::new(1.0), s3);
fst.add_arc(s1, arc_1_2.clone())?;
fst.add_arc(s1, arc_1_2_bis.clone())?;
fst.add_arc(s2, arc_2_3.clone())?;
fst.add_arc(s2, arc_2_3_bis.clone())?;
let states = fst.states_index_iter().map(|it| fst.get_state_id(it)).collect::<Fallible<Vec<_>>>()?;
assert_eq!(states, vec![s1, s2, s3]);
Ok(())
} | rust_cleaned_test_functions.jsonl/47861 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 501
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
22972,
3560,
13491,
368,
1464,
14785,
1238,
71698,
341,
286,
1077,
5206,
48434,
284,
4196,
37,
267,
486,
931,
1428,
286,
442,
4180,
198,
286,
1077,
274,
16,
284,
48434,
1364,
4387,
543,
286,
107... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 7 |
#[test]
fn test_existing_playlist() {
let spotify = Spotify::default()
.client_credentials_manager(CLIENT_CREDENTIAL.lock().unwrap().clone())
.build();
let playlist = spotify.playlist("37i9dQZF1DZ06evO45P0Eo", None, None);
assert!(playlist.is_ok());
} | rust_cleaned_test_functions.jsonl/96525 | {
"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,
62630,
69267,
368,
341,
14808,
262,
1077,
87790,
284,
40537,
486,
2258,
741,
286,
659,
2972,
47396,
12144,
52991,
10757,
920,
81509,
21003,
1005,
15454,
1005,
19982,
2398,
286,
659,
5834,
1428,
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_report_next() {
let subcommand = Subcommand::Report {
filter: Filter {
..Default::default()
},
report_name: "next".to_owned(),
};
assert_eq!(
Subcommand::parse(argv![]).unwrap(),
(&EMPTY[..], subcommand)
);
} | rust_cleaned_test_functions.jsonl/84287 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 191
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14813,
11257,
368,
341,
286,
1077,
1186,
5631,
284,
3719,
5631,
486,
10361,
341,
310,
4051,
25,
12339,
341,
394,
5241,
3675,
486,
2258,
741,
310,
1153,
310,
1895,
1269,
25,
330,
3600,
3263,
983,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_opaque_delivery() {
let mut ctx = setup_encoder::<u8>(
64,
80,
10,
100,
8,
ChromaSampling::Cs420,
0,
5,
0,
false,
0,
false,
10,
None,
);
let kf_at = 3;
let limit = 5;
for i in 0..limit {
send_frame_kf(&mut ctx, kf_at == i);
}
ctx.flush();
while let Ok(pkt) = ctx.receive_packet() {
let Packet { opaque, input_frameno, .. } = pkt;
if let Some(opaque) = opaque {
let kf = opaque.downcast::<bool>().unwrap();
assert_eq!(kf, Box::new(input_frameno == kf_at));
}
}
} | rust_cleaned_test_functions.jsonl/80118 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 303
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10287,
19659,
50562,
368,
341,
220,
1077,
5206,
5635,
284,
6505,
39068,
27638,
84,
23,
17055,
262,
220,
21,
19,
345,
262,
220,
23,
15,
345,
262,
220,
16,
15,
345,
262,
220,
16,
15,
15,
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... | 4 |
#[test]
fn test_no_run() {
let p = project()
.file("src/lib.rs", "#[test] fn foo() { panic!() }")
.build();
p.cargo("test --no-run")
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
} | rust_cleaned_test_functions.jsonl/95356 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 177
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6536,
14007,
368,
341,
262,
1077,
281,
284,
2390,
741,
286,
659,
1192,
445,
3548,
8194,
25638,
497,
5869,
58,
1944,
60,
5168,
15229,
368,
314,
21975,
0,
368,
335,
1138,
286,
659,
5834,
1428,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_create_datetime_from_str_fail() {
assert!(Value::datetime_from_str("2012", "01", "03", "3", "30", "30").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "03", "3", "30").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "03", "30", "3").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "033", "30", "30").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "03", "303", "303").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "0q", "30", "30").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "03", "3q", "30").is_err());
assert!(Value::datetime_from_str("2012", "01", "03", "03", "30", "3q").is_err());
} | rust_cleaned_test_functions.jsonl/86212 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 328
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8657,
28943,
5673,
2895,
22121,
368,
341,
262,
2060,
10297,
1130,
486,
15450,
5673,
2895,
445,
17,
15,
16,
17,
497,
330,
15,
16,
497,
330,
15,
18,
497,
330,
18,
497,
330,
18,
15,
497,
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... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.