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_number_successes() {
assert_token!("4", TokenKind::IntegerLiteral, 0, 1);
assert_token!("4.123", TokenKind::FloatLiteral, 0, 5);
assert_token!("-4", TokenKind::IntegerLiteral, 0, 2);
assert_token!("9", TokenKind::IntegerLiteral, 0, 1);
assert_token!("0", T... | rust_cleaned_test_functions.jsonl/1903 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 531
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5500,
18632,
288,
368,
341,
286,
2060,
6458,
17223,
19,
497,
9660,
10629,
486,
3486,
17350,
11,
220,
15,
11,
220,
16,
317,
286,
2060,
6458,
17223,
19,
13,
16,
17,
18,
497,
9660,
10629,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_node_compact_reserve_max_ticks() {
let count = 5;
let mut cluster = new_node_cluster(0, count);
test_compact_reserve_max_ticks(&mut cluster);
} | rust_cleaned_test_functions.jsonl/110348 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 78
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5084,
18177,
531,
89591,
6345,
49961,
368,
341,
262,
1077,
1760,
284,
220,
20,
280,
262,
1077,
5206,
10652,
284,
501,
5084,
28441,
7,
15,
11,
1760,
317,
262,
1273,
18177,
531,
89591,
6345,
49961... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_second_order_problem_rkf45_adaptive() -> Result<(), Error> {
let dydt = |_t: f64, y: &[f64]| -> Vec<f64> { vec![y[1], -y[0]] };
let y_true = |t: f64| -> f64 { f64::cos(t) };
let options = AdaptiveOdeSolverOptions {
t_initial: 0.0,
t_final: 2.0 * P... | rust_cleaned_test_functions.jsonl/23083 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 383
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
29644,
7869,
60139,
1710,
81869,
19,
20,
10027,
27781,
368,
1464,
5714,
68843,
4600,
29,
341,
286,
1077,
13955,
8047,
284,
70886,
83,
25,
282,
21,
19,
11,
379,
25,
44590,
69,
21,
19,
29685,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_update_operation() {
assert_eq!(
"UPDATE Table SET field2 = field2 + 1 WHERE Table.id = 1",
to_sql!(Table.get(1).update(field2 += 1))
);
assert_eq!(
"UPDATE Table SET field2 = field2 - 3 WHERE Table.id = 1",
to_sql!(Table.get(1).update(field2 -= 3))
... | rust_cleaned_test_functions.jsonl/50739 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 434
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8882,
32565,
368,
341,
262,
2060,
10714,
33673,
286,
330,
9239,
6633,
9019,
2070,
17,
284,
2070,
17,
488,
220,
16,
5288,
6633,
1764,
284,
220,
16,
756,
286,
311,
18063,
10297,
2556,
670,
7,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_convert_accumulator_proof_malformed_hashes() {
let mut sibling0 = b"0".test_only_hash().to_vec();
sibling0.push(1);
let mut compressed_proof = crate::proto::proof::AccumulatorProof::new();
compressed_proof.set_bitmap(0b100);
compressed_proof.mut_non_default_siblings().push(s... | rust_cleaned_test_functions.jsonl/103130 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 156
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34910,
75837,
10511,
86757,
717,
278,
10155,
91616,
368,
341,
262,
1077,
5206,
44223,
15,
284,
293,
1,
15,
3263,
1944,
18410,
8950,
1005,
983,
13251,
543,
262,
44223,
15,
2552,
7,
16,
626,
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_do_not_graft_within_default_backoff_period_after_receiving_prune_without_backoff() {
//set default backoff period to 1 second
let config = GossipsubConfigBuilder::default()
.prune_backoff(Duration::from_millis(90))
.backoff_slack(1)
.heartbeat_... | rust_cleaned_test_functions.jsonl/66901 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 901
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
26309,
7913,
15682,
64,
723,
72385,
9993,
3895,
1847,
20818,
19844,
1288,
46344,
5294,
2886,
39904,
3895,
1847,
368,
341,
286,
442,
746,
1638,
1182,
1847,
4168,
311,
220,
16,
2086,
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... | 3 |
#[test]
fn test_token_id_shift() {
let expansion = parse_macro(
r#"
macro_rules! foobar {
($e:ident) => { foo bar $e }
}
"#,
)
.expand_tt("foobar!(baz);");
fn get_id(t: &tt::TokenTree) -> Option<u32> {
if let tt::TokenTree::Leaf(tt::Leaf::Ident(ident)) = t {
retu... | rust_cleaned_test_functions.jsonl/28701 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 362
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6458,
842,
22230,
368,
341,
262,
1077,
14461,
284,
4715,
58810,
1006,
286,
435,
2,
698,
32606,
21407,
0,
11756,
31393,
341,
262,
1711,
68,
25,
1713,
8,
589,
314,
15229,
3619,
400,
68,
456,
532... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_double() {
match Variant::VInteger(1).plus(Variant::VDouble(0.6)).unwrap() {
Variant::VDouble(result) => assert_eq!(result, 1.6),
_ => panic!("assertion failed"),
}
} | rust_cleaned_test_functions.jsonl/84544 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 155
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24598,
368,
341,
394,
2432,
39292,
486,
53,
3486,
7,
16,
568,
7138,
12410,
15341,
486,
53,
7378,
7,
15,
13,
21,
4579,
15454,
368,
341,
503,
39292,
486,
53,
7378,
4456,
8,
589,
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,
1... | 2 |
#[test]
fn test_print() {
let e1 = Expr::symbol("hello");
let e2 = Expr::fnum(3.2);
let e3 = Expr::list(&[Expr::symbol("hello"), Expr::symbol("world")]);
let mut env = Environment::empty();
assert_eq!("hello", gen_print_output(e1.clone(), &mut env));
assert_eq!(... | rust_cleaned_test_functions.jsonl/55391 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 946
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10064,
368,
341,
286,
1077,
384,
16,
284,
28819,
486,
18785,
445,
14990,
797,
286,
1077,
384,
17,
284,
28819,
486,
69,
2413,
7,
18,
13,
17,
317,
286,
1077,
384,
18,
284,
28819,
486,
1607,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_example_circuit() {
let circuit = parse_input(INPUT).unwrap();
assert_eq!(circuit.value("d"), Some(72));
assert_eq!(circuit.value("e"), Some(507));
assert_eq!(circuit.value("f"), Some(492));
assert_eq!(circuit.value("g"), Some(114));
assert_eq!(cir... | rust_cleaned_test_functions.jsonl/7237 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 240
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39304,
666,
37268,
368,
341,
286,
1077,
16224,
284,
4715,
5898,
57911,
568,
15454,
543,
286,
2060,
10714,
10297,
66,
37268,
2824,
445,
67,
3975,
4329,
7,
22,
17,
1106,
286,
2060,
10714,
10297,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_is_slot_confirmed_unknown_slot() {
let locktower = Locktower::new(EpochStakes::new_for_tests(2), 1, 0.67);
let stakes = HashMap::new();
assert!(!locktower.is_slot_confirmed(0, &stakes));
} | rust_cleaned_test_functions.jsonl/25561 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 108
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6892,
27563,
16059,
8434,
57507,
27563,
368,
341,
286,
1077,
5296,
77578,
284,
15701,
77578,
486,
931,
10722,
79,
4953,
623,
2050,
486,
931,
5478,
32509,
7,
17,
701,
220,
16,
11,
220,
15,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_parse_comment() {
let comment = parse_comment(FileSpan::new(Rc::new(String::from(" \t#test\n")), Rc::new(String::from("input")))).unwrap().1;
assert_eq!(&*comment, "test");
} | rust_cleaned_test_functions.jsonl/68369 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 88
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
17638,
368,
341,
262,
1077,
3980,
284,
4715,
17638,
19821,
12485,
486,
931,
2785,
66,
486,
931,
2242,
486,
1499,
445,
1124,
83,
2,
1944,
1699,
35674,
81463,
486,
931,
2242,
486,
1499,
445... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_set_state() {
let mut search_info: SearchInfo<TestBackend> = SearchInfo::default();
let query = String::from("this is test query");
let mode = SearchMode::ThirtyMinutes;
let state = SearchState::new(query.clone(), mode.clone());
assert!(!search_info.is_sam... | rust_cleaned_test_functions.jsonl/106404 | {
"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,
2602,
4387,
368,
341,
286,
1077,
5206,
2711,
3109,
25,
7542,
1731,
71273,
29699,
29,
284,
7542,
1731,
486,
2258,
543,
286,
1077,
3239,
284,
923,
486,
1499,
445,
574,
374,
1273,
3239,
797,
286,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_full_node() {
let env = SynchronizerEnv::new(SynchronizerEnv::default_handler(), RoleType::FullNode);
env.commit(1, 10);
// first sync should be fulfilled immediately after peer discovery
assert!(env.wait_for_version(0, 10));
env.commit(1, 20);
// second sync will be done... | rust_cleaned_test_functions.jsonl/37391 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 158
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16372,
5084,
368,
341,
262,
1077,
6105,
284,
328,
14113,
3135,
14359,
486,
931,
3759,
14113,
3135,
14359,
486,
2258,
10183,
1507,
15404,
929,
486,
9432,
1955,
317,
262,
6105,
15728,
7,
16,
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_count_leading_lines() {
assert_eq!(count_leading_lines(""), ("", 0));
assert_eq!(count_leading_lines("foo"), ("foo", 0));
assert_eq!(count_leading_lines("foo\n"), ("foo\n", 0));
assert_eq!(count_leading_lines("foo\nbar"), ("bar", 1));
assert_eq!(count_lead... | rust_cleaned_test_functions.jsonl/118129 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 481
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3180,
11751,
2228,
18323,
368,
341,
286,
2060,
10714,
10297,
1830,
11751,
2228,
18323,
86076,
3489,
497,
220,
15,
1106,
286,
2060,
10714,
10297,
1830,
11751,
2228,
18323,
445,
7975,
3975,
3489,
7975... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_new_empty() {
let root_hash = *SPARSE_MERKLE_PLACEHOLDER_HASH;
let smt = SparseMerkleTree::new(root_hash);
assert!(smt.root_weak().is_empty());
assert_eq!(smt.root_hash(), root_hash);
} | rust_cleaned_test_functions.jsonl/63259 | {
"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,
5921,
15124,
368,
341,
262,
1077,
3704,
8950,
284,
353,
4592,
79097,
1245,
640,
42,
867,
81924,
94629,
32309,
280,
262,
1077,
1525,
83,
284,
71794,
44,
16754,
273,
6533,
486,
931,
9206,
8950,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_update_config_version() -> Result<(), Box<dyn std::error::Error>> {
let conf = corosync_conf_fixture();
let conf = std::str::from_utf8(&conf)?
.trim()
.lines()
.map(|x| x.to_string());
let conf = Vec::from_iter(update_config_version(c... | rust_cleaned_test_functions.jsonl/23873 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 201
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8882,
5332,
9438,
368,
1464,
5714,
68843,
8261,
92846,
1460,
486,
841,
486,
1454,
2452,
341,
286,
1077,
2335,
284,
1829,
436,
1721,
16059,
74409,
1428,
286,
1077,
2335,
284,
1460,
486,
495,
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_check_update_vote_state_slots_not_ordered() {
let slot_hashes = build_slot_hashes(vec![1, 2, 3, 4]);
let vote_state = build_vote_state(vec![1], &slot_hashes);
// Test with a `vote_state_update` where the slots are out of order
let vote_slot = 3;
let vote_... | rust_cleaned_test_functions.jsonl/6134 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 600
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
8882,
54360,
4387,
54161,
7913,
75272,
368,
341,
286,
1077,
9446,
91616,
284,
1936,
27563,
91616,
25592,
20703,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
2558,
286,
1077,
6910,
4387,
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_checkmates() {
//rook back-rank
let mut game = Game::new();
game.create_piece(1, 5, 0);
game.create_piece(0, 5, 16);
game.create_piece(0, 3, 15);
game.set_moves();
assert_eq!(
crate::best_move(&mut game, 0, 1, i128::max_value())... | rust_cleaned_test_functions.jsonl/120648 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 342
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
16457,
368,
341,
286,
442,
299,
562,
1182,
3795,
1180,
198,
286,
1077,
5206,
1809,
284,
4050,
486,
931,
543,
286,
1809,
2520,
48470,
7,
16,
11,
220,
20,
11,
220,
15,
317,
286,
1809,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_get_source_code_multiple_downloads_of_same_file() {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
let specifier = ModuleSpecifier::resolve_url(
"http://localhost:4545/tests/subdir/mismatch_ext.ts",
)
.unwrap();
let... | rust_cleaned_test_functions.jsonl/16753 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 626
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
10347,
4136,
45233,
13998,
32685,
3575,
33574,
2458,
368,
341,
262,
1077,
1758,
12015,
36796,
284,
17717,
486,
1944,
18974,
486,
1254,
12015,
543,
262,
1077,
5453,
3888,
4334,
11,
7807,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_many_float() {
let s = "1576540098.52,1576540098.53";
let (_, next) = DateTime::read(s, Format::EpochSeconds, ',').expect("valid");
assert_eq!(next, "1576540098.53");
} | rust_cleaned_test_functions.jsonl/33402 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 111
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
22101,
17586,
368,
341,
286,
1077,
274,
284,
330,
16,
20,
22,
21,
20,
19,
15,
15,
24,
23,
13,
20,
17,
11,
16,
20,
22,
21,
20,
19,
15,
15,
24,
23,
13,
20,
18,
876,
286,
1077,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_parsing_of_recursive_type_fixed() {
let schema = r#"
{
"type": "record",
"name": "User",
"namespace": "office",
"fields": [
{
"name": "details",
"type": [
{
"type": "record",
... | rust_cleaned_test_functions.jsonl/108438 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 966
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
620,
28598,
3575,
66242,
1819,
37839,
368,
341,
286,
1077,
10802,
284,
435,
2,
698,
262,
341,
286,
330,
1313,
788,
330,
8548,
756,
286,
330,
606,
788,
330,
1474,
756,
286,
330,
2231,
788,
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 |
#[test]
fn test_try_from_get_info() {
let (mut sender, receiver) = UnixStream::pair().unwrap();
let mut connection = HttpConnection::new(receiver);
sender
.write_all(http_request("GET", "/", None).as_bytes())
.unwrap();
assert!(connection.try_read().is_ok(... | rust_cleaned_test_functions.jsonl/106571 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 202
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53283,
5673,
3062,
3109,
368,
341,
286,
1077,
320,
6984,
4646,
11,
13964,
8,
284,
46995,
3027,
486,
12670,
1005,
15454,
543,
286,
1077,
5206,
3633,
284,
4823,
4526,
486,
931,
78126,
317,
286,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_invalid_option_argument() {
let err = OptParseError::invalid_option_argument("--abc", "invalid float literal");
let thing = format!("{}", err);
let expect = "Invalid option argument: --abc: invalid float literal";
assert_eq!(thing, expect);
} | rust_cleaned_test_functions.jsonl/8273 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 118
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31433,
9672,
9025,
368,
341,
286,
1077,
1848,
284,
16554,
14463,
1454,
486,
11808,
9672,
9025,
21549,
13683,
497,
330,
11808,
2224,
23141,
797,
286,
1077,
3166,
284,
3561,
79878,
1848,
317,
286,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_spawn_sched() {
use clone::Clone;
let (tx, rx) = channel();
fn f(i: i32, tx: Sender<()>) {
let tx = tx.clone();
thread::spawn(move|| {
if i == 0 {
tx.send(()).unwrap();
} else {
... | rust_cleaned_test_functions.jsonl/109008 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 286
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
76026,
67394,
368,
341,
286,
990,
14715,
486,
37677,
401,
286,
1077,
320,
3998,
11,
19111,
8,
284,
5496,
1428,
286,
5168,
282,
1956,
25,
600,
18,
17,
11,
9854,
25,
54610,
27,
368,
9231,
341,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_poly_is_convex() {
let poly = [
Point2D::new(0.0, 0.0),
Point2D::new(5.0, 0.0),
Point2D::new(5.0, 5.0),
Point2D::new(0.0, 5.0),
Point2D::new(0.0, 0.0),
];
// point on rectangle
assert!(poly_is_convex(&pol... | rust_cleaned_test_functions.jsonl/40387 | {
"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,
36133,
6892,
22716,
327,
368,
341,
286,
1077,
9861,
284,
2278,
310,
5126,
17,
35,
486,
931,
7,
15,
13,
15,
11,
220,
15,
13,
15,
1326,
310,
5126,
17,
35,
486,
931,
7,
20,
13,
15,
11,
220,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_contains() {
let r = Rect::new(Point2D::new(-20, 15), Size2D::new(100, 200));
assert!(r.contains(&Point2D::new(0, 50)));
assert!(r.contains(&Point2D::new(-10, 200)));
// bottom/right edges.
assert!(r.contains(&Point2D::new(-20, 15)));
as... | rust_cleaned_test_functions.jsonl/24158 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 862
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
63598,
368,
341,
286,
1077,
435,
284,
11920,
486,
931,
32737,
17,
35,
486,
931,
4080,
17,
15,
11,
220,
16,
20,
701,
8478,
17,
35,
486,
931,
7,
16,
15,
15,
11,
220,
17,
15,
15,
3237,
286,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_invalid_funding_tx() {
// Test that we properly handle invalid funding transactions sent to us from a peer.
let chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
let no... | rust_cleaned_test_functions.jsonl/16963 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1003
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31433,
761,
37189,
17805,
368,
341,
197,
322,
3393,
429,
582,
10277,
3705,
8318,
10773,
14131,
3208,
311,
601,
504,
264,
14397,
624,
11120,
49106,
10217,
26023,
1645,
18343,
82,
284,
1855,
45552,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_add_worker() {
new_test_ext().execute_with(|| {
set_block_1();
let worker1 = worker_pubkey(1);
let worker2 = worker_pubkey(2);
assert_ok!(PhalaRegistry::force_register_worker(
Origin::root(),
worker1.clone(),
ecdh_pubkey(1),
Some(1)
));
asser... | rust_cleaned_test_functions.jsonl/60459 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 831
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2891,
40385,
368,
341,
298,
8638,
4452,
9927,
1005,
10257,
6615,
79453,
341,
571,
8196,
7113,
62,
16,
543,
571,
10217,
11864,
16,
284,
11864,
34014,
792,
7,
16,
317,
571,
10217,
11864,
17,
284,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_boolean_equal() {
let a = BooleanArray::from(vec![false, false, true]);
let b = BooleanArray::from(vec![false, false, true]);
assert!(a.equals(&b));
assert!(b.equals(&a));
let b = BooleanArray::from(vec![false, false, false]);
assert!(!a.equals(&b... | rust_cleaned_test_functions.jsonl/887 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 728
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
46642,
11478,
368,
341,
286,
1077,
264,
284,
6992,
1857,
486,
1499,
25592,
20703,
3849,
11,
895,
11,
830,
2558,
286,
1077,
293,
284,
6992,
1857,
486,
1499,
25592,
20703,
3849,
11,
895,
11,
830,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_vcx_credential_create_with_offer_success() {
let _setup = SetupMocks::init();
let handle = _vcx_credential_create_with_offer_c_closure(ARIES_CREDENTIAL_OFFER).unwrap();
assert!(handle > 0);
} | rust_cleaned_test_functions.jsonl/115031 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 111
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2273,
25844,
666,
30320,
8657,
6615,
67814,
18632,
368,
341,
286,
1077,
716,
15188,
284,
18626,
72577,
486,
2327,
1428,
286,
1077,
3705,
284,
716,
7362,
87,
666,
30320,
8657,
6615,
67814,
666,
728... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_startup_sync_state_with_empty_consensus_db() {
let mut swarm = new_local_swarm(4);
let validator_peer_ids = swarm.validators().map(|v| v.peer_id()).collect::<Vec<_>>();
let client_1 = swarm
.validator(validator_peer_ids[1])
.unwrap()
.json_rpc_client();
le... | rust_cleaned_test_functions.jsonl/10526 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 959
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
80858,
23008,
4387,
6615,
15124,
31971,
13626,
8685,
368,
341,
262,
1077,
5206,
60841,
284,
501,
13564,
32581,
2178,
7,
19,
317,
262,
1077,
22935,
45159,
8077,
284,
60841,
82728,
1005,
2186,
22428,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sboxes() {
test_sbox(sboxes::S_TC26, sboxes_exp::S_TC26);
test_sbox(sboxes::S_TEST, sboxes_exp::S_TEST);
test_sbox(sboxes::S_CRYPTOPRO_A, sboxes_exp::S_CRYPTOPRO_A);
test_sbox(sboxes::S_CRYPTOPRO_B, sboxes_exp::S_CRYPTOPRO_B);
test_sbox(sboxes::S_CRYPTOPRO_C, sboxes_exp::S_CR... | rust_cleaned_test_functions.jsonl/18967 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 222
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
643,
22204,
368,
341,
262,
1273,
643,
2011,
1141,
22204,
486,
50,
56738,
17,
21,
11,
274,
22204,
14214,
486,
50,
56738,
17,
21,
317,
262,
1273,
643,
2011,
1141,
22204,
486,
50,
11641,
11,
274,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_name_space_truncate() {
init_logging();
let bucket_name = format!("test-name-space-{}", get_time().sec);
let test_client = TestS3Client::new(bucket_name.clone());
test_client.create_test_bucket(bucket_name.clone());
let filename_spaces = "spaces ".to_owned();
test_... | rust_cleaned_test_functions.jsonl/112580 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 364
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1269,
14663,
3547,
26900,
368,
341,
262,
2930,
59982,
1428,
262,
1077,
15621,
1269,
284,
3561,
17223,
1944,
11494,
27947,
12,
42351,
633,
3009,
1005,
5024,
317,
262,
1077,
1273,
8179,
284,
3393,
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_spqlios_fft_ifft() {
let n = 1024;
let mut plan = FFTPlan::new(n);
let mut rng = rand::thread_rng();
let mut a: Vec<u32> = vec![0u32; n];
a.iter_mut().for_each(|e| *e = rng.gen::<u32>());
let a_fft = plan.spqlios.ifft(&a);
let res = plan.s... | rust_cleaned_test_functions.jsonl/109564 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 308
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10123,
6905,
436,
67059,
11119,
723,
368,
341,
286,
1077,
308,
284,
220,
16,
15,
17,
19,
280,
286,
1077,
5206,
3119,
284,
60036,
20485,
486,
931,
1445,
317,
286,
1077,
5206,
28422,
284,
10382,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_serde_roundtrip() {
::init().unwrap();
// Some
let clocktime = ClockTime::from_nseconds(42_123_456_789);
let clocktime_ser = ron::ser::to_string(&clocktime).unwrap();
let clocktime: ClockTime = ron::de::from_str(clocktime_ser.as_str()).unwrap();
a... | rust_cleaned_test_functions.jsonl/5553 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 362
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
75861,
450,
29896,
32981,
368,
341,
286,
3504,
2327,
1005,
15454,
1428,
286,
442,
4329,
198,
286,
1077,
8866,
1678,
284,
26142,
1462,
486,
1499,
1089,
17403,
7,
19,
17,
62,
16,
17,
18,
62,
19,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_channel_data_decode() -> Result<()> {
let tests = vec![
("small", vec![1, 2, 3], Error::ErrUnexpectedEof),
(
"zeroes",
vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
Error::ErrInvalidChannelNumber,
),
(
"bad chan numb... | rust_cleaned_test_functions.jsonl/76713 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 650
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14571,
1769,
15227,
368,
1464,
5714,
71698,
341,
262,
1077,
7032,
284,
7486,
90515,
286,
3489,
9004,
497,
7486,
20703,
16,
11,
220,
17,
11,
220,
18,
1125,
4600,
486,
7747,
29430,
36,
1055,
1326,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_parse_token() {
let mint_pubkey = SplTokenPubkey::new(&[2; 32]);
let owner_pubkey = SplTokenPubkey::new(&[3; 32]);
let mut account_data = vec![0; Account::get_packed_len()];
let mut account = Account::unpack_unchecked(&account_data).unwrap();
account.mint ... | rust_cleaned_test_functions.jsonl/103627 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1821
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
6458,
368,
341,
286,
1077,
28337,
34014,
792,
284,
51198,
3323,
29162,
792,
486,
931,
2099,
58,
17,
26,
220,
18,
17,
2558,
286,
1077,
6372,
34014,
792,
284,
51198,
3323,
29162,
792,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_basic_block_ordering() {
let context = Context::create();
let module = context.create_module("test");
let builder = context.create_builder();
assert!(builder.get_insert_block().is_none());
let i128_type = context.i128_type();
let fn_type = i128_type.fn_type(&[], false);... | rust_cleaned_test_functions.jsonl/125600 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1103
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34729,
7113,
7869,
287,
368,
341,
262,
1077,
2266,
284,
9608,
486,
3182,
543,
262,
1077,
4688,
284,
2266,
2520,
10750,
445,
1944,
797,
262,
1077,
7363,
284,
2266,
2520,
28532,
1428,
262,
2060,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_pem() {
let sk_pem = "-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIMXY1NUbUe/3dW2YUoKW5evsnCJPMfj60/q0RzGne3gg
-----END PRIVATE KEY-----\n";
let sk = SecretKey::from_pem(sk_pem).unwrap();
let pk_pem = "-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAyrRjJfTnhMcW5igzYvPirFW5eUgMdKeClG... | rust_cleaned_test_functions.jsonl/64225 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 360
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
620,
336,
368,
341,
262,
1077,
1901,
620,
336,
284,
330,
15081,
37588,
57793,
12013,
34764,
11604,
19,
5049,
48,
22600,
33,
48,
56,
18301,
17,
53,
86,
4897,
5371,
1791,
16356,
16,
3926,
65,
52... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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() {
let test_parser = parsers::Parser::Test;
let mock = mock_request();
let report_result = report(&test_parser, "prefix", None, "123abc", "swift", "xyz");
assert!(report_result.is_ok());
mock.assert();
} | rust_cleaned_test_functions.jsonl/130166 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 124
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14813,
368,
341,
286,
1077,
1273,
18517,
284,
87073,
486,
6570,
486,
2271,
280,
286,
1077,
7860,
284,
7860,
7893,
1428,
286,
1077,
1895,
5287,
284,
1895,
2099,
1944,
18517,
11,
330,
11849,
497,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_filter_shebang() {
assert_eq!(filter_shebang(b"#!"[..].to_owned()), b"");
assert_eq!(filter_shebang(b"#!\n\n"[..].to_owned()), b"\n\n");
let code = b"#!/usr/bin/env deno\nconsole.log('hello');\n"[..].to_owned();
assert_eq!(filter_shebang(code), b"\nconsole.log('hello');\n");
} | rust_cleaned_test_functions.jsonl/72066 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 153
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8727,
643,
383,
27174,
368,
341,
262,
2060,
10714,
10297,
5315,
643,
383,
27174,
1883,
1,
8010,
36864,
496,
936,
983,
51973,
11858,
293,
1,
797,
262,
2060,
10714,
10297,
5315,
643,
383,
27174,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_home_archive_old_key() {
let dir = tempdir().unwrap();
fs::create_dir_all(dir.path().join(".shuffle/accounts/latest")).unwrap();
let home = Home::new(dir.path()).unwrap();
let private_key = home.generate_key_file().unwrap();
let time = duration_since_epo... | rust_cleaned_test_functions.jsonl/123533 | {
"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,
21653,
42873,
21108,
3097,
368,
341,
286,
1077,
5419,
284,
2730,
3741,
1005,
15454,
543,
286,
8619,
486,
3182,
4334,
5705,
14161,
3875,
1005,
5987,
5680,
65355,
83743,
33149,
15197,
15454,
1428,
286... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_mut_int_totalord() {
assert_eq!((&mut 5i).cmp(&&mut 10), Less);
assert_eq!((&mut 10i).cmp(&&mut 5), Greater);
assert_eq!((&mut 5i).cmp(&&mut 5), Equal);
assert_eq!((&mut -5i).cmp(&&mut 12), Less);
assert_eq!((&mut 12i).cmp(&&mut -5), Greater);
} | rust_cleaned_test_functions.jsonl/101457 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 136
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
29523,
4042,
10784,
539,
368,
341,
262,
2060,
10714,
0,
42902,
6984,
220,
20,
72,
568,
7293,
2099,
5,
6984,
220,
16,
15,
701,
9668,
317,
262,
2060,
10714,
0,
42902,
6984,
220,
16,
15,
72,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_read_length_prefix() {
let test_bytes: Vec<u8> = hex::decode(TEST_HEX).expect("");
let mut binary_parser = BinaryParser::from(test_bytes.as_ref());
let result = binary_parser.read_length_prefix();
assert!(result.is_ok());
assert_eq!(result, Ok(0));
} | rust_cleaned_test_functions.jsonl/20417 | {
"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,
6443,
5118,
13974,
368,
341,
286,
1077,
1273,
12524,
25,
11312,
34837,
23,
29,
284,
12371,
486,
18196,
50320,
86502,
568,
17119,
13056,
286,
1077,
5206,
7868,
18517,
284,
17718,
6570,
486,
1499,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_option_parse() {
// one octet of padding
let opt = Ipv6Option::new_unchecked(&IPV6OPTION_BYTES_PAD1);
let pad1 = Repr::parse(&opt).unwrap();
assert_eq!(pad1, Repr::Pad1);
assert_eq!(pad1.buffer_len(), 1);
// two or more octets of padding
l... | rust_cleaned_test_functions.jsonl/130721 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 385
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9672,
21039,
368,
341,
286,
442,
825,
18491,
295,
315,
5300,
198,
286,
1077,
3387,
284,
358,
30168,
21,
5341,
486,
931,
4907,
7549,
2099,
3298,
53,
21,
34057,
40705,
36451,
16,
317,
286,
1077,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_variants() {
serde_test::assert_tokens(&WebhookType::Incoming, &[Token::U8(1)]);
serde_test::assert_tokens(&WebhookType::ChannelFollower, &[Token::U8(2)]);
serde_test::assert_tokens(&WebhookType::Application, &[Token::U8(3)]);
} | rust_cleaned_test_functions.jsonl/77833 | {
"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,
4612,
62278,
368,
341,
286,
61570,
4452,
486,
2207,
28838,
2099,
5981,
20873,
929,
486,
97564,
11,
44590,
3323,
486,
52,
23,
7,
16,
41958,
286,
61570,
4452,
486,
2207,
28838,
2099,
5981,
20873,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_schnorr_vectors() {
fn verify_only(test: &TestVector) {
let pubkey = match PublicKey::from_compressed(&test.pk) {
Ok(k) => k,
Err(_) => {
assert_eq!(test.verify_result, false);
return;
}
... | rust_cleaned_test_functions.jsonl/36205 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 889
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
643,
2125,
17391,
49158,
368,
341,
286,
5168,
10146,
18410,
8623,
25,
609,
2271,
3781,
8,
341,
310,
1077,
95116,
284,
2432,
70280,
486,
1499,
2965,
14318,
2099,
1944,
38628,
8,
341,
394,
7622,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_endline() {
let mut res = scan("hi 15.7\r\n", "{} {}");
assert_eq!(res.next().unwrap(), "hi");
assert_eq!(res.next().unwrap(), "15.7");
} | rust_cleaned_test_functions.jsonl/50243 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 83
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6213,
1056,
368,
341,
262,
1077,
5206,
592,
284,
8569,
445,
6023,
220,
16,
20,
13,
22,
12016,
1699,
497,
35503,
4687,
797,
262,
2060,
10714,
10297,
416,
4529,
1005,
15454,
1507,
330,
6023,
797,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_evaluate() {
let x = hex2binary("C200B40A82").unwrap();
let (_, p) = parse_packet(&x).unwrap();
assert_eq!(evaluate_packet(&p), 3);
let x = hex2binary("04005AC33890").unwrap();
let (_, p) = parse_packet(&x).unwrap();
assert_eq!(evaluate_packet(&p)... | rust_cleaned_test_functions.jsonl/6778 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 606
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2204,
19642,
368,
341,
286,
1077,
856,
284,
12371,
17,
25891,
445,
34,
17,
15,
15,
33,
19,
15,
32,
23,
17,
1827,
15454,
543,
286,
1077,
39464,
281,
8,
284,
4715,
21078,
2099,
87,
568,
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_encode_hashmap_with_numeric_key() {
use std::str::from_utf8;
use std::io::Writer;
use std::collections::HashMap;
let mut hm: HashMap<uint, bool> = HashMap::new();
hm.insert(1, true);
let mut mem_buf = Vec::new();
{
let mut encod... | rust_cleaned_test_functions.jsonl/6582 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 330
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11224,
8950,
2186,
6615,
29418,
3097,
368,
341,
286,
990,
1460,
486,
495,
486,
1499,
39453,
23,
280,
286,
990,
1460,
486,
815,
486,
6492,
280,
286,
990,
1460,
486,
51137,
486,
18497,
280,
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_parse() {
let username = "nagle";
let password = "1984";
let address = "127.0.0.1:9090";
let (user, pass, addr) =
parse_user_pass_and_addr(&format!("{}:{}@{}", username, password, address)).unwrap();
assert_eq!(user, username);
assert_... | rust_cleaned_test_functions.jsonl/52028 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 267
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
368,
341,
286,
1077,
5934,
284,
330,
77,
32674,
876,
286,
1077,
3552,
284,
330,
16,
24,
23,
19,
876,
286,
1077,
2621,
284,
330,
16,
17,
22,
13,
15,
13,
15,
13,
16,
25,
24,
15,
24,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_call_broadcast_without_args() {
let output = Command::new("./target/release/tio")
.arg("broadcast")
.output()
.expect("failed to broadcast message");
assert!(String::from_utf8_lossy(&output.stdout).contains(BASE_BROADCAST_OUTPUT))
} | rust_cleaned_test_functions.jsonl/41466 | {
"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,
13429,
74923,
39904,
8384,
368,
341,
286,
1077,
2550,
284,
7348,
486,
931,
13988,
5657,
88648,
5523,
815,
1138,
310,
659,
858,
445,
54162,
1138,
310,
659,
3006,
741,
310,
659,
17119,
445,
16091,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_secp256k1_public_key() {
// Create a secp256k1 identity from a PEM file.
let identity = Secp256k1Identity::from_pem(IDENTITY_FILE.as_bytes())
.expect("Cannot create secp256k1 identity from PEM file.");
// Assert the DER-encoded secp256k1 public key matches wh... | rust_cleaned_test_functions.jsonl/81518 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 186
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3453,
4672,
17,
20,
21,
74,
16,
27074,
3097,
368,
341,
286,
442,
4230,
264,
511,
4672,
17,
20,
21,
74,
16,
9569,
504,
264,
96734,
1034,
624,
286,
1077,
9569,
284,
4520,
79,
17,
20,
21,
74,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_basics() {
let mut testdata = get_path();
testdata.push("alltypes_plain.parquet");
let mut file = File::open(testdata).unwrap();
let metadata = read_metadata(&mut file).unwrap();
let columns = metadata.schema_descr.columns();
/*
from pya... | rust_cleaned_test_functions.jsonl/87587 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1027
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
67981,
368,
341,
286,
1077,
5206,
1273,
691,
284,
633,
2638,
543,
286,
1273,
691,
2552,
445,
541,
9242,
41015,
33277,
23300,
797,
286,
1077,
5206,
1034,
284,
2887,
486,
2508,
8623,
691,
568... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_struct_with_borrowed_fields() {
use std::borrow::Cow;
#[derive(Tsify)]
struct Borrow<'a> {
raw: &'a str,
cow: Cow<'a, str>,
}
assert_eq!(
Borrow::DECL,
indoc! {"
export interface Borrow {
raw: string;
... | rust_cleaned_test_functions.jsonl/121074 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 220
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15126,
6615,
880,
7768,
291,
12132,
368,
341,
262,
990,
1460,
486,
71141,
486,
89915,
401,
262,
11506,
27098,
4140,
82,
1437,
5563,
262,
2036,
77947,
18291,
64,
29,
341,
286,
7112,
25,
30136,
64... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_large_body_without_content_length() {
let body = "123".repeat(2048);
let _mock = mock("POST", "/").match_body(body.as_str()).create();
let stream = request_stream("1.0", "POST /", "", &body);
stream.shutdown(Shutdown::Write).unwrap();
let (status_line, _, _) = parse_stream... | rust_cleaned_test_functions.jsonl/82446 | {
"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,
45228,
14114,
39904,
7495,
5118,
368,
341,
262,
1077,
2487,
284,
330,
16,
17,
18,
3263,
30624,
7,
17,
15,
19,
23,
626,
262,
1077,
716,
16712,
284,
7860,
445,
2946,
497,
3521,
1827,
6347,
14114... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_format() {
let caller = Address::from_hex("0x755cdba6ae4f479f7164792b318b2a06c759833b").unwrap();
let mut service = TestService::new();
let ctx = mock_context(caller);
// test create_asset
let create_asset_resp = service.create_asset(ctx.clone(), CreateAssetPayload {... | rust_cleaned_test_functions.jsonl/32951 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2108
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
8955,
368,
341,
262,
1077,
19865,
284,
9177,
486,
1499,
32655,
445,
15,
87,
22,
20,
20,
85301,
64,
21,
5918,
19,
69,
19,
22,
24,
69,
22,
16,
21,
19,
22,
24,
17,
65,
18,
16,
23,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_output_broken_pipe() {
let cmdstr = format!(
"cat \"{}\" | \"{}\" -h 10 | head -n 2",
"fixtures/sherlock.txt", TARGET_EXE_PATH
);
let oup = exec_target("sh", &["-c", &cmdstr]);
assert_eq!(oup.stderr, "");
assert_eq!(
oup... | rust_cleaned_test_functions.jsonl/67527 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 309
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7645,
880,
81709,
41862,
368,
341,
286,
1077,
5439,
495,
284,
3561,
33673,
310,
330,
4616,
7245,
6257,
2105,
760,
7245,
6257,
2105,
481,
71,
220,
16,
15,
760,
1968,
481,
77,
220,
17,
756,
310,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_check_leader() {
let sandbox = timestamping_sandbox();
let sandbox_state = SandboxState::new();
// option: with transaction
let tx = gen_timestamping_tx();
sandbox.recv(&tx);
// TODO would be nice to check also for RequestPeers message which will appear
let n_r... | rust_cleaned_test_functions.jsonl/8869 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 294
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
79991,
368,
341,
262,
1077,
42754,
284,
11441,
287,
643,
31536,
543,
262,
1077,
42754,
4387,
284,
96860,
1397,
486,
931,
1428,
262,
442,
2999,
25,
448,
7745,
198,
262,
1077,
9854,
284,
408... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_sanitize() {
assert_eq!(sanitize("type", Case::Snake), "type_");
assert_eq!(sanitize("ref", Case::Snake), "ref_");
assert_eq!(sanitize("+1", Case::Snake), "plus_1");
assert_eq!(sanitize("-1", Case::Snake), "_1");
assert_eq!(sanitize("@timestamp", Case::Pas... | rust_cleaned_test_functions.jsonl/53304 | {
"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,
643,
58652,
368,
341,
286,
2060,
10714,
10297,
65704,
445,
1313,
497,
11538,
486,
83420,
701,
330,
1313,
62,
797,
286,
2060,
10714,
10297,
65704,
445,
1097,
497,
11538,
486,
83420,
701,
330,
1097,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_escape_unicode() {
assert_eq!("abc".escape_unicode().to_string(), "\\u{61}\\u{62}\\u{63}");
assert_eq!("a c".escape_unicode().to_string(), "\\u{61}\\u{20}\\u{63}");
assert_eq!("\r\n\t".escape_unicode().to_string(), "\\u{d}\\u{a}\\u{9}");
assert_eq!("'\"\\".escape_unicode().to_str... | rust_cleaned_test_functions.jsonl/119408 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 404
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21832,
54662,
368,
341,
262,
2060,
10714,
17223,
13683,
3263,
12998,
54662,
1005,
983,
3904,
1507,
26468,
84,
90,
21,
16,
85539,
84,
90,
21,
17,
85539,
84,
90,
21,
18,
20305,
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... | 1 |
#[test]
fn test_deref() {
let mut stats = PerfStatisticsDelta(PerfStatisticsFields {
internal_key_skipped_count: 1,
internal_delete_skipped_count: 2,
block_cache_hit_count: 3,
block_read_count: 4,
block_read_byte: 5,
..Default::defa... | rust_cleaned_test_functions.jsonl/76516 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 257
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
814,
43970,
368,
341,
286,
1077,
5206,
10472,
284,
71448,
38599,
20277,
7,
3889,
69,
38599,
8941,
341,
310,
5306,
3097,
33811,
6450,
3180,
25,
220,
16,
345,
310,
5306,
11353,
33811,
6450,
3180,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sign_encode_id_changed() {
let mut message = Message::new();
message.set_id(123).add_answer(Record::new());
let key_name = Name::from_ascii("some.name").unwrap();
let pre_tsig = TSIG::new(
TsigAlgorithm::HmacSha256,
12345,
60,... | rust_cleaned_test_functions.jsonl/60099 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 668
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11172,
11224,
842,
25213,
368,
341,
286,
1077,
5206,
1943,
284,
4856,
486,
931,
543,
286,
1943,
980,
842,
7,
16,
17,
18,
568,
718,
28534,
7,
6471,
486,
931,
5231,
286,
1077,
1376,
1269,
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_cleanup() {
let mut man: Manager<TestResources> = Manager::new();
let _ = man.make_frame_buffer(());
let mut count = 0u8;
man.clean_with(&mut count,
|_,_| (),
|_,_| (),
|_,_| (),
|_,_| (),
|b,_| { *b += 1; },
|_,_| (),
|_,_|... | rust_cleaned_test_functions.jsonl/83366 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 233
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
42444,
368,
341,
262,
1077,
5206,
883,
25,
10567,
71273,
11277,
29,
284,
10567,
486,
931,
543,
262,
1077,
716,
284,
883,
10117,
8929,
7776,
7,
1423,
262,
1077,
5206,
1760,
284,
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... | 1 |
#[test]
fn test_op_read() {
assert_eq!(ior!(b'z', 10, 1), 0x80017A0A);
assert_eq!(ior!(b'z', 10, 512), 0x82007A0A);
} | rust_cleaned_test_functions.jsonl/85182 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 88
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10287,
6443,
368,
341,
286,
2060,
10714,
10297,
2462,
10297,
65,
6,
89,
516,
220,
16,
15,
11,
220,
16,
701,
220,
15,
87,
23,
15,
15,
16,
22,
32,
15,
32,
317,
286,
2060,
10714,
10297,
2462,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_progress_paused() {
setup_for_test();
let mut raft = new_test_raft(1, vec![1, 2], 5, 1, new_storage());
raft.become_candidate();
raft.become_leader();
let mut m = Message::new();
m.set_from(1);
m.set_to(1);
m.set_msg_type(MessageType::MsgPropose);
let mut e = ... | rust_cleaned_test_functions.jsonl/107091 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 279
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27200,
55475,
2591,
368,
341,
262,
6505,
5478,
4452,
543,
262,
1077,
5206,
52455,
284,
501,
4452,
62,
2944,
7,
16,
11,
7486,
20703,
16,
11,
220,
17,
1125,
220,
20,
11,
220,
16,
11,
501,
2331... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_complete_install() {
let inspector = finspect::Inspector::new();
let mut dynamic_index = DynamicIndex::new(inspector.root().create_child("index"));
let hash = Hash::from([2; 32]);
let path = PackagePath::from_name_and_variant(
"fake-package".parse().u... | rust_cleaned_test_functions.jsonl/74634 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 657
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27675,
34245,
368,
341,
286,
1077,
44725,
284,
64979,
987,
486,
46230,
486,
931,
543,
286,
1077,
5206,
8741,
3560,
284,
21886,
1552,
486,
931,
56337,
18997,
12576,
1005,
3182,
17268,
445,
1252,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_malicious_ca() {
simple_logging::log_to_stderr(LevelFilter::Debug);
let (server_started_signal_tx, server_started_signal_rx) = mpsc::channel::<()>();
let addr = "127.0.0.1:8444";
let server_key = PathBuf::from(format!(
"{}/../test_pki/resources/openssl... | rust_cleaned_test_functions.jsonl/103498 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1773
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
717,
278,
9627,
49604,
368,
341,
286,
4285,
59982,
486,
839,
2346,
93033,
30263,
5632,
486,
7939,
317,
286,
1077,
320,
4030,
55679,
21137,
17805,
11,
3538,
55679,
21137,
24330,
8,
284,
296,
81984,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 5 |
#[test]
fn test_derivative1() {
let mut candles = RandomCandles::default();
let mut ma = TestingMethod::new(1, candles.first().close).unwrap();
let mut prev = None;
candles.take(100).map(|x| x.close).for_each(|x| {
assert_eq_float(x - prev.unwrap_or(x), ma.next(x));
prev = Some(x);
});
} | rust_cleaned_test_functions.jsonl/108500 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 136
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
95930,
16,
368,
341,
197,
10217,
5206,
51205,
284,
10612,
34,
20125,
486,
2258,
1428,
197,
10217,
5206,
7491,
284,
26768,
3523,
486,
931,
7,
16,
11,
51205,
7389,
1005,
5552,
568,
15454,
543,
197... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_upload_zero_size() {
let s3client = crate::get_s3client();
let filename = "test0b.bin";
let filepath = format!("tests/data/{}", filename);
let s3_key = format!("test_upload_zero_size/{}", filename);
let res = blocking::upload(s3client.as_ref(), crate::TEST_BUCKET, &s3_key, &... | rust_cleaned_test_functions.jsonl/84177 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 151
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21691,
19359,
2368,
368,
341,
262,
1077,
274,
18,
2972,
284,
17717,
486,
455,
643,
18,
2972,
543,
262,
1077,
3899,
284,
330,
1944,
15,
65,
29394,
876,
262,
1077,
26054,
284,
3561,
17223,
23841,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_after_clone_override_from_project() {
let config = a_config();
let logger = a_logger();
let resolved = config.resolve_after_clone(&logger, config.projects.get("test3").unwrap());
assert_that(&resolved).is_equal_to(vec!["clone1".to_string(), "clone override in project".to_owned()]... | rust_cleaned_test_functions.jsonl/52630 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 121
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
19844,
54742,
48576,
5673,
16352,
368,
341,
262,
1077,
2193,
284,
264,
5332,
543,
262,
1077,
5925,
284,
264,
27413,
543,
262,
1077,
19673,
284,
2193,
14691,
19844,
54742,
2099,
9786,
11,
2193,
593... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_auto_async() {
block_on(async {
let srv = TestServer::start(|| HttpService::new(App::new().service(auto_async)));
let request = srv.request(http::Method::GET, srv.url("/test"));
let response = request.send().await.unwrap();
assert!(response.status().is_succes... | rust_cleaned_test_functions.jsonl/129742 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 145
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27740,
28346,
368,
341,
262,
2504,
4470,
18285,
341,
286,
1077,
43578,
284,
3393,
5475,
486,
2468,
79453,
4823,
1860,
486,
931,
23231,
486,
931,
1005,
7936,
21680,
28346,
22525,
286,
1077,
1681,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_circle_2d() {
let result = circle_2d(10.0, 10);
let truth = vec![
(10.0, 0.0),
(8.097, 5.878),
(3.090, 9.511),
(-3.090, 9.511),
(-8.097, 5.878),
(-10.0, 0.0),
(-8.097, -5.878),
(-3.09... | rust_cleaned_test_functions.jsonl/129682 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 310
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
42222,
62,
17,
67,
368,
1476,
286,
1077,
1102,
284,
12671,
62,
17,
67,
7,
16,
15,
13,
15,
11,
220,
16,
15,
317,
286,
1077,
8046,
284,
7486,
90515,
310,
320,
16,
15,
13,
15,
11,
220,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_intrdoduce_var_expr_stmt() {
check_action_range(
"
fn foo() {
<|>1 + 1<|>;
}", "
fn foo() {
let <|>var_name = 1 + 1;
}",
|file, range| introduce_variable(file, range).map(|f| f()),
);
} | rust_cleaned_test_functions.jsonl/100438 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 141
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
59888,
67,
347,
10521,
4612,
21915,
21824,
368,
341,
2028,
7931,
9698,
1006,
310,
6228,
8822,
15229,
368,
341,
262,
82639,
29,
16,
488,
220,
16,
27,
91,
10133,
9545,
6228,
8822,
15229,
368,
341,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_binomial() {
let mut rng = ::test::rng(351);
test_binomial_mean_and_variance(150, 0.1, &mut rng);
test_binomial_mean_and_variance(70, 0.6, &mut rng);
test_binomial_mean_and_variance(40, 0.5, &mut rng);
test_binomial_mean_and_variance(20, 0.7, &mut rng);
... | rust_cleaned_test_functions.jsonl/32035 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 199
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21816,
20855,
368,
341,
286,
1077,
5206,
28422,
284,
3504,
1944,
486,
69890,
7,
18,
20,
16,
317,
286,
1273,
21816,
20855,
16933,
8378,
77450,
7,
16,
20,
15,
11,
220,
15,
13,
16,
11,
609,
698... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_names() {
let tmp = TempDir::new("weave").unwrap();
let path = tmp.path().to_str().unwrap();
let nm = SimpleNaming::new(tmp.path(), "sample", "weave", true);
assert_eq!(
nm.main_file(),
Path::new(&format!("{}/sample.weave.gz", path))
);
assert_eq!(
... | rust_cleaned_test_functions.jsonl/132892 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 292
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9187,
368,
341,
262,
1077,
4174,
284,
19944,
6184,
486,
931,
445,
896,
523,
1827,
15454,
1428,
262,
1077,
1815,
284,
4174,
3875,
1005,
983,
2895,
1005,
15454,
1428,
262,
1077,
25723,
284,
8993,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_extend_from() {
let mut a = PackedStringArray::<i32>::new();
a.append("hello");
a.append("world");
a.append("cupcake");
a.append("");
let mut b = PackedStringArray::<i32>::new();
b.append("foo");
b.append("bar");
a.exten... | rust_cleaned_test_functions.jsonl/52659 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 267
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
70265,
5673,
368,
341,
286,
1077,
5206,
264,
284,
393,
11191,
703,
1857,
27638,
72,
18,
17,
6831,
931,
1428,
286,
264,
2057,
445,
14990,
797,
286,
264,
2057,
445,
14615,
797,
286,
264,
2057,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_cvtsi2sd() {
assert_emit!(0xf2, 0x0f, 0x2a, 0xc1; cvtsi2sd(XMM0, 0, RCX));
assert_emit!(0xf2, 0x41, 0x0f, 0x2a, 0xdf; cvtsi2sd(XMM3, 0, R15));
assert_emit!(0xf2, 0x44, 0x0f, 0x2a, 0xc4; cvtsi2sd(XMM8, 0, RSP));
assert_emit!(0xf2, 0x48, 0x0f, 0x2a, 0xc1; cvtsi2sd(... | rust_cleaned_test_functions.jsonl/85499 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 335
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
43233,
2576,
72,
17,
13446,
368,
341,
286,
2060,
69082,
10297,
15,
5848,
17,
11,
220,
15,
87,
15,
69,
11,
220,
15,
87,
17,
64,
11,
220,
15,
8148,
16,
26,
5544,
2576,
72,
17,
13446,
7644,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_parse_dotty_version() {
let dotty_version = "Scala compiler version 3.0.0-RC1 -- Copyright 2002-2021, LAMP/EPFL";
assert_eq!(
parse_scala_version(dotty_version),
Some("3.0.0-RC1".to_string())
);
} | rust_cleaned_test_functions.jsonl/23149 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 140
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
814,
57639,
9438,
368,
341,
286,
1077,
294,
57639,
9438,
284,
330,
93231,
19415,
2319,
220,
18,
13,
15,
13,
15,
12,
7380,
16,
1177,
2955,
220,
17,
15,
15,
17,
12,
17,
15,
17,
16,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_update_key() {
KeysManagerTest::new(ALICE)
.set_key_weight(BOB, Weight::new(1))
.assert_success_status_and_commit()
.set_key_weight(BOB, Weight::new(2))
.assert_success_status_and_commit()
.assert_keys(vec![(ALICE, Weight::new(1)), (BOB, Weight::new(2)... | rust_cleaned_test_functions.jsonl/96210 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 157
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8882,
3097,
368,
341,
262,
24133,
2043,
2271,
486,
931,
46232,
5487,
340,
286,
659,
746,
3097,
15876,
7,
4677,
33,
11,
16516,
486,
931,
7,
16,
1171,
286,
659,
2207,
18632,
4773,
8378,
36346,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_get_node() {
let querier = new_valid_db("get_node.db");
let got_node = querier.get_node(100);
assert_eq!(common_node(), got_node);
} | rust_cleaned_test_functions.jsonl/107720 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 91
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
5084,
368,
341,
286,
1077,
29134,
1268,
284,
501,
8337,
8685,
445,
455,
5084,
7076,
3071,
286,
1077,
2684,
5084,
284,
29134,
1268,
670,
5084,
7,
16,
15,
15,
317,
286,
2060,
10714,
10297,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_insert() {
let db = Connection::open_in_memory().unwrap();
db.execute_batch("CREATE TABLE foo(x INTEGER UNIQUE)")
.unwrap();
let mut stmt = db
.prepare("INSERT OR IGNORE INTO foo (x) VALUES (?)")
.unwrap();
assert_eq!(stmt.inser... | rust_cleaned_test_functions.jsonl/57179 | {
"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,
17678,
368,
341,
286,
1077,
2927,
284,
11032,
486,
2508,
1243,
19195,
1005,
15454,
543,
286,
2927,
7769,
14534,
445,
22599,
14363,
15229,
2075,
30381,
72350,
19107,
310,
659,
15454,
543,
286,
1077,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_runtime_create_invalid_handle() {
let lib_path = CString::new("some/path").expect("Invalid library path");
let handle = unsafe {
mun_runtime_create(
lib_path.into_raw(),
RuntimeOptions::default(),
ptr::null_mut(),
)
};
assert_n... | rust_cleaned_test_functions.jsonl/120551 | {
"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,
33232,
8657,
31433,
10630,
368,
341,
262,
1077,
3051,
2638,
284,
56956,
486,
931,
445,
14689,
50976,
1827,
17119,
445,
7928,
6733,
1815,
3071,
262,
1077,
3705,
284,
19860,
341,
286,
49979,
33232,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_insert_imm() {
let mut opcode = OpcodeData {
name: "TestOp",
immediates: vec![],
inputs: Inputs::NOV,
outputs: Outputs::NOV,
flags: InstrFlags::NF,
};
let fixups = hashmap! {
"TestOp" => vec! {
... | rust_cleaned_test_functions.jsonl/54513 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 450
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17678,
71370,
368,
341,
286,
1077,
5206,
30028,
284,
78899,
1043,
341,
310,
829,
25,
330,
2271,
7125,
756,
310,
5551,
973,
25,
7486,
20703,
1259,
310,
11127,
25,
46281,
486,
8996,
53,
345,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_from_u512_zero() {
let modulus = modulus();
assert_eq!(
Scalar::zero(),
Scalar::from_u512([
modulus.0[0],
modulus.0[1],
modulus.0[2],
modulus.0[3],
0,
0,
0,
0
])
);... | rust_cleaned_test_functions.jsonl/108340 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 218
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5673,
7300,
20,
16,
17,
19359,
368,
341,
262,
1077,
74024,
284,
74024,
543,
262,
2060,
10714,
33673,
286,
35176,
486,
14154,
3148,
286,
35176,
486,
1499,
7300,
20,
16,
17,
8956,
310,
74024,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_increment_major() {
let mut chrome_release = Version::parse("46.1.246773").unwrap();
chrome_release.increment_major();
assert_eq!(chrome_release, Version::parse("47.0.0").unwrap());
} | rust_cleaned_test_functions.jsonl/43097 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 101
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
51482,
47916,
368,
341,
286,
1077,
5206,
26429,
24577,
284,
6079,
486,
6400,
445,
19,
21,
13,
16,
13,
17,
19,
21,
22,
22,
18,
1827,
15454,
543,
286,
26429,
24577,
56936,
47916,
543,
286,
2060,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_col_prune_cross_join() {
assert_j_plan("select t2.c0 from t2, t3", |sql, mut plan| {
let subq = get_lvl_queries(&plan, 1);
assert_eq!(2, subq.len());
assert_eq!(3, subq[0].out_cols().len());
assert_eq!(4, subq[1].out_cols().len());
... | rust_cleaned_test_functions.jsonl/27138 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 327
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10211,
5294,
2886,
35284,
31017,
368,
341,
286,
2060,
5374,
26564,
445,
1742,
259,
17,
520,
15,
504,
259,
17,
11,
259,
18,
497,
760,
3544,
11,
5206,
3119,
91,
341,
310,
1077,
1186,
80,
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_set_max_background_jobs() {
let path = tempdir_with_prefix("_rust_rocksdb_max_background_jobs");
let mut opts = DBOptions::new();
opts.create_if_missing(true);
opts.set_max_background_jobs(4);
DB::open(opts, path.path().to_str().unwrap()).unwrap();
} | rust_cleaned_test_functions.jsonl/34114 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 125
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
6345,
24103,
37247,
368,
341,
262,
1077,
1815,
284,
2730,
3741,
6615,
13974,
16975,
35788,
26608,
14553,
1999,
6345,
24103,
37247,
797,
262,
1077,
5206,
12185,
284,
5952,
3798,
486,
931,
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_glyph_buffer_serialization_text() {
let path = "testfiles/SourceSansVariable-Roman.ttf";
let face = Face::from_file(path, 0).unwrap();
let font = Font::new(face);
let buffer = UnicodeBuffer::new().add_str("Hello 🌍");
let glyph_buffer = shape(&font, buffer... | rust_cleaned_test_functions.jsonl/63453 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 574
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
88703,
7776,
25602,
2022,
4326,
368,
341,
286,
1077,
1815,
284,
330,
1944,
7198,
14,
3608,
46882,
7827,
10911,
6908,
45192,
876,
286,
1077,
3579,
284,
18596,
486,
1499,
2458,
5581,
11,
220,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_language_specific_resources_multiple_languages() {
let data_dir = build_data_dir_with_resources(vec![
(PathBuf::from("polish/test.txt"), Vec::from("test")),
(PathBuf::from("polish/test2.txt"), Vec::from("test")),
(PathBuf::from("german/test3.txt"), Vec... | rust_cleaned_test_functions.jsonl/118443 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 319
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
29021,
56592,
35569,
45233,
77576,
368,
341,
286,
1077,
821,
4334,
284,
1936,
1769,
4334,
6615,
35569,
25592,
90515,
310,
320,
1820,
15064,
486,
1499,
445,
9896,
812,
12697,
3909,
3975,
11312,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_temperature_converter_from_c_to_kelvin() {
let conv = TemperatureConverter::new(-273.15, TemperatureUnit::Celsius);
let res = conv.convert(TemperatureUnit::Kelvin);
assert!(res.is_ok());
let res = res.unwrap();
assert!(is_close(0.0, res.scalar()));
... | rust_cleaned_test_functions.jsonl/76286 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 171
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53525,
74073,
5673,
666,
2346,
59222,
9603,
368,
341,
286,
1077,
5686,
284,
37022,
14920,
486,
931,
4080,
17,
22,
18,
13,
16,
20,
11,
37022,
4562,
486,
34,
40247,
317,
286,
1077,
592,
284,
568... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_leading_whitespace_in_free_argument_should_imply_padding() {
new_ucmd!()
.args(&["--from=auto", " 1Ki"])
.run()
.stdout_is(" 1024\n");
} | rust_cleaned_test_functions.jsonl/46011 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 101
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11751,
2228,
86175,
1243,
8905,
9025,
43378,
17895,
2541,
40726,
368,
341,
262,
501,
68887,
2277,
0,
741,
286,
659,
2116,
2099,
1183,
313,
1499,
28,
3902,
497,
330,
256,
220,
16,
72572,
14108,
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 |
#[test]
fn test_mul_overflow() {
fn test_mul_typed_overflow<T>()
where
T: Integer + Bounded + Clone + Debug + NumAssign + CheckedMul,
{
let two = T::one() + T::one();
let _3 = T::one() + T::one() + T::one();
... | rust_cleaned_test_functions.jsonl/853 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1415
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24944,
79073,
368,
341,
310,
5168,
1273,
24944,
528,
32501,
79073,
3125,
18949,
310,
1380,
198,
394,
350,
25,
4440,
488,
425,
13082,
488,
27913,
488,
11091,
488,
16212,
28933,
488,
93361,
59155,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_shrink_to_fit() {
let mut xs = vec![0, 1, 2, 3];
for i in range(4, 100) {
xs.push(i)
}
assert_eq!(xs.capacity(), 128);
xs.shrink_to_fit();
assert_eq!(xs.capacity(), 100);
assert_eq!(xs, range(0, 100).collect::<Vec<_>>());
} | rust_cleaned_test_functions.jsonl/75634 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 183
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3712,
34365,
2346,
32416,
368,
341,
286,
1077,
5206,
11943,
284,
7486,
20703,
15,
11,
220,
16,
11,
220,
17,
11,
220,
18,
935,
286,
369,
600,
304,
2088,
7,
19,
11,
220,
16,
15,
15,
8,
341,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_resolve() {
// TODO: these module ids should be normalized into a URL:
let cases = [
(
"./tests/hello.ts",
".",
"././tests/hello.ts",
"<cwd>/tests/hello.ts",
),
(
"./hello.ts",
"./tests/main.ts",
"./tests/./he... | rust_cleaned_test_functions.jsonl/4197 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 757
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
77291,
368,
341,
262,
442,
5343,
25,
1493,
4688,
14151,
1265,
387,
29410,
1119,
264,
5548,
510,
1066,
262,
1077,
5048,
284,
2278,
414,
2399,
286,
5924,
23841,
7530,
4791,
21288,
756,
286,
5933,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_doc_store() {
let mut writer = DocWriter::new(0);
let mut sink = vec![];
let doc1 = r#"{"test":"ok"}"#;
let doc2 = r#"{"test2":"ok"}"#;
let doc3 = r#"{"test3":"ok"}"#;
writer.add_doc(doc1, &mut sink).unwrap();
writer.add_doc(doc2, &mut sink).unwrap();
writer.add_... | rust_cleaned_test_functions.jsonl/114200 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 358
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18869,
14809,
368,
341,
262,
1077,
5206,
6916,
284,
21709,
6492,
486,
931,
7,
15,
626,
262,
1077,
5206,
19309,
284,
7486,
0,
15078,
262,
1077,
4629,
16,
284,
435,
55543,
4913,
1944,
3252,
562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_try_from() {
let _ = ByteString::try_from(&b"nice bytes"[..]).unwrap();
let _ = ByteString::try_from(b"nice bytes".to_vec()).unwrap();
let _ = ByteString::try_from(Bytes::from_static(b"nice bytes")).unwrap();
let _ = ByteString::try_from(BytesMut::from(&b"nice byt... | rust_cleaned_test_functions.jsonl/65287 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 201
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53283,
5673,
368,
341,
286,
1077,
716,
284,
95302,
486,
1539,
5673,
2099,
65,
1,
52796,
5820,
36864,
496,
10697,
15454,
543,
286,
1077,
716,
284,
95302,
486,
1539,
5673,
1883,
1,
52796,
5820,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_identifier() {
assert_eq!(ParseProgress::none(""), identifier(""));
assert_eq!(ParseProgress::none("10"), identifier("10"));
assert_eq!(ParseProgress::some("", "a"), identifier("a"));
assert_eq!(ParseProgress::some("", "ab"), identifier("ab"));
assert_eq!(... | rust_cleaned_test_functions.jsonl/26569 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 244
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
33176,
368,
341,
286,
2060,
10714,
10297,
14463,
9496,
486,
6697,
86076,
12816,
89744,
286,
2060,
10714,
10297,
14463,
9496,
486,
6697,
445,
16,
15,
3975,
12816,
445,
16,
15,
4010,
286,
2060,
1071... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_connection() {
let mut socket = EngineSocket::new(true);
assert!(socket
.on_open(|_| {
println!("Open event!");
})
.is_ok());
assert!(socket
.on_close(|_| {
println!("Close event!");
... | rust_cleaned_test_functions.jsonl/109227 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 919
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34729,
15866,
368,
341,
286,
1077,
5206,
7575,
284,
8200,
10286,
486,
931,
3715,
626,
286,
2060,
10297,
9556,
198,
310,
659,
263,
11311,
22428,
35395,
341,
394,
13751,
17223,
5002,
1538,
11142,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.