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_bytes() {
test_byte(b"\x40", &[], false);
test_byte(b"\x44\x01\x02\x03\x04", &[1u8, 2, 3, 4], false);
} | rust_cleaned_test_functions.jsonl/62589 | {
"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,
12524,
368,
341,
262,
1273,
19737,
1883,
11934,
87,
19,
15,
497,
609,
12995,
895,
317,
262,
1273,
19737,
1883,
11934,
87,
19,
19,
3462,
15,
16,
3462,
15,
17,
3462,
15,
18,
3462,
15,
19,
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 |
#[test]
fn test_naive_time() {
let db = checked_memory_handle();
let time = NaiveTime::from_hms(23, 56, 4);
db.execute("INSERT INTO foo (t) VALUES (?)", &[&time])
.unwrap();
let s: String = db
.query_row("SELECT t FROM foo", NO_PARAMS, |r| r.get(0))
.unwrap();
assert_eq!("23:56:04", s);
let v: NaiveTime = db
.query_row("SELECT t FROM foo", NO_PARAMS, |r| r.get(0))
.unwrap();
assert_eq!(time, v);
} | rust_cleaned_test_functions.jsonl/15050 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 285
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
58631,
533,
3009,
368,
341,
286,
1077,
2927,
284,
10067,
19195,
10630,
543,
286,
1077,
882,
284,
12812,
533,
1462,
486,
1499,
1523,
1011,
7,
17,
18,
11,
220,
20,
21,
11,
220,
19,
317,
286,
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_parse_params() {
let mut params: HashMap<&str, &str> = HashMap::new();
params.insert("cvid", "00000");
params.insert("page", "2");
let converted = parse_params(params).unwrap();
match converted.as_str() {
"page=2&cvid=00000" => (),
"cvid=00000&page=2" => (),
_ => {
panic!("Params did not convert properly");
}
}
} | rust_cleaned_test_functions.jsonl/102565 | {
"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,
21039,
6745,
368,
341,
286,
1077,
5206,
3628,
25,
10528,
52244,
495,
11,
609,
495,
29,
284,
10528,
486,
931,
543,
286,
3628,
7030,
445,
66,
1301,
497,
330,
15,
15,
15,
15,
15,
797,
286,
3628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_replace_cwd() {
let mut program = program_def(
"dir-%{JOB_ID}-%{TASK_ID}",
Some("%{CWD}.out"),
Some("%{CWD}.err"),
"",
5,
1,
);
replace_placeholders_worker(&mut program);
assert_eq!(program.cwd, Some("dir-5-1".into()));
assert_eq!(program.stdout, StdioDef::File("dir-5-1.out".into()));
assert_eq!(program.stderr, StdioDef::File("dir-5-1.err".into()));
} | rust_cleaned_test_functions.jsonl/107298 | {
"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,
10633,
666,
6377,
368,
341,
286,
1077,
5206,
2025,
284,
2025,
7844,
1006,
310,
330,
3741,
11069,
90,
74879,
3450,
92,
11069,
90,
65813,
3450,
24375,
310,
4329,
4430,
90,
34,
17563,
7810,
411,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_simple_non_trait_cycles() {
// cycles without using trait objects.
type C = Cc<RefCell<Option<Box<T>>>>;
#[derive(Default, Clone)]
struct T(C);
use crate::Tracer;
impl Trace for T {
fn trace(&self, t: &mut Tracer) {
self.0.trace(t);
}
fn is_type_tracked() -> bool {
true
}
}
{
let t1: T = Default::default();
debug::NEXT_DEBUG_NAME.with(|n| n.set(1));
let t2: T = T(Cc::new(RefCell::new(Some(Box::new(t1.clone())))));
(*t1.0.borrow_mut()) = Some(Box::new(t2.clone()));
// The collector runs if RefCell is borrowed.
let _borrowed = t1.0.borrow_mut();
assert_eq!(collect::collect_thread_cycles(), 0);
}
assert_eq!(collect::collect_thread_cycles(), 2);
} | rust_cleaned_test_functions.jsonl/76047 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 405
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
30015,
21637,
78491,
68970,
368,
341,
262,
442,
24484,
2041,
1667,
17567,
6171,
624,
262,
943,
356,
284,
356,
66,
27,
3945,
3599,
94150,
79852,
3125,
18153,
280,
262,
11506,
27098,
87874,
11,
2791... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_software_get_from() -> Result<()> {
let mut m = Message::new();
let v = "Client v0.0.1".to_owned();
m.add(ATTR_SOFTWARE, v.as_bytes());
m.write_header();
let mut m2 = Message {
raw: Vec::with_capacity(256),
..Default::default()
};
let mut reader = BufReader::new(m.raw.as_slice());
m2.read_from(&mut reader)?;
let software = TextAttribute::get_from_as(&m, ATTR_SOFTWARE)?;
assert_eq!(software.to_string(), v, "Expected {}, got {}.", v, software);
let (s_attr, ok) = m.attributes.get(ATTR_SOFTWARE);
assert!(ok, "sowfware attribute should be found");
let s = s_attr.to_string();
assert!(
s.starts_with("SOFTWARE:"),
"bad string representation {}",
s
);
Ok(())
} | rust_cleaned_test_functions.jsonl/57154 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 349
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39833,
2110,
3062,
5673,
368,
1464,
5714,
71698,
341,
262,
1077,
5206,
296,
284,
4856,
486,
931,
543,
262,
1077,
348,
284,
330,
2959,
348,
15,
13,
15,
13,
16,
3263,
983,
51973,
543,
262,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_inverse_times_matrix_is_identity() {
let matrix = Matrix2x2::new(36.84, 427.46, 7.47, 61.89);
let matrix_inv = matrix.inverse().unwrap();
let one = Matrix2x2::identity();
assert!(relative_eq!(matrix_inv * matrix, one, epsilon = 1e-7));
} | rust_cleaned_test_functions.jsonl/128979 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 149
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
63333,
22353,
10193,
6892,
46244,
368,
341,
286,
1077,
6172,
284,
11631,
17,
87,
17,
486,
931,
7,
18,
21,
13,
23,
19,
11,
220,
19,
17,
22,
13,
19,
21,
11,
220,
22,
13,
19,
22,
11,
220,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_config_api() {
let cases: [(KVS, bool, isize); 7] = [
(
// default value
KVS(vec![
KV {
key: API_REQUESTS_MAX.to_owned(),
value: "0".to_owned(),
},
KV {
key: API_REQUESTS_DEADLINE.to_owned(),
value: "10s".to_owned(),
},
KV {
key: API_CLUSTER_DEADLINE.to_owned(),
value: "10s".to_owned(),
},
KV {
key: API_CORS_ALLOW_ORIGIN.to_owned(),
value: "*".to_owned(),
},
KV {
key: API_REMOTE_TRANSPORT_DEADLINE.to_owned(),
value: "2h".to_owned(),
},
KV {
key: API_LIST_QUORUM.to_owned(),
value: "optimal".to_owned(),
},
KV {
key: API_EXTEND_LIST_CACHE_LIFE.to_owned(),
value: "0s".to_owned(),
},
KV {
key: API_REPLICATION_WORKERS.to_owned(),
value: "250".to_owned(),
},
KV {
key: API_REPLICATION_FAILED_WORKERS.to_owned(),
value: "8".to_owned(),
},
]),
false,
3,
),
(
// miss some key-value
KVS(vec![KV {
key: API_REQUESTS_MAX.to_owned(),
value: "11".to_owned(),
}]),
true,
0,
),
(
// duration format error
KVS(vec![
KV {
key: API_REQUESTS_MAX.to_owned(),
value: "0".to_owned(),
},
KV {
key: API_REQUESTS_DEADLINE.to_owned(),
value: "10".to_owned(),
},
KV {
key: API_CLUSTER_DEADLINE.to_owned(),
value: "10s".to_owned(),
},
KV {
key: API_CORS_ALLOW_ORIGIN.to_owned(),
value: "*".to_owned(),
},
KV {
key: API_REMOTE_TRANSPORT_DEADLINE.to_owned(),
value: "2h".to_owned(),
},
KV {
key: API_LIST_QUORUM.to_owned(),
value: "optimal".to_owned(),
},
KV {
key: API_EXTEND_LIST_CACHE_LIFE.to_owned(),
value: "0s".to_owned(),
},
KV {
key: API_REPLICATION_WORKERS.to_owned(),
value: "250".to_owned(),
},
KV {
key: API_REPLICATION_FAILED_WORKERS.to_owned(),
value: "8".to_owned(),
},
]),
true,
0,
),
(
// number format error
KVS(vec![
KV {
key: API_REQUESTS_MAX.to_owned(),
value: "fff".to_owned(),
},
KV {
key: API_REQUESTS_DEADLINE.to_owned(),
value: "10s".to_owned(),
},
KV {
key: API_CLUSTER_DEADLINE.to_owned(),
value: "10s".to_owned(),
},
KV {
key: API_CORS_ALLOW_ORIGIN.to_owned(),
value: "*".to_owned(),
},
KV {
key: API_REMOTE_TRANSPORT_DEADLINE.to_owned(),
value: "2h".to_owned(),
},
KV {
key: API_LIST_QUORUM.to_owned(),
value: "optimal".to_owned(),
},
KV {
key: API_EXTEND_LIST_CACHE_LIFE.to_owned(),
value: "0s".to_owned(),
},
KV {
key: API_REPLICATION_WORKERS.to_owned(),
value: "250".to_owned(),
},
KV {
key: API_REPLICATION_FAILED_WORKERS.to_owned(),
value: "8".to_owned(),
},
]),
true,
0,
),
// different vaild value
(
KVS(vec![
KV {
key: API_REQUESTS_MAX.to_owned(),
value: "3".to_owned(),
},
KV {
key: API_REQUESTS_DEADLINE.to_owned(),
value: "30s".to_owned(),
},
KV {
key: API_CLUSTER_DEADLINE.to_owned(),
value: "20s".to_owned(),
},
KV {
key: API_CORS_ALLOW_ORIGIN.to_owned(),
value: "hh,ff,".to_owned(),
},
KV {
key: API_REMOTE_TRANSPORT_DEADLINE.to_owned(),
value: "3h".to_owned(),
},
KV {
key: API_LIST_QUORUM.to_owned(),
value: "reduced".to_owned(),
},
KV {
key: API_EXTEND_LIST_CACHE_LIFE.to_owned(),
value: "1s".to_owned(),
},
KV {
key: API_REPLICATION_WORKERS.to_owned(),
value: "200".to_owned(),
},
KV {
key: API_REPLICATION_FAILED_WORKERS.to_owned(),
value: "300".to_owned(),
},
]),
false,
2,
),
(
KVS(vec![
KV {
key: API_REQUESTS_MAX.to_owned(),
value: "10".to_owned(),
},
KV {
key: API_REQUESTS_DEADLINE.to_owned(),
value: "1m".to_owned(),
},
KV {
key: API_CLUSTER_DEADLINE.to_owned(),
value: "100s".to_owned(),
},
KV {
key: API_CORS_ALLOW_ORIGIN.to_owned(),
value: "12,yy".to_owned(),
},
KV {
key: API_REMOTE_TRANSPORT_DEADLINE.to_owned(),
value: "1h".to_owned(),
},
KV {
key: API_LIST_QUORUM.to_owned(),
value: "disk".to_owned(),
},
KV {
key: API_EXTEND_LIST_CACHE_LIFE.to_owned(),
value: "5s".to_owned(),
},
KV {
key: API_REPLICATION_WORKERS.to_owned(),
value: "25".to_owned(),
},
KV {
key: API_REPLICATION_FAILED_WORKERS.to_owned(),
value: "10".to_owned(),
},
]),
false,
1,
),
(
KVS(vec![
KV {
key: API_REQUESTS_MAX.to_owned(),
value: "22".to_owned(),
},
KV {
key: API_REQUESTS_DEADLINE.to_owned(),
value: "1s".to_owned(),
},
KV {
key: API_CLUSTER_DEADLINE.to_owned(),
value: "10m".to_owned(),
},
KV {
key: API_CORS_ALLOW_ORIGIN.to_owned(),
value: "hello".to_owned(),
},
KV {
key: API_REMOTE_TRANSPORT_DEADLINE.to_owned(),
value: "9h".to_owned(),
},
KV {
key: API_LIST_QUORUM.to_owned(),
value: "strict".to_owned(),
},
KV {
key: API_EXTEND_LIST_CACHE_LIFE.to_owned(),
value: "10s".to_owned(),
},
KV {
key: API_REPLICATION_WORKERS.to_owned(),
value: "200".to_owned(),
},
KV {
key: API_REPLICATION_FAILED_WORKERS.to_owned(),
value: "200".to_owned(),
},
]),
false,
-1,
),
];
for (kvs, is_err, expected_quorum) in cases.iter() {
let cfg = lookup_config(kvs);
if *is_err {
assert_err!(cfg);
} else {
let cfg = assert_ok!(cfg);
assert_eq!(cfg.get_list_quorum(), *expected_quorum);
}
}
} | rust_cleaned_test_functions.jsonl/89580 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 7540
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5332,
11697,
368,
341,
286,
1077,
5048,
25,
17826,
42,
26050,
11,
1807,
11,
91373,
1215,
220,
22,
60,
284,
2278,
310,
2399,
394,
442,
1638,
897,
198,
394,
730,
26050,
25592,
90515,
503,
84648,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_merge_incompatible_column_types() {
let schema1 = SchemaBuilder::new().tag("the_tag").build().unwrap();
// same field name with different type
let schema2 = SchemaBuilder::new()
.influx_field("the_tag", Integer)
.build()
.unwrap();
let merged_schema_error = schema1.try_merge(schema2).unwrap_err();
assert_eq!(merged_schema_error.to_string(), "Schema Merge Error: Incompatible column type for 'the_tag'. Existing type Some(Field(Integer)), new type Some(Tag)");
} | rust_cleaned_test_functions.jsonl/44080 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 237
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20888,
1243,
34842,
8744,
9763,
368,
341,
286,
1077,
10802,
16,
284,
12539,
3297,
486,
931,
1005,
4578,
445,
1782,
9372,
1827,
5834,
1005,
15454,
1428,
286,
442,
1852,
2070,
829,
448,
2155,
943,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_inverse() {
let one = scalar_from_u64::<Bls12>(1);
let two = scalar_from_u64::<Bls12>(2);
let three = scalar_from_u64::<Bls12>(3);
let four = scalar_from_u64::<Bls12>(4);
let five = scalar_from_u64::<Bls12>(5);
let six = scalar_from_u64::<Bls12>(6);
let seven = scalar_from_u64::<Bls12>(7);
let eight = scalar_from_u64::<Bls12>(8);
let nine = scalar_from_u64::<Bls12>(9);
let m = vec![
vec![one, two, three],
vec![four, three, six],
vec![five, eight, seven],
];
let m1 = vec![
vec![one, two, three],
vec![four, five, six],
vec![seven, eight, nine],
];
assert!(!is_invertible::<Bls12>(&m1));
assert!(is_invertible::<Bls12>(&m));
let m_inv = invert::<Bls12>(&m).unwrap();
let computed_identity = mat_mul::<Bls12>(&m, &m_inv).unwrap();
assert!(is_identity::<Bls12>(&computed_identity));
// S
let some_vec = vec![six, five, four];
let inverse_applied = super::apply_matrix::<Bls12>(&m_inv, &some_vec);
let m_applied_after_inverse = super::apply_matrix::<Bls12>(&m, &inverse_applied);
assert_eq!(
some_vec, m_applied_after_inverse,
"M(M^-1(V))) = V did not hold"
);
// B
let base_vec = vec![eight, two, five];
let add_after_apply = vec_add::<Bls12>(&some_vec, &apply_matrix::<Bls12>(&m, &base_vec));
let apply_after_add =
apply_matrix::<Bls12>(&m, &vec_add::<Bls12>(&base_vec, &inverse_applied));
assert_eq!(add_after_apply, apply_after_add, "breakin' the law");
} | rust_cleaned_test_functions.jsonl/102230 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 994
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
63333,
368,
341,
286,
1077,
825,
284,
17274,
5673,
7300,
21,
19,
27638,
33,
4730,
16,
17,
2235,
16,
317,
286,
1077,
1378,
284,
17274,
5673,
7300,
21,
19,
27638,
33,
4730,
16,
17,
2235,
17,
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_no_remove_inherits2() {
test(
"var a = {}; this.b = {}; var goog = {}; goog.inherits(b, a) + 1",
"var a = {}; this.b = {}; var goog = {}; goog.inherits(b, a)",
);
} | rust_cleaned_test_functions.jsonl/455 | {
"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,
6536,
18193,
1243,
38693,
17,
368,
341,
262,
1273,
1006,
286,
330,
947,
264,
284,
52166,
419,
948,
284,
52166,
762,
47469,
284,
52166,
47469,
1858,
38693,
1883,
11,
264,
8,
488,
220,
16,
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... | 1 |
#[test]
fn test_inline_parameter_alias1() {
test(
"function f(x) { var y = x; g(); y;y; }",
"function f(x) { var y; g(); x;x; }",
);
} | rust_cleaned_test_functions.jsonl/27693 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 99
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
41871,
24899,
35947,
16,
368,
341,
262,
1273,
1006,
286,
330,
1688,
282,
2075,
8,
314,
256,
762,
379,
284,
856,
26,
256,
342,
2129,
256,
379,
70863,
26,
335,
756,
286,
330,
1688,
282,
2075,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_abbreviate_filters_can_still_cause_abbreviations() {
let mut out = ProcOutput::new();
let filters = &[std::iter::repeat('a').take(64).collect::<String>()];
let mut input = vec![b'.'; HEAD_LEN];
input.extend_from_slice(&vec![b'.'; TAIL_LEN]);
input.extend_from_slice(filters[0].as_bytes());
let mut expected = vec![b'.'; HEAD_LEN];
expected.extend_from_slice(b"\n\n<<<<<< SKIPPED 64 BYTES >>>>>>\n\n");
expected.extend_from_slice(&vec![b'.'; TAIL_LEN - 64]);
expected.extend_from_slice(&vec![b'a'; 64]);
out.extend(&input, filters);
// `out` is hundreds of KBs in size.
let out = out.into_bytes();
assert_eq!(expected.len(), out.len());
assert_eq!(expected, out);
} | rust_cleaned_test_functions.jsonl/34998 | {
"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,
62,
44272,
6493,
22481,
27421,
1261,
483,
666,
3454,
62,
44272,
17144,
368,
341,
262,
1077,
5206,
700,
284,
41087,
5097,
486,
931,
543,
262,
1077,
13406,
284,
44590,
1834,
486,
2015,
486,
30624,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_splitator_rev() {
let mut xs = [1, 2, 0, 3, 4, 0, 0, 5, 6, 0];
for slice in xs.split_mut(|x| *x == 0).rev().take(4) {
slice.reverse();
}
assert!(xs == [1, 2, 0, 4, 3, 0, 0, 6, 5, 0]);
} | rust_cleaned_test_functions.jsonl/12920 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 130
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
29523,
17052,
850,
38082,
368,
341,
262,
1077,
5206,
11943,
284,
508,
16,
11,
220,
17,
11,
220,
15,
11,
220,
18,
11,
220,
19,
11,
220,
15,
11,
220,
15,
11,
220,
20,
11,
220,
21,
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_example2() {
let expr = expr!(Atom::SubStr {
index: 0,
left: Position::Pos(RegExp::empty(), Token::numeric().into(), 1),
right: Position::CPos(-1)
});
run_expr_test(
&expr,
vec![
(vec!["BTR KRNL WK CORN 15Z"], "15Z"),
(vec!["CAMP DRY DBL NDL 3.6 OZ"], "3.6 OZ"),
(vec!["CHORE BOY HD SC SPNG 1 PK"], "1 PK"),
(vec!["FRENCH WORCESTERSHIRE 5 Z"], "5 Z"),
(vec!["O F TOMATO PASTE 6 OZ"], "6 OZ"),
],
);
} | rust_cleaned_test_functions.jsonl/14497 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 246
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39304,
17,
368,
341,
220,
1077,
15169,
284,
15169,
10297,
35836,
486,
3136,
2580,
341,
262,
1922,
25,
220,
15,
345,
262,
2115,
25,
12380,
486,
4859,
7,
50192,
486,
3194,
1507,
9660,
486,
19600,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_slice_rangetoinclusive_ok() {
let s = "abcαβγ";
assert_eq!(&s[..=2], "abc");
assert_eq!(&s[..=4], "abcα");
} | rust_cleaned_test_functions.jsonl/17603 | {
"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,
2895,
26488,
1710,
276,
455,
1961,
8336,
19817,
368,
341,
262,
1077,
274,
284,
330,
13683,
18945,
51255,
59374,
876,
262,
2060,
10714,
0,
2099,
82,
95874,
28,
17,
1125,
330,
13683,
797,
262,
206... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_kryptus_query_against_server() {
let mut connector = SslConnector::builder(SslMethod::tls()).unwrap();
connector.set_verify(SslVerifyMode::NONE);
let connector = connector.build();
let host = std::env::var("KRYPTUS_HOST").unwrap();
let port = std::env::var("KRYPTUS_PORT").unwrap();
let stream = TcpStream::connect(format!("{}:{}", host, port)).unwrap();
let mut tls = connector.connect(&host, stream).unwrap();
let client = ClientBuilder::new(&mut tls)
.with_credentials(
std::env::var("KRYPTUS_USER").unwrap(),
Some(std::env::var("KRYPTUS_PASS").unwrap()),
)
.with_reader_config(Config::default().with_max_bytes(64 * 1024))
.build();
let response_payload = client.query().unwrap();
dbg!(response_payload);
} | rust_cleaned_test_functions.jsonl/26632 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 414
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4698,
3571,
355,
5738,
62427,
267,
12015,
368,
341,
286,
1077,
5206,
26989,
284,
328,
3226,
35954,
486,
17850,
3759,
3226,
3523,
486,
34488,
6011,
15454,
543,
286,
26989,
980,
35638,
3759,
3226,
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_gossip_services_spy() {
const TIMEOUT: Duration = Duration::from_secs(5);
let keypair = Keypair::new();
let peer0 = solana_sdk::pubkey::new_rand();
let peer1 = solana_sdk::pubkey::new_rand();
let contact_info = ContactInfo::new_localhost(&keypair.pubkey(), 0);
let peer0_info = ContactInfo::new_localhost(&peer0, 0);
let peer1_info = ContactInfo::new_localhost(&peer1, 0);
let cluster_info = ClusterInfo::new(
contact_info,
Arc::new(keypair),
SocketAddrSpace::Unspecified,
);
cluster_info.insert_info(peer0_info.clone());
cluster_info.insert_info(peer1_info);
let spy_ref = Arc::new(cluster_info);
let (met_criteria, elapsed, _, tvu_peers) = spy(spy_ref.clone(), None, TIMEOUT, None, None);
assert!(!met_criteria);
assert!((TIMEOUT..TIMEOUT + Duration::from_secs(1)).contains(&elapsed));
assert_eq!(tvu_peers, spy_ref.tvu_peers());
// Find num_nodes
let (met_criteria, _, _, _) = spy(spy_ref.clone(), Some(1), TIMEOUT, None, None);
assert!(met_criteria);
let (met_criteria, _, _, _) = spy(spy_ref.clone(), Some(2), TIMEOUT, None, None);
assert!(met_criteria);
// Find specific node by pubkey
let (met_criteria, _, _, _) = spy(spy_ref.clone(), None, TIMEOUT, Some(peer0), None);
assert!(met_criteria);
let (met_criteria, _, _, _) = spy(
spy_ref.clone(),
None,
TIMEOUT,
Some(solana_sdk::pubkey::new_rand()),
None,
);
assert!(!met_criteria);
// Find num_nodes *and* specific node by pubkey
let (met_criteria, _, _, _) = spy(spy_ref.clone(), Some(1), TIMEOUT, Some(peer0), None);
assert!(met_criteria);
let (met_criteria, _, _, _) = spy(spy_ref.clone(), Some(3), TIMEOUT, Some(peer0), None);
assert!(!met_criteria);
let (met_criteria, _, _, _) = spy(
spy_ref.clone(),
Some(1),
TIMEOUT,
Some(solana_sdk::pubkey::new_rand()),
None,
);
assert!(!met_criteria);
// Find specific node by gossip address
let (met_criteria, _, _, _) = spy(
spy_ref.clone(),
None,
TIMEOUT,
None,
Some(&peer0_info.gossip),
);
assert!(met_criteria);
let (met_criteria, _, _, _) = spy(
spy_ref,
None,
TIMEOUT,
None,
Some(&"1.1.1.1:1234".parse().unwrap()),
);
assert!(!met_criteria);
} | rust_cleaned_test_functions.jsonl/12014 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1385
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1889,
41473,
39846,
643,
3288,
368,
341,
286,
733,
90846,
25,
21045,
284,
21045,
486,
1499,
68718,
7,
20,
317,
286,
1077,
1376,
12670,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
14397,
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_gsv_two_of_three() {
let mut nmea = Nmea::new();
nmea.parse("$GPGSV,3,2,11,02,39,223,19,13,28,070,17,26,23,252,,04,14,186,14*79")
.unwrap();
nmea.parse("$GPGSV,3,3,11,29,09,301,24,16,09,020,,36,,,*76")
.unwrap();
assert_eq!(nmea.satellites().len(), 7);
} | rust_cleaned_test_functions.jsonl/65860 | {
"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,
1889,
3492,
23241,
3575,
50016,
368,
341,
286,
1077,
5206,
308,
2660,
64,
284,
451,
2660,
64,
486,
931,
543,
1789,
286,
308,
2660,
64,
4632,
20912,
38,
11383,
17803,
11,
18,
11,
17,
11,
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_range_builder() {
let builder = RangeQuery::builder().gte(5).lte(10).for_field("test");
let query: Query = builder.build();
if let Query::Range(rq) = query {
assert_eq!(rq.range.field, "test");
}
} | rust_cleaned_test_functions.jsonl/76135 | {
"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,
9698,
28532,
368,
341,
286,
1077,
7363,
284,
16437,
2859,
486,
17850,
1005,
55067,
7,
20,
568,
48791,
7,
16,
15,
568,
1958,
5013,
445,
1944,
797,
286,
1077,
3239,
25,
11361,
284,
7363,
13239,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_time_wait_retransmit() {
let mut s = socket_time_wait(false);
recv!(s, [TcpRepr {
seq_number: LOCAL_SEQ + 1 + 1,
ack_number: Some(REMOTE_SEQ + 1 + 1),
..RECV_TEMPL
}]);
send!(s, time 5_000, TcpRepr {
control: TcpControl::Fin,
seq_number: REMOTE_SEQ + 1,
ack_number: Some(LOCAL_SEQ + 1 + 1),
..SEND_TEMPL
}, Ok(Some(TcpRepr {
seq_number: LOCAL_SEQ + 1 + 1,
ack_number: Some(REMOTE_SEQ + 1 + 1),
..RECV_TEMPL
})));
assert_eq!(s.timer, Timer::Close { expires_at: Instant::from_secs(5) + CLOSE_DELAY });
} | rust_cleaned_test_functions.jsonl/1746 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 413
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3009,
18760,
1288,
1458,
1763,
368,
341,
286,
1077,
5206,
274,
284,
7575,
3009,
18760,
3576,
317,
286,
27006,
10297,
82,
11,
508,
77536,
693,
649,
341,
310,
12981,
5500,
25,
42501,
50045,
488,
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_withdraw_minimum_stake_delegation() {
let starting_stake_delegation = MINIMUM_STAKE_DELEGATION;
for (ending_stake_delegation, expected_result) in [
(MINIMUM_STAKE_DELEGATION, Ok(())),
(
MINIMUM_STAKE_DELEGATION - 1,
Err(InstructionError::InsufficientFunds),
),
] {
let rent = Rent::default();
let rent_exempt_reserve = rent.minimum_balance(std::mem::size_of::<StakeState>());
let stake_pubkey = Pubkey::new_unique();
let meta = Meta {
rent_exempt_reserve,
..Meta::auto(&stake_pubkey)
};
for stake_state in &[
StakeState::Initialized(meta),
StakeState::Stake(meta, just_stake(starting_stake_delegation)),
] {
let rewards_balance = 123;
let stake_account = AccountSharedData::new_ref_data_with_space(
starting_stake_delegation + rent_exempt_reserve + rewards_balance,
stake_state,
std::mem::size_of::<StakeState>(),
&id(),
)
.unwrap();
let stake_keyed_account = KeyedAccount::new(&stake_pubkey, true, &stake_account);
let to_pubkey = Pubkey::new_unique();
let to_account =
AccountSharedData::new_ref(rent_exempt_reserve, 0, &system_program::id());
let to_keyed_account = KeyedAccount::new(&to_pubkey, false, &to_account);
let withdraw_amount =
(starting_stake_delegation + rewards_balance) - ending_stake_delegation;
assert_eq!(
expected_result,
stake_keyed_account.withdraw(
withdraw_amount,
&to_keyed_account,
&Clock::default(),
&StakeHistory::default(),
&stake_keyed_account,
None,
),
);
}
}
} | rust_cleaned_test_functions.jsonl/87043 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1249
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6615,
7633,
84855,
1261,
726,
2259,
87566,
368,
341,
286,
1077,
5916,
1261,
726,
2259,
87566,
284,
16701,
40025,
2402,
25474,
2881,
35213,
3495,
280,
286,
369,
320,
2459,
1261,
726,
2259,
87566,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_mkfifo_directory() {
// mkfifo should fail if a directory is given
assert!(mkfifo(&env::temp_dir(), stat::S_IRUSR).is_err());
} | rust_cleaned_test_functions.jsonl/65749 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 67
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
64861,
74031,
14846,
368,
341,
262,
442,
23789,
74031,
1265,
3690,
421,
264,
6220,
374,
2661,
198,
262,
2060,
10297,
24452,
74031,
2099,
3160,
486,
3888,
4334,
1507,
2793,
486,
50,
17138,
49558,
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 |
#[test]
fn test_decoder_invalid_lone_lower_surrogate() {
let mut d = UTF_16BE.decoder();
assert_feed_err!(d, [], [0xdc, 0x00], [], "");
assert_feed_err!(d, [0x12, 0x34], [0xdc, 0x00], [0x56, 0x78], "\u1234");
assert_finish_ok!(d, "");
let mut d = UTF_16BE.decoder();
assert_feed_err!(d, [], [0xdf, 0xff], [], "");
assert_feed_err!(d, [0x12, 0x34], [0xdf, 0xff], [0x56, 0x78], "\u1234");
assert_finish_ok!(d, "");
} | rust_cleaned_test_functions.jsonl/15682 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 275
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
49843,
31433,
907,
603,
30425,
49946,
48373,
368,
341,
286,
1077,
5206,
294,
284,
20076,
62,
16,
21,
11594,
74047,
543,
286,
2060,
42390,
9266,
10297,
67,
11,
10071,
508,
15,
48361,
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_list_of_struct_roundtrip() {
// define schema
let int_field = Field::new("a", DataType::Int32, true);
let int_field2 = Field::new("b", DataType::Int32, true);
let int_builder = Int32Builder::new(10);
let int_builder2 = Int32Builder::new(10);
let struct_builder = StructBuilder::new(
vec![int_field, int_field2],
vec![Box::new(int_builder), Box::new(int_builder2)],
);
let mut list_builder = ListBuilder::new(struct_builder);
// Construct the following array
let values = list_builder.values();
values
.field_builder::<Int32Builder>(0)
.unwrap()
.append_value(1)
.unwrap();
values
.field_builder::<Int32Builder>(1)
.unwrap()
.append_value(2)
.unwrap();
values.append(true).unwrap();
list_builder.append(true).unwrap();
list_builder.append(true).unwrap();
// null
list_builder.append(false).unwrap();
let values = list_builder.values();
values
.field_builder::<Int32Builder>(0)
.unwrap()
.append_null()
.unwrap();
values
.field_builder::<Int32Builder>(1)
.unwrap()
.append_null()
.unwrap();
values.append(false).unwrap();
values
.field_builder::<Int32Builder>(0)
.unwrap()
.append_null()
.unwrap();
values
.field_builder::<Int32Builder>(1)
.unwrap()
.append_null()
.unwrap();
values.append(false).unwrap();
list_builder.append(true).unwrap();
let values = list_builder.values();
values
.field_builder::<Int32Builder>(0)
.unwrap()
.append_null()
.unwrap();
values
.field_builder::<Int32Builder>(1)
.unwrap()
.append_value(3)
.unwrap();
values.append(true).unwrap();
list_builder.append(true).unwrap();
let values = list_builder.values();
values
.field_builder::<Int32Builder>(0)
.unwrap()
.append_value(2)
.unwrap();
values
.field_builder::<Int32Builder>(1)
.unwrap()
.append_null()
.unwrap();
values.append(true).unwrap();
list_builder.append(true).unwrap();
let array = Arc::new(list_builder.finish());
one_column_roundtrip(array, true, Some(10));
} | rust_cleaned_test_functions.jsonl/45134 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1462
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2019,
3575,
15126,
29896,
32981,
368,
341,
286,
442,
6979,
10802,
198,
286,
1077,
526,
5013,
284,
8601,
486,
931,
445,
64,
497,
33172,
486,
1072,
18,
17,
11,
830,
317,
286,
1077,
526,
5013,
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... | 1 |
#[test]
fn test_hint_workspace_virtual() {
let p = project()
.file(
"Cargo.toml",
r#"
[workspace]
members = ["a", "b"]
"#,
)
.file("a/Cargo.toml", &basic_manifest("a", "0.1.0"))
.file("a/src/lib.rs", "#[test] fn t1() {}")
.file("b/Cargo.toml", &basic_manifest("b", "0.1.0"))
.file("b/src/lib.rs", "#[test] fn t1() {assert!(false)}")
.build();
p.cargo("test")
.with_stderr_contains("[ERROR] test failed, to rerun pass '-p b --lib'")
.with_status(101)
.run();
p.cargo("test")
.cwd("b")
.with_stderr_contains("[ERROR] test failed, to rerun pass '--lib'")
.with_status(101)
.run();
} | rust_cleaned_test_functions.jsonl/95378 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 433
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45825,
75560,
58730,
368,
341,
262,
1077,
281,
284,
2390,
741,
286,
659,
1192,
1006,
310,
330,
98228,
73494,
75,
756,
310,
435,
2,
698,
310,
508,
42909,
921,
310,
3613,
284,
4383,
64,
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 |
#[test]
fn test_vec4_ceil() {
assert_eq!(
Vec4::new(1.35, 1.5, -1.5, 1234.1234).ceil(),
Vec4::new(2.0, 2.0, -1.0, 1235.0)
);
assert_eq!(
Vec4::new(f32::INFINITY, f32::NEG_INFINITY, 0.0, 0.0).ceil(),
Vec4::new(f32::INFINITY, f32::NEG_INFINITY, 0.0, 0.0)
);
assert!(Vec4::new(0.0, 0.0, f32::NAN, 0.0).ceil().z.is_nan());
assert_eq!(
Vec4::new(-1234.1234, -2000000.123, 1000000.123, 1000.9).ceil(),
Vec4::new(-1234.0, -2000000.0, 1000001.0, 1001.0)
);
} | rust_cleaned_test_functions.jsonl/68885 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 321
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13251,
19,
62,
22058,
368,
341,
262,
2060,
10714,
33673,
286,
11312,
19,
486,
931,
7,
16,
13,
18,
20,
11,
220,
16,
13,
20,
11,
481,
16,
13,
20,
11,
220,
16,
17,
18,
19,
13,
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_try_merge_aliases() -> Result<(), Error> {
let aliases: Vec<FontFamilyAliasSet> = vec![
FontFamilyAliasSet::without_overrides(vec!["Abc"])?,
FontFamilyAliasSet::without_overrides(vec!["Def"])?,
// Duplicate
FontFamilyAliasSet::without_overrides(vec!["Abc"])?,
FontFamilyAliasSet::new(
vec!["Abc Condensed", "Abc Squished"],
FidlStyle {
slant: None,
weight: None,
width: Some(Width::Condensed),
..FidlStyle::EMPTY
},
iter::empty::<String>(),
)?,
// Duplicate
FontFamilyAliasSet::new(
vec!["Abc Condensed", "Condensed Abc"],
FidlStyle {
slant: None,
weight: None,
width: Some(Width::Condensed),
..FidlStyle::EMPTY
},
iter::empty::<String>(),
)?,
];
let expected = vec![
FontFamilyAliasSet::without_overrides(vec!["Abc", "Def"])?,
FontFamilyAliasSet::new(
vec!["Abc Condensed", "Abc Squished", "Condensed Abc"],
StyleOptions { width: Some(Width::Condensed), ..Default::default() },
iter::empty::<String>(),
)?,
];
let actual = aliases.into_iter().try_merge_groups()?;
assert_eq!(actual, expected);
Ok(())
} | rust_cleaned_test_functions.jsonl/35628 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 887
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53283,
20888,
90233,
368,
1464,
5714,
68843,
4600,
29,
341,
286,
1077,
40386,
25,
11312,
27,
5447,
15192,
22720,
1649,
29,
284,
7486,
90515,
310,
9562,
15192,
22720,
1649,
486,
28996,
15431,
18245,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_terminal_or_honor_in_each_set() {
let test_str = "123999m111p79s44z 8s";
let test = Hand::from(test_str);
let test_analyzer = HandAnalyzer::new(&test).unwrap();
let mut status = Status::new();
let settings = Settings::new();
status.has_claimed_open = false;
assert_eq!(
check_terminal_or_honor_in_each_set(&test_analyzer, &status, &settings).unwrap(),
("混全帯么九", true, 2)
);
} | rust_cleaned_test_functions.jsonl/5171 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 246
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
64309,
8734,
1523,
54037,
1243,
32046,
2602,
368,
341,
286,
1077,
1273,
2895,
284,
330,
16,
17,
18,
24,
24,
24,
76,
16,
16,
16,
79,
22,
24,
82,
19,
19,
89,
220,
23,
82,
876,
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... | 1 |
#[test]
fn test_is_valid() {
assert!(is_valid("()".to_string()));
assert!(is_valid("()[]{}".to_string()));
assert!(!is_valid("(]".to_string()));
assert!(!is_valid("([)]".to_string()));
assert!(is_valid("{[]}".to_string()));
assert!(!is_valid("}".to_string()));
} | rust_cleaned_test_functions.jsonl/76844 | {
"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,
6892,
8337,
368,
341,
262,
2060,
10297,
285,
8337,
445,
368,
3263,
983,
3904,
7392,
262,
2060,
10297,
285,
8337,
445,
368,
1294,
42025,
983,
3904,
7392,
262,
2060,
0,
3471,
285,
8337,
31732,
60,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_in_transaction() {
for _ in 0..1000000 {
unsafe {
assert!(!test().in_transaction());
let mut fail_count = 0;
let tx = HardwareTx::new(|_| -> Result<(), ()> {
fail_count += 1;
if fail_count < 4 {
Ok(())
} else {
Err(())
}
});
if let Ok(_tx) = tx {
assert!(test().in_transaction());
} else {
assert!(!test().in_transaction());
}
}
}
} | rust_cleaned_test_functions.jsonl/93051 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 373
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1243,
28884,
368,
341,
262,
369,
716,
304,
220,
15,
496,
16,
15,
15,
15,
15,
15,
15,
341,
286,
19860,
341,
310,
2060,
0,
3471,
1944,
1005,
258,
28884,
1423,
310,
1077,
5206,
3690,
3180,
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... | 4 |
#[test]
fn test_pat_() {
check(
r#"
macro_rules! m {
($p:pat) => { fn foo() { let $p; } }
}
m! { (a, b) }
"#,
expect![[r#"
macro_rules! m {
($p:pat) => { fn foo() { let $p; } }
}
fn foo() {
let (a, b);
}
"#]],
);
} | rust_cleaned_test_functions.jsonl/85229 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 154
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
55824,
62,
368,
341,
262,
1779,
1006,
286,
435,
2,
698,
32606,
21407,
0,
296,
341,
262,
1711,
79,
25,
4676,
8,
589,
314,
5168,
15229,
368,
314,
1077,
400,
79,
26,
335,
456,
532,
76,
0,
314... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_api_get_timestamp_proof() {
let (mut testkit, _) = init_testkit();
let keypair = gen_keypair();
// Create timestamp
let info = Timestamp::new(&Hash::zero(), "metadata");
let tx = TxTimestamp::sign(&keypair.0, info, &keypair.1);
testkit.create_block_with_transactions(txvec![tx.clone()]);
// get proof
let api = testkit.api();
let _: serde_json::Value = api
.public(ApiKind::Service("timestamping"))
.query(&TimestampQuery::new(Hash::zero()))
.get("v1/timestamps/proof")
.unwrap();
} | rust_cleaned_test_functions.jsonl/32317 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 249
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11697,
3062,
23073,
86757,
368,
341,
262,
1077,
320,
6984,
1273,
8226,
11,
27439,
284,
2930,
4452,
8226,
1428,
262,
1077,
1376,
12670,
284,
4081,
3097,
12670,
1428,
262,
442,
4230,
11441,
198,
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_mdns_unicast_response_bit_handling() {
const QCLASS_OFFSET: usize = 1 /* empty name */ +
std::mem::size_of::<u16>() /* query_type */;
let mut query = Query::new();
query.set_mdns_unicast_response(true);
let mut vec_bytes: Vec<u8> = Vec::with_capacity(512);
{
let mut encoder = BinEncoder::new(&mut vec_bytes);
query.emit(&mut encoder).unwrap();
let query_class_slice = encoder.slice_of(QCLASS_OFFSET, QCLASS_OFFSET + 2);
assert_eq!(query_class_slice, &[0x80, 0x01]);
}
let mut decoder = BinDecoder::new(&vec_bytes);
let got = Query::read(&mut decoder).unwrap();
assert_eq!(got.query_class(), DNSClass::IN);
assert!(got.mdns_unicast_response());
} | rust_cleaned_test_functions.jsonl/11229 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 324
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
32994,
4412,
62,
3525,
559,
9655,
13996,
75642,
368,
341,
262,
733,
1207,
24407,
17626,
25,
22301,
284,
220,
16,
1391,
4287,
829,
639,
3610,
286,
1460,
486,
10536,
486,
2141,
3575,
27638,
84,
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_unexpected_middle_type() {
let mut log = new_record_test();
log.write("foo");
log.set_byte(6, Middle as u8);
log.fix_checksum(0, 3);
assert_eq!(EOF, log.read());
assert_eq!(3, log.dropped_bytes());
assert!(log.match_error("missing start"));
} | rust_cleaned_test_functions.jsonl/46694 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 162
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4907,
7325,
62580,
1819,
368,
341,
286,
1077,
5206,
1487,
284,
501,
14192,
4452,
543,
286,
1487,
3836,
445,
7975,
797,
286,
1487,
980,
19737,
7,
21,
11,
12592,
438,
575,
23,
317,
286,
1487,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_direction_error() {
assert_eq!(
Direction::from_str("not a direction").unwrap_err(),
DirectionConversionError::InvalidDirection("not a direction".to_string())
);
} | rust_cleaned_test_functions.jsonl/100931 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 102
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
25438,
4096,
368,
341,
286,
2060,
10714,
33673,
310,
18904,
486,
1499,
2895,
445,
1921,
264,
5106,
1827,
15454,
9266,
3148,
310,
18904,
48237,
1454,
486,
7928,
9268,
445,
1921,
264,
5106,
3263,
98... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_delete_reaction() {
let emoji = emoji();
let route = Route::DeleteReaction {
channel_id: CHANNEL_ID,
emoji: &emoji,
message_id: MESSAGE_ID,
user_id: USER_ID,
};
assert_eq!(
route.to_string(),
format!(
"channels/{channel_id}/messages/{message_id}/reactions/{emoji}/{user_id}",
channel_id = CHANNEL_ID,
emoji = emoji,
message_id = MESSAGE_ID,
user_id = USER_ID
)
);
} | rust_cleaned_test_functions.jsonl/119909 | {
"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,
11353,
96631,
368,
341,
286,
1077,
42365,
284,
42365,
1428,
286,
1077,
6021,
284,
9572,
486,
6435,
87236,
341,
310,
5496,
842,
25,
58756,
3450,
345,
310,
42365,
25,
609,
37523,
345,
310,
1943,
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_cipher_from_name() {
let cipher = TlsCipherSuite::from_name("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384")
.expect("could not get cipher");
println!("Found cipher: {:?}", cipher);
} | rust_cleaned_test_functions.jsonl/37914 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 113
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
76692,
5673,
1269,
368,
341,
286,
1077,
31088,
284,
350,
4730,
79460,
28000,
486,
1499,
1269,
445,
45439,
2089,
6484,
1799,
69510,
72638,
23929,
69381,
62,
17,
20,
21,
2646,
9985,
38096,
18,
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 |
#[test]
fn test_big_clear() {
let mut b = Bitv::from_elem(140, true);
assert!(!b.none() && b.all());
b.clear();
assert!(b.none() && !b.all());
} | rust_cleaned_test_functions.jsonl/119294 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 102
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
36386,
21811,
368,
341,
286,
1077,
5206,
293,
284,
6495,
85,
486,
1499,
28179,
7,
16,
19,
15,
11,
830,
317,
286,
2060,
0,
3471,
65,
52063,
368,
1009,
293,
7670,
1423,
286,
293,
7426,
543,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 3 |
#[test]
fn test_read_integer_limits() {
assert_eq!(
read_integer(&cbor_unsigned!(std::u64::MAX)),
Err(CTAP2_ERR_CBOR_UNEXPECTED_TYPE)
);
assert_eq!(
read_integer(&cbor_unsigned!((std::i64::MAX as u64) + 1)),
Err(CTAP2_ERR_CBOR_UNEXPECTED_TYPE)
);
assert_eq!(read_integer(&cbor_int!(std::i64::MAX)), Ok(std::i64::MAX));
assert_eq!(read_integer(&cbor_int!(123)), Ok(123));
assert_eq!(read_integer(&cbor_int!(1)), Ok(1));
assert_eq!(read_integer(&cbor_int!(0)), Ok(0));
assert_eq!(read_integer(&cbor_int!(-1)), Ok(-1));
assert_eq!(read_integer(&cbor_int!(-123)), Ok(-123));
assert_eq!(read_integer(&cbor_int!(std::i64::MIN)), Ok(std::i64::MIN));
} | rust_cleaned_test_functions.jsonl/51436 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 419
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
31725,
31820,
368,
341,
286,
2060,
10714,
33673,
310,
1349,
31725,
2099,
7221,
269,
67830,
10297,
1834,
486,
84,
21,
19,
486,
10586,
6965,
310,
15495,
7,
1162,
2537,
17,
9875,
48933,
868,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_neq_opcode() {
let mut test_vm = VM::new();
test_vm.registers[0] = 10;
test_vm.registers[1] = 10;
test_vm.program = prepend_header(vec![
12, 0, 1, 0,
12, 0, 1, 0,
0]); // Halt
test_vm.run_once();
assert_eq!(test_vm.equal_flag, false);
test_vm.registers[1] = 20;
test_vm.run_once();
assert_eq!(test_vm.equal_flag, true);
} | rust_cleaned_test_functions.jsonl/58528 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 263
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13925,
80,
71319,
368,
341,
286,
1077,
5206,
1273,
39008,
284,
17792,
486,
931,
543,
286,
1273,
39008,
7031,
9303,
58,
15,
60,
284,
220,
16,
15,
280,
286,
1273,
39008,
7031,
9303,
58,
16,
60,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ancestor_of() {
macro_rules! t(
(s: $path:expr, $dest:expr, $exp:expr) => (
{
let path = Path::new($path);
let dest = Path::new($dest);
let exp = $exp;
let res = path.is_ancestor_of(&dest);
assert!(res == exp,
"`{}`.is_ancestor_of(`{}`): Expected {:?}, found {:?}",
path.as_str().unwrap(), dest.as_str().unwrap(), exp, res);
}
)
)
t!(s: "a\\b\\c", "a\\b\\c\\d", true);
t!(s: "a\\b\\c", "a\\b\\c", true);
t!(s: "a\\b\\c", "a\\b", false);
t!(s: "\\a\\b\\c", "\\a\\b\\c", true);
t!(s: "\\a\\b", "\\a\\b\\c", true);
t!(s: "\\a\\b\\c\\d", "\\a\\b\\c", false);
t!(s: "\\a\\b", "a\\b\\c", false);
t!(s: "a\\b", "\\a\\b\\c", false);
t!(s: "a\\b\\c", "a\\b\\d", false);
t!(s: "..\\a\\b\\c", "a\\b\\c", false);
t!(s: "a\\b\\c", "..\\a\\b\\c", false);
t!(s: "a\\b\\c", "a\\b\\cd", false);
t!(s: "a\\b\\cd", "a\\b\\c", false);
t!(s: "..\\a\\b", "..\\a\\b\\c", true);
t!(s: ".", "a\\b", true);
t!(s: ".", ".", true);
t!(s: "\\", "\\", true);
t!(s: "\\", "\\a\\b", true);
t!(s: "..", "a\\b", true);
t!(s: "..\\..", "a\\b", true);
t!(s: "foo\\bar", "foobar", false);
t!(s: "foobar", "foo\\bar", false);
t!(s: "foo", "C:foo", false);
t!(s: "C:foo", "foo", false);
t!(s: "C:foo", "C:foo\\bar", true);
t!(s: "C:foo\\bar", "C:foo", false);
t!(s: "C:\\foo", "C:\\foo\\bar", true);
t!(s: "C:", "C:", true);
t!(s: "C:", "C:\\", false);
t!(s: "C:\\", "C:", false);
t!(s: "C:\\", "C:\\", true);
t!(s: "C:\\foo\\bar", "C:\\foo", false);
t!(s: "C:foo\\bar", "C:foo", false);
t!(s: "C:\\foo", "\\foo", false);
t!(s: "\\foo", "C:\\foo", false);
t!(s: "\\\\server\\share\\foo", "\\\\server\\share\\foo\\bar", true);
t!(s: "\\\\server\\share", "\\\\server\\share\\foo", true);
t!(s: "\\\\server\\share\\foo", "\\\\server\\share", false);
t!(s: "C:\\foo", "\\\\server\\share\\foo", false);
t!(s: "\\\\server\\share\\foo", "C:\\foo", false);
t!(s: "\\\\?\\foo\\bar", "\\\\?\\foo\\bar\\baz", true);
t!(s: "\\\\?\\foo\\bar\\baz", "\\\\?\\foo\\bar", false);
t!(s: "\\\\?\\foo\\bar", "\\foo\\bar\\baz", false);
t!(s: "\\foo\\bar", "\\\\?\\foo\\bar\\baz", false);
t!(s: "\\\\?\\C:\\foo\\bar", "\\\\?\\C:\\foo\\bar\\baz", true);
t!(s: "\\\\?\\C:\\foo\\bar\\baz", "\\\\?\\C:\\foo\\bar", false);
t!(s: "\\\\?\\C:\\", "\\\\?\\C:\\foo", true);
t!(s: "\\\\?\\C:", "\\\\?\\C:\\", false); // this is a weird one
t!(s: "\\\\?\\C:\\", "\\\\?\\C:", false);
t!(s: "\\\\?\\C:\\a", "\\\\?\\c:\\a\\b", true);
t!(s: "\\\\?\\c:\\a", "\\\\?\\C:\\a\\b", true);
t!(s: "\\\\?\\C:\\a", "\\\\?\\D:\\a\\b", false);
t!(s: "\\\\?\\foo", "\\\\?\\foobar", false);
t!(s: "\\\\?\\a\\b", "\\\\?\\a\\b\\c", true);
t!(s: "\\\\?\\a\\b", "\\\\?\\a\\b\\", true);
t!(s: "\\\\?\\a\\b\\", "\\\\?\\a\\b", true);
t!(s: "\\\\?\\a\\b\\c", "\\\\?\\a\\b", false);
t!(s: "\\\\?\\a\\b\\c", "\\\\?\\a\\b\\", false);
t!(s: "\\\\?\\UNC\\a\\b\\c", "\\\\?\\UNC\\a\\b\\c\\d", true);
t!(s: "\\\\?\\UNC\\a\\b\\c\\d", "\\\\?\\UNC\\a\\b\\c", false);
t!(s: "\\\\?\\UNC\\a\\b", "\\\\?\\UNC\\a\\b\\c", true);
t!(s: "\\\\.\\foo\\bar", "\\\\.\\foo\\bar\\baz", true);
t!(s: "\\\\.\\foo\\bar\\baz", "\\\\.\\foo\\bar", false);
t!(s: "\\\\.\\foo", "\\\\.\\foo\\bar", true);
t!(s: "\\\\.\\foo", "\\\\.\\foobar", false);
t!(s: "\\a\\b", "\\\\?\\a\\b", false);
t!(s: "\\\\?\\a\\b", "\\a\\b", false);
t!(s: "\\a\\b", "\\\\?\\C:\\a\\b", false);
t!(s: "\\\\?\\C:\\a\\b", "\\a\\b", false);
t!(s: "Z:\\a\\b", "\\\\?\\z:\\a\\b", true);
t!(s: "C:\\a\\b", "\\\\?\\D:\\a\\b", false);
t!(s: "a\\b", "\\\\?\\a\\b", false);
t!(s: "\\\\?\\a\\b", "a\\b", false);
t!(s: "C:\\a\\b", "\\\\?\\C:\\a\\b", true);
t!(s: "\\\\?\\C:\\a\\b", "C:\\a\\b", true);
t!(s: "C:a\\b", "\\\\?\\C:\\a\\b", false);
t!(s: "C:a\\b", "\\\\?\\C:a\\b", false);
t!(s: "\\\\?\\C:\\a\\b", "C:a\\b", false);
t!(s: "\\\\?\\C:a\\b", "C:a\\b", false);
t!(s: "C:\\a\\b", "\\\\?\\C:\\a\\b\\", true);
t!(s: "\\\\?\\C:\\a\\b\\", "C:\\a\\b", true);
t!(s: "\\\\a\\b\\c", "\\\\?\\UNC\\a\\b\\c", true);
t!(s: "\\\\?\\UNC\\a\\b\\c", "\\\\a\\b\\c", true);
} | rust_cleaned_test_functions.jsonl/102781 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2903
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6892,
62,
66878,
3575,
368,
341,
286,
18072,
21407,
0,
259,
1006,
310,
320,
82,
25,
400,
2343,
96011,
11,
400,
4979,
96011,
11,
400,
4580,
96011,
8,
589,
2399,
394,
341,
503,
1077,
1815,
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_master_from_dice() {
let bytes = include_bytes!("../../test_data/dice/priv1.key");
let expected: PrivateMasterKey = serde_json::from_slice(bytes).unwrap();
let calculated = calculate_key(&vec![2], 2, Network::Bitcoin, "name").unwrap();
assert_eq!(calculated, expected);
let bytes = include_bytes!("../../test_data/dice/priv2.key");
let expected: PrivateMasterKey = serde_json::from_slice(bytes).unwrap();
let calculated = calculate_key(
&vec![2, 3, 4, 5, 6, 7, 8, 9, 10, 1],
256,
Network::Bitcoin,
"name",
)
.unwrap();
assert_eq!(
calculated.fingerprint.to_string(),
expected.fingerprint.to_string()
);
assert_eq!(calculated, expected);
} | rust_cleaned_test_functions.jsonl/39504 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 403
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24582,
5673,
97196,
368,
341,
23459,
286,
1077,
5820,
284,
2924,
12524,
17223,
2748,
1944,
1769,
3446,
558,
14,
11887,
16,
4735,
797,
286,
1077,
3601,
25,
9679,
18041,
1592,
284,
61570,
9455,
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_padded_frame_copy_outside_input() {
let (frame, fi) = create_frame();
let tile = frame.as_tile();
let sbo = TileSuperBlockOffset(SuperBlockOffset { x: 7, y: 0 });
let pad = 2;
let padded_frame = cdef_sb_padded_frame_copy(&fi, sbo, 1, 1, &tile, pad);
assert_eq!(padded_frame.planes[0].cfg.width, 64);
assert_eq!(padded_frame.planes[0].cfg.height, 64);
let po = PlaneOffset { x: 446, y: 0 };
let in_luma_slice = frame.planes[0].slice(po);
let out_luma_slice =
padded_frame.planes[0].region(Area::StartingAt { x: -2, y: 0 });
// values from the input frame
for row in 0..66 {
for col in 0..66 {
let in_pixel = in_luma_slice[row][col];
let out_pixel = out_luma_slice[row][col];
assert_eq!(out_pixel, in_pixel);
}
// right frame padding
for col in 66..68 {
let out_pixel = out_luma_slice[row][col];
assert_eq!(out_pixel, CDEF_VERY_LARGE);
}
}
// top frame padding
let out_luma_slice =
padded_frame.planes[0].region(Area::StartingAt { x: -2, y: -2 });
for row in 0..2 {
for col in 0..68 {
let out_pixel = out_luma_slice[row][col];
assert_eq!(out_pixel, CDEF_VERY_LARGE);
}
}
} | rust_cleaned_test_functions.jsonl/77073 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 616
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
620,
16828,
8929,
16096,
6068,
2929,
5898,
368,
341,
262,
1077,
320,
6763,
11,
9136,
8,
284,
1855,
8929,
543,
262,
1077,
10023,
284,
4034,
5357,
29844,
543,
1066,
262,
1077,
274,
749,
284,
20744... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_part1() {
assert!(supports_tls(&parse_addr("abba[mnop]qrst")));
assert!(!supports_tls(&parse_addr("abcd[bddb]xyyx")));
assert!(!supports_tls(&parse_addr("aaaa[qwer]tyui")));
assert!(supports_tls(&parse_addr("ioxxoj[asdfgh]zxcvbn")));
} | rust_cleaned_test_functions.jsonl/60100 | {
"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,
10495,
16,
368,
341,
286,
2060,
10297,
77709,
71262,
2099,
6400,
7387,
445,
370,
4645,
12065,
62813,
60,
61739,
17621,
286,
2060,
0,
3471,
77709,
71262,
2099,
6400,
7387,
445,
68644,
18483,
89723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_failure_not_authorized() {
let res = run_test(12005, 12006, Some(InjectedFailure::NotAuthorized));
assert_eq!(res.status, StatusCode::BadRequest);
} | rust_cleaned_test_functions.jsonl/36402 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 70
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
43618,
7913,
62,
19084,
368,
341,
262,
1077,
592,
284,
1598,
4452,
7,
16,
17,
15,
15,
20,
11,
220,
16,
17,
15,
15,
21,
11,
4329,
7,
88818,
17507,
486,
2623,
60454,
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 |
#[test]
fn test_set_force_consistency_checks() {
let path = tempdir_with_prefix("_rust_rocksdb_force_consistency_checks");
let mut opts = DBOptions::new();
let mut cf_opts = ColumnFamilyOptions::new();
opts.create_if_missing(true);
cf_opts.set_force_consistency_checks(true);
DB::open_cf(
opts,
path.path().to_str().unwrap(),
vec![("default", cf_opts)],
)
.unwrap();
} | rust_cleaned_test_functions.jsonl/34106 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 197
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2602,
40739,
31971,
47094,
75797,
368,
341,
262,
1077,
1815,
284,
2730,
3741,
6615,
13974,
16975,
35788,
26608,
14553,
1999,
40739,
31971,
47094,
75797,
797,
262,
1077,
5206,
12185,
284,
5952,
3798,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_move_file_between_dirs() {
let (at, mut ucmd) = at_and_ucmd!();
let dir1 = "test_mv_move_file_between_dirs_dir1";
let dir2 = "test_mv_move_file_between_dirs_dir2";
let file = "test_mv_move_file_between_dirs_file";
at.mkdir(dir1);
at.mkdir(dir2);
at.touch(&format!("{}/{}", dir1, file));
assert!(at.file_exists(&format!("{}/{}", dir1, file)));
ucmd.arg(&format!("{}/{}", dir1, file))
.arg(dir2)
.succeeds()
.no_stderr();
assert!(!at.file_exists(&format!("{}/{}", dir1, file)));
assert!(at.file_exists(&format!("{}/{}", dir2, file)));
} | rust_cleaned_test_functions.jsonl/41606 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 326
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
73187,
17134,
2458,
48302,
44869,
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,
17134,
2458,
48302,
4486... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_etag_parse_success() {
// Expected success
assert_eq!(
"\"foobar\"".parse::<EntityTag>().unwrap(),
EntityTag::strong("foobar".to_owned())
);
assert_eq!(
"\"\"".parse::<EntityTag>().unwrap(),
EntityTag::strong("".to_owned())
);
assert_eq!(
"W/\"weaktag\"".parse::<EntityTag>().unwrap(),
EntityTag::weak("weaktag".to_owned())
);
assert_eq!(
"W/\"\x65\x62\"".parse::<EntityTag>().unwrap(),
EntityTag::weak("\x65\x62".to_owned())
);
assert_eq!(
"W/\"\"".parse::<EntityTag>().unwrap(),
EntityTag::weak("".to_owned())
);
} | rust_cleaned_test_functions.jsonl/21995 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 415
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45668,
351,
21039,
18632,
368,
341,
286,
442,
31021,
2393,
198,
286,
2060,
10714,
33673,
310,
15898,
50267,
2105,
3263,
6400,
27638,
3030,
5668,
10483,
15454,
3148,
310,
10390,
5668,
486,
4519,
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_bootstrap_jsonprc_and_api_configured_same_port() {
let runtime = tokio::runtime::Runtime::new().unwrap();
let context = runtime.block_on(new_test_context_async());
let mut cfg = NodeConfig::default();
cfg.randomize_ports();
// same port and host
cfg.api.address = cfg.json_rpc.address;
let ret = bootstrap(
&cfg,
ChainId::test(),
context.db.clone(),
context.mempool.ac_client.clone(),
);
assert!(ret.is_ok());
assert_web_server(cfg.api.address.port());
} | rust_cleaned_test_functions.jsonl/660 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 295
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
88424,
9455,
649,
66,
8378,
11697,
5332,
3073,
33574,
8716,
368,
341,
286,
1077,
15592,
284,
9628,
815,
486,
22255,
486,
15123,
486,
931,
1005,
15454,
543,
286,
1077,
2266,
284,
15592,
15697,
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 |
#[test]
fn test_expression_call() {
let f = name("f");
let a = name("a");
let b = name("b");
let call = |args: Vec<&IExpr>| {
Expression::call(f.clone(), &args.clone_all())
};
assert_parse_expr("f()", call(vec![]));
assert_parse_expr("f(a)", call(vec![&a]));
assert_parse_expr("f(a,b)", call(vec![&a, &b]))
} | rust_cleaned_test_functions.jsonl/59500 | {
"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,
28068,
13429,
368,
341,
220,
1077,
282,
284,
829,
445,
69,
797,
220,
1077,
264,
284,
829,
445,
64,
797,
220,
1077,
293,
284,
829,
445,
65,
3071,
220,
1077,
1618,
284,
760,
2116,
25,
11312,
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_add_assign() {
// += behaves differently on different types
assert::pass(
r#"
x = 1
x += 8
assert_eq(x, 9)"#,
);
assert::pass(
r#"
orig = [1, 2]
x = orig
x += [3]
assert_eq(x, [1, 2, 3])
assert_eq(orig, [1, 2, 3])
"#,
);
assert::pass(
r#"
orig = (1, 2)
x = orig
x += (3,)
assert_eq(x, (1, 2, 3))
assert_eq(orig, (1, 2))
"#,
);
assert::fail(
r#"
x = {1: 2}
x += {3: 4}
"#,
"not supported",
);
assert::pass(
r#"
x = [1, 2]
x[0] += 5
assert_eq(x, [6, 2])
"#,
);
assert::pass(
r#"
x = {1: 2}
x[1] += 5
assert_eq(x, {1: 7})
"#,
);
assert::fail(
r#"
def foo():
xs = [1, 2]
for x in xs:
xs += [1]
break
foo()
"#,
"mutate an iterable",
);
assert::fail(
r#"
xs = (1, 2)
xs[1] += 1
"#,
"Immutable",
);
} | rust_cleaned_test_functions.jsonl/92432 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 538
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2891,
20688,
368,
341,
262,
442,
1421,
73057,
21303,
389,
2155,
4494,
198,
262,
2060,
486,
6385,
1006,
286,
435,
2,
698,
87,
284,
220,
16,
198,
87,
1421,
220,
23,
198,
2207,
10714,
2075,
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_closure_deserialize01() {
let closure_str = r#"{"c":1,"p":0,"s":{"data":{"playbook":{"Str":"tests/test1/say_hi.yml"}}}}"#;
assert_eq!(serde_json::from_str::<Closure>(closure_str).unwrap(), Closure {
container: 1,
step_ptr: 0,
ctx_states: Context::new().set("playbook", CtxObj::Str(String::from("tests/test1/say_hi.yml")))
});
} | rust_cleaned_test_functions.jsonl/118494 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 178
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
72823,
15768,
9050,
15,
16,
368,
341,
262,
1077,
21955,
2895,
284,
435,
55543,
4913,
66,
788,
16,
1335,
79,
788,
15,
1335,
82,
22317,
691,
22317,
1363,
2190,
22317,
2580,
3252,
23841,
12697,
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_signature_fails_if_contents_changed() {
let mut msg = create_msg_node_a();
msg.scp_msg.slot_index = 4;
match msg.verify_signature() {
Ok(_) => panic!("Signature verification should fail"),
Err(ConsensusMsgError::SignatureError(_)) => {}
Err(e) => panic!("Sigature failed with unexpected error {:?}", e),
}
} | rust_cleaned_test_functions.jsonl/75123 | {
"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,
39859,
761,
6209,
11119,
16682,
25213,
368,
341,
286,
1077,
5206,
3750,
284,
1855,
6483,
5084,
4306,
543,
286,
3750,
514,
4672,
6483,
69643,
3560,
284,
220,
19,
280,
286,
2432,
3750,
27520,
39859,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ansi_codepoints() {
for byte in 0..128 {
match byte {
b'\n' | b'\r' | b'\t' => assert_invalid_byte(&(byte as char).to_string()),
b'\'' | b'\\' => { /* Ignore character close and backslash */ }
_ => assert_valid_byte(&(byte as char).to_string()),
}
}
for byte in 128..=255u8 {
assert_invalid_byte(&(byte as char).to_string());
}
} | rust_cleaned_test_functions.jsonl/50398 | {
"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,
62,
52067,
4136,
7706,
368,
341,
286,
369,
4922,
304,
220,
15,
496,
16,
17,
23,
341,
310,
2432,
4922,
341,
394,
293,
15777,
77,
6,
760,
293,
15777,
81,
6,
760,
293,
15777,
83,
6,
589,
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... | 4 |
#[test]
fn test_literal() {
let map = HashURIDMapper::new();
let urids: TestURIDs = TestURIDs::from_map(&map).unwrap();
let mut raw_space = AlignedVec::<AtomHeader>::new_with_capacity(64);
let raw_space = raw_space.as_space_mut();
// writing
{
let mut space = SpaceCursor::new(raw_space.as_bytes_mut());
let mut writer = space
.write_atom(urids.atom.literal)
.unwrap()
.write_info(LiteralInfo::Language(urids.german.into_general()))
.unwrap();
writer.append(SAMPLE0).unwrap();
writer.append(SAMPLE1).unwrap();
}
// verifying
{
let mut reader = raw_space.read();
let literal: &sys::LV2_Atom_Literal = unsafe { reader.next_value() }.unwrap();
assert_eq!(literal.atom.type_, urids.atom.literal.get());
assert_eq!(
literal.atom.size as usize,
size_of::<sys::LV2_Atom_Literal_Body>()
+ size_of_val(SAMPLE0)
+ size_of_val(SAMPLE1)
+ 1
);
assert_eq!(literal.body.lang, urids.german.get());
assert_eq!(literal.body.datatype, 0);
let size = literal.atom.size as usize - size_of::<sys::LV2_Atom_Literal_Body>();
let string = CStr::from_bytes_with_nul(reader.next_bytes(size).unwrap())
.unwrap()
.to_str()
.unwrap();
assert_eq!(SAMPLE0.to_owned() + SAMPLE1, string);
}
// reading
{
let (info, text) = unsafe {
raw_space
.read()
.next_atom()
.unwrap()
.read(urids.atom.literal)
}
.unwrap();
assert_eq!(info, LiteralInfo::Language(urids.german.into_general()));
assert_eq!(text, SAMPLE0.to_owned() + SAMPLE1);
}
} | rust_cleaned_test_functions.jsonl/54420 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1162
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34100,
368,
341,
286,
1077,
2415,
284,
6531,
1511,
915,
10989,
486,
931,
543,
286,
1077,
4335,
3365,
25,
3393,
1511,
30466,
284,
3393,
1511,
30466,
486,
1499,
5376,
2099,
2186,
568,
15454,
1428,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_confirmed_blocks() {
let bob_pubkey = Pubkey::new_rand();
let roots = vec![0, 1, 3, 4, 8];
let RpcHandler {
io,
meta,
block_commitment_cache,
..
} = start_rpc_handler_with_tx_and_blockstore(&bob_pubkey, roots.clone(), 0);
block_commitment_cache
.write()
.unwrap()
.set_largest_confirmed_root(8);
let req = r#"{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[0]}"#;
let res = io.handle_request_sync(&req, meta.clone());
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, roots[1..].to_vec());
let req = r#"{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[2]}"#;
let res = io.handle_request_sync(&req, meta.clone());
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, vec![3, 4, 8]);
let req = r#"{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[0,4]}"#;
let res = io.handle_request_sync(&req, meta.clone());
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, vec![1, 3, 4]);
let req = r#"{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[0,7]}"#;
let res = io.handle_request_sync(&req, meta.clone());
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, vec![1, 3, 4]);
let req = r#"{"jsonrpc":"2.0","id":1,"method":"getConfirmedBlocks","params":[9,11]}"#;
let res = io.handle_request_sync(&req, meta);
let result: Value = serde_json::from_str(&res.expect("actual response"))
.expect("actual response deserialization");
let confirmed_blocks: Vec<Slot> = serde_json::from_value(result["result"].clone()).unwrap();
assert_eq!(confirmed_blocks, Vec::<Slot>::new());
} | rust_cleaned_test_functions.jsonl/14455 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1163
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
16059,
8434,
25201,
368,
341,
286,
1077,
35192,
34014,
792,
284,
22611,
792,
486,
931,
33864,
543,
286,
1077,
19703,
284,
7486,
20703,
15,
11,
220,
16,
11,
220,
18,
11,
220,
19,
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_applied_lock_collector() {
let mut cluster = new_server_cluster(0, 3);
cluster.pd_client.disable_default_operator();
cluster.run();
// Create all stores' clients.
let env = Arc::new(Environment::new(1));
let mut clients = HashMap::default();
for node_id in cluster.get_node_ids() {
let channel =
ChannelBuilder::new(Arc::clone(&env)).connect(&cluster.sim.rl().get_addr(node_id));
let client = TikvClient::new(channel);
clients.insert(node_id, client);
}
// Create the ctx of the first region.
let region = cluster.get_region(b"");
let region_id = region.get_id();
let leader_peer = cluster.leader_of_region(region_id).unwrap();
let leader_store_id = leader_peer.get_store_id();
let leader_client = clients.get(&leader_store_id).unwrap();
let mut ctx = Context::default();
ctx.set_region_id(region_id);
ctx.set_peer(leader_peer);
ctx.set_region_epoch(cluster.get_region_epoch(region_id));
// It's used to make sure all stores applies all logs.
let wait_for_apply = |cluster: &mut Cluster<_>, region: &metapb::Region| {
let cluster = &mut *cluster;
region.get_peers().iter().for_each(|p| {
let mut retry_times = 1;
loop {
let resp =
async_read_on_peer(cluster, p.clone(), region.clone(), b"key", true, true)
.recv()
.unwrap();
if !resp.get_header().has_error() {
return;
}
if retry_times >= 50 {
panic!("failed to read on {:?}: {:?}", p, resp);
}
retry_times += 1;
sleep_ms(20);
}
});
};
let check_lock = |lock: &LockInfo, k: &[u8], pk: &[u8], ts| {
assert_eq!(lock.get_key(), k);
assert_eq!(lock.get_primary_lock(), pk);
assert_eq!(lock.get_lock_version(), ts);
};
// Register lock observer at safe point 10000.
let mut safe_point = 10000;
clients.iter().for_each(|(_, c)| {
// Should report error when checking non-existent observer.
assert!(!check_lock_observer(c, safe_point).get_error().is_empty());
must_register_lock_observer(c, safe_point);
assert!(must_check_lock_observer(c, safe_point, true).is_empty());
});
// Lock observer should only collect values in lock CF.
let key = b"key0";
must_kv_prewrite(
leader_client,
ctx.clone(),
vec![new_mutation(Op::Put, key, &b"v".repeat(1024))],
key.to_vec(),
1,
);
must_kv_commit(leader_client, ctx.clone(), vec![key.to_vec()], 1, 2, 2);
wait_for_apply(&mut cluster, ®ion);
clients.iter().for_each(|(_, c)| {
let locks = must_check_lock_observer(c, safe_point, true);
assert_eq!(locks.len(), 1);
check_lock(&locks[0], key, key, 1);
});
// Lock observer shouldn't collect locks after the safe point.
must_kv_prewrite(
leader_client,
ctx.clone(),
vec![new_mutation(Op::Put, key, b"v")],
key.to_vec(),
safe_point + 1,
);
wait_for_apply(&mut cluster, ®ion);
clients.iter().for_each(|(_, c)| {
let locks = must_check_lock_observer(c, safe_point, true);
assert_eq!(locks.len(), 1);
check_lock(&locks[0], key, key, 1);
});
// Write 999 locks whose timestamp is less than the safe point.
let mutations = (1..1000)
.map(|i| new_mutation(Op::Put, format!("key{}", i).as_bytes(), b"v"))
.collect();
must_kv_prewrite(leader_client, ctx.clone(), mutations, b"key1".to_vec(), 10);
wait_for_apply(&mut cluster, ®ion);
clients.iter().for_each(|(_, c)| {
let locks = must_check_lock_observer(c, safe_point, true);
// Plus the first lock.
assert_eq!(locks.len(), 1000);
});
// Add a new store and register lock observer.
let store_id = cluster.add_new_engine();
let channel =
ChannelBuilder::new(Arc::clone(&env)).connect(&cluster.sim.rl().get_addr(store_id));
let client = TikvClient::new(channel);
must_register_lock_observer(&client, safe_point);
let peer = new_peer(store_id, store_id);
cluster.pd_client.must_add_peer(region_id, peer.clone());
cluster.pd_client.must_none_pending_peer(peer);
wait_for_apply(&mut cluster, ®ion);
let locks = must_check_lock_observer(&client, safe_point, true);
assert_eq!(locks.len(), 999);
// Should be dirty when collects too many locks.
let mutations = (1000..1100)
.map(|i| new_mutation(Op::Put, format!("key{}", i).as_bytes(), b"v"))
.collect();
must_kv_prewrite(
leader_client,
ctx.clone(),
mutations,
b"key1000".to_vec(),
100,
);
wait_for_apply(&mut cluster, ®ion);
clients.insert(store_id, client);
clients.iter().for_each(|(_, c)| {
let resp = check_lock_observer(c, safe_point);
assert!(resp.get_error().is_empty(), "{:?}", resp.get_error());
assert!(!resp.get_is_clean());
// MAX_COLLECT_SIZE is 1024.
assert_eq!(resp.get_locks().len(), 1024);
});
clients.iter().for_each(|(_, c)| {
must_register_lock_observer(c, safe_point);
let resp = check_lock_observer(c, safe_point);
assert!(resp.get_error().is_empty(), "{:?}", resp.get_error());
assert!(!resp.get_is_clean());
// MAX_COLLECT_SIZE is 1024.
assert_eq!(resp.get_locks().len(), 1024);
});
safe_point += 1;
clients.iter().for_each(|(_, c)| {
must_register_lock_observer(c, safe_point);
assert!(must_check_lock_observer(c, safe_point, true).is_empty());
// Can't register observer with smaller max_ts.
assert!(
!register_lock_observer(c, safe_point - 1)
.get_error()
.is_empty()
);
assert!(must_check_lock_observer(c, safe_point, true).is_empty());
});
let leader_client = clients.get(&leader_store_id).unwrap();
must_kv_prewrite(
leader_client,
ctx,
vec![new_mutation(Op::Put, b"key1100", b"v")],
b"key1100".to_vec(),
safe_point,
);
wait_for_apply(&mut cluster, ®ion);
clients.iter().for_each(|(_, c)| {
// Should collect locks according to the new max ts.
let locks = must_check_lock_observer(c, safe_point, true);
assert_eq!(locks.len(), 1, "{:?}", locks);
// Shouldn't remove it with a wrong max ts.
assert!(
!remove_lock_observer(c, safe_point - 1)
.get_error()
.is_empty()
);
let locks = must_check_lock_observer(c, safe_point, true);
assert_eq!(locks.len(), 1, "{:?}", locks);
// Remove lock observers.
must_remove_lock_observer(c, safe_point);
assert!(!check_lock_observer(c, safe_point).get_error().is_empty());
});
} | rust_cleaned_test_functions.jsonl/36405 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 3268
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21093,
3440,
9818,
10211,
27669,
368,
341,
262,
1077,
5206,
10652,
284,
501,
12015,
28441,
7,
15,
11,
220,
18,
317,
262,
10652,
556,
67,
8179,
42628,
9993,
40594,
543,
262,
10652,
7634,
1428,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 4 |
#[test]
fn test_must_fails_time_stamp() {
let pp = PubParam::default();
let msg = b"message to sign";
let (_pk, mut sk, _pop) =
KeyPair::keygen(b"this is a very very long seed for testing", &pp).unwrap();
let mut sk2 = sk.clone();
// sign for an invalid time stamp
let res = Signature::sign_present(&mut sk, 2, &pp, msg);
res.expect_err(pixel_err::ERR_TIME_STAMP);
assert!(sk2.update(&pp, 10, b"").is_ok());
// sign for present
let res = Signature::sign_present(&mut sk2, 0, &pp, msg);
res.expect_err(pixel_err::ERR_TIME_STAMP);
let res = Signature::sign_present(&mut sk2, 9, &pp, msg);
res.expect_err(pixel_err::ERR_TIME_STAMP);
let res = Signature::sign_present(&mut sk2, 11, &pp, msg);
res.expect_err(pixel_err::ERR_TIME_STAMP);
// sign for present and future
let res = Signature::sign(&mut sk2, 0, &pp, msg, b"");
res.expect_err(pixel_err::ERR_TIME_STAMP);
let res = Signature::sign(&mut sk2, 9, &pp, msg, b"");
res.expect_err(pixel_err::ERR_TIME_STAMP);
let res = Signature::sign(&mut sk2, 10, &pp, msg, b"");
assert!(res.is_ok());
// update sk2 to an invalid time stamp
let res = sk2.update(&pp, 0, b"");
res.expect_err(pixel_err::ERR_TIME_STAMP);
let res = sk2.update(&pp, 9, b"");
res.expect_err(pixel_err::ERR_TIME_STAMP);
let res = sk2.update(&pp, 10, b"");
res.expect_err(pixel_err::ERR_TIME_STAMP);
} | rust_cleaned_test_functions.jsonl/51403 | {
"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,
717,
590,
761,
6209,
3009,
52978,
368,
341,
262,
1077,
11823,
284,
22611,
2001,
486,
2258,
1428,
262,
1077,
3750,
284,
293,
1,
1994,
311,
1841,
3302,
262,
1077,
5453,
20819,
11,
5206,
1901,
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_ptr_subtraction() {
unsafe {
let xs = vec![0,1,2,3,4,5,6,7,8,9];
let mut idx = 9;
let ptr = xs.as_ptr();
while idx >= 0 {
assert_eq!(*(ptr.offset(idx as isize)), idx as isize);
idx = idx - 1;
}
let mut xs_mut = xs;
let m_start = xs_mut.as_mut_ptr();
let mut m_ptr = m_start.offset(9);
while m_ptr >= m_start {
*m_ptr += *m_ptr;
m_ptr = m_ptr.offset(-1);
}
assert_eq!(xs_mut, [0,2,4,6,8,10,12,14,16,18]);
}
} | rust_cleaned_test_functions.jsonl/5895 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 353
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4348,
5228,
26425,
368,
341,
262,
19860,
341,
286,
1077,
11943,
284,
7486,
20703,
15,
11,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11,
21,
11,
22,
11,
23,
11,
24,
935,
286,
1077,
5206,
7187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_vcx_schema_get_schema_id_succeeds() {
let _setup = SetupMocks::init();
let (_, schema_name, schema_version, data) = prepare_schema_data();
let schema_handle = vcx_schema_create_c_closure(&schema_name, &schema_version, &data).unwrap();
let cb = return_types_u32::Return_U32_STR::new().unwrap();
assert_eq!(vcx_schema_get_schema_id(cb.command_handle, schema_handle, Some(cb.get_callback())), error::SUCCESS.code_num);
let id = cb.receive(TimeoutUtils::some_short()).unwrap().unwrap();
assert_eq!(DEFAULT_SCHEMA_ID, &id);
} | rust_cleaned_test_functions.jsonl/118204 | {
"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,
2273,
25844,
25371,
3062,
25371,
842,
643,
29264,
82,
368,
341,
286,
1077,
716,
15188,
284,
18626,
72577,
486,
2327,
1428,
286,
1077,
39464,
10802,
1269,
11,
10802,
9438,
11,
821,
8,
284,
10549,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_txn_commit_record() {
let path = tempfile::Builder::new()
.prefix("_test_storage_mvcc_reader_get_txn_commit_record")
.tempdir()
.unwrap();
let path = path.path().to_str().unwrap();
let region = make_region(1, vec![], vec![]);
let db = open_db(path, true);
let mut engine = RegionEngine::new(&db, ®ion);
let (k, v) = (b"k", b"v");
let m = Mutation::Put((Key::from_raw(k), v.to_vec()));
engine.prewrite(m, k, 1);
engine.commit(k, 1, 10);
engine.rollback(k, 5);
engine.rollback(k, 20);
let m = Mutation::Put((Key::from_raw(k), v.to_vec()));
engine.prewrite(m, k, 25);
engine.commit(k, 25, 30);
let m = Mutation::Put((Key::from_raw(k), v.to_vec()));
engine.prewrite(m, k, 35);
engine.commit(k, 35, 40);
// Overlapped rollback on the commit record at 40.
engine.rollback(k, 40);
let m = Mutation::Put((Key::from_raw(k), v.to_vec()));
engine.acquire_pessimistic_lock(Key::from_raw(k), k, 45, 45);
engine.prewrite_pessimistic_lock(m, k, 45);
engine.commit(k, 45, 50);
let snap = RegionSnapshot::<RocksSnapshot>::from_raw(db.c().clone(), region);
let mut reader = MvccReader::new(snap, None, false);
// Let's assume `50_45 PUT` means a commit version with start ts is 45 and commit ts
// is 50.
let key = Key::from_raw(k);
let overlapped_write = reader
.get_txn_commit_record(&key, 55.into())
.unwrap()
.unwrap_none();
assert!(overlapped_write.is_none());
// When no such record is found but a record of another txn has a write record with
let overlapped_write = reader
.get_txn_commit_record(&key, 50.into())
.unwrap()
.unwrap_none()
.unwrap();
assert_eq!(overlapped_write.write.start_ts, 45.into());
assert_eq!(overlapped_write.write.write_type, WriteType::Put);
let (commit_ts, write_type) = reader
.get_txn_commit_record(&key, 45.into())
.unwrap()
.unwrap_single_record();
assert_eq!(commit_ts, 50.into());
assert_eq!(write_type, WriteType::Put);
let commit_ts = reader
.get_txn_commit_record(&key, 40.into())
.unwrap()
.unwrap_overlapped_rollback();
assert_eq!(commit_ts, 40.into());
let (commit_ts, write_type) = reader
.get_txn_commit_record(&key, 35.into())
.unwrap()
.unwrap_single_record();
assert_eq!(commit_ts, 40.into());
assert_eq!(write_type, WriteType::Put);
let (commit_ts, write_type) = reader
.get_txn_commit_record(&key, 25.into())
.unwrap()
.unwrap_single_record();
assert_eq!(commit_ts, 30.into());
assert_eq!(write_type, WriteType::Put);
let (commit_ts, write_type) = reader
.get_txn_commit_record(&key, 20.into())
.unwrap()
.unwrap_single_record();
assert_eq!(commit_ts, 20.into());
assert_eq!(write_type, WriteType::Rollback);
let (commit_ts, write_type) = reader
.get_txn_commit_record(&key, 1.into())
.unwrap()
.unwrap_single_record();
assert_eq!(commit_ts, 10.into());
assert_eq!(write_type, WriteType::Put);
let (commit_ts, write_type) = reader
.get_txn_commit_record(&key, 5.into())
.unwrap()
.unwrap_single_record();
assert_eq!(commit_ts, 5.into());
assert_eq!(write_type, WriteType::Rollback);
let seek_old = reader.statistics.write.seek;
let next_old = reader.statistics.write.next;
assert!(
!reader
.get_txn_commit_record(&key, 30.into())
.unwrap()
.exist()
);
let seek_new = reader.statistics.write.seek;
let next_new = reader.statistics.write.next;
assert_eq!(seek_new - seek_old, 1);
assert_eq!(next_new - next_old, 2);
} | rust_cleaned_test_functions.jsonl/125628 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2143
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
92299,
36346,
14192,
368,
341,
286,
1077,
1815,
284,
54819,
486,
3297,
486,
931,
741,
310,
659,
11849,
16975,
1944,
23310,
73187,
638,
22306,
3062,
92299,
36346,
14192,
1138,
310,
659,
3888,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_add_iface_success() {
let mut test_values = test_setup();
// Add an interface
let added_iface_fut = test_values.iface_manager.handle_added_iface(123);
pin_mut!(added_iface_fut);
assert_variant!(test_values.exec.run_until_stalled(&mut added_iface_fut), Poll::Pending);
// Verify that the service sees the query
let next_message = test_values.receiver.next();
pin_mut!(next_message);
assert_variant!(
test_values.exec.run_until_stalled(&mut next_message),
Poll::Ready(
Some(IfaceManagerRequest::AddIface(AddIfaceRequest{ iface_id: 123, responder }))
) => {
responder.send(()).expect("failed to respond while adding iface");
}
);
// Verify that the client side finishes
assert_variant!(
test_values.exec.run_until_stalled(&mut added_iface_fut),
Poll::Ready(Ok(()))
);
} | rust_cleaned_test_functions.jsonl/59186 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 475
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2891,
67666,
18632,
368,
341,
286,
1077,
5206,
1273,
9146,
284,
1273,
21363,
1428,
286,
442,
2691,
458,
3749,
198,
286,
1077,
3694,
67666,
761,
332,
284,
1273,
9146,
35431,
578,
12144,
10132,
3765... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_unique_signers() {
let alice = Keypair::new();
let bob = Keypair::new();
assert_eq!(
pubkeys(&unique_signers(vec![&alice, &bob, &alice])),
pubkeys(&[&alice, &bob])
);
} | rust_cleaned_test_functions.jsonl/5132 | {
"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,
21218,
11172,
388,
368,
341,
286,
1077,
70433,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
35192,
284,
6569,
1082,
1310,
486,
931,
543,
286,
2060,
10714,
33673,
310,
6675,
10563,
2099,
9587,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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() {
// One.
let one: OneOrSet<MockKeyU8> = OneOrSet::new_one(MockKeyU8(1));
assert!(one.contains(&1));
assert!(!one.contains(&2));
assert!(!one.contains(&3));
// Set.
let set: OneOrSet<MockKeyU8> = OneOrSet::new_set((1..=3).map(MockKeyU8).collect()).unwrap();
assert!(set.contains(&1));
assert!(set.contains(&2));
assert!(set.contains(&3));
assert!(!set.contains(&4));
} | rust_cleaned_test_functions.jsonl/5921 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 215
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
63598,
368,
341,
262,
442,
3776,
624,
262,
1077,
825,
25,
3776,
2195,
1649,
27,
11571,
1592,
52,
23,
29,
284,
3776,
2195,
1649,
486,
931,
11667,
66436,
1592,
52,
23,
7,
16,
1106,
262,
2060,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_body_chunked_implicit() {
let mut srv = TestServer::new(move || {
h1::H1Service::new(
App::new()
.wrap(Compress::new(ContentEncoding::Gzip))
.service(web::resource("/").route(web::get().to(move || {
Response::Ok().streaming(once(Ok::<_, Error>(Bytes::from_static(
STR.as_ref(),
))))
}))),
)
});
let mut response = srv
.block_on(
srv.get("/")
.no_decompress()
.header(ACCEPT_ENCODING, "gzip")
.send(),
)
.unwrap();
assert!(response.status().is_success());
assert_eq!(
response.headers().get(TRANSFER_ENCODING).unwrap(),
&b"chunked"[..]
);
// read response
let bytes = srv.block_on(response.body()).unwrap();
// decode
let mut e = GzDecoder::new(&bytes[..]);
let mut dec = Vec::new();
e.read_to_end(&mut dec).unwrap();
assert_eq!(Bytes::from(dec), Bytes::from_static(STR.as_ref()));
} | rust_cleaned_test_functions.jsonl/48224 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 589
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14114,
30539,
291,
62,
30940,
368,
341,
262,
1077,
5206,
43578,
284,
3393,
5475,
486,
931,
34081,
1369,
341,
286,
305,
16,
486,
39,
16,
1860,
486,
931,
1006,
310,
1845,
486,
931,
741,
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,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_Elf_from_hdr_bad_magic0() {
let slice = &ELF32_DYNAMIC_ELF_HDR_BAD_MAGIC0[0..];
let elf: Result<Elf<'_, LittleEndian, Elf32>, ElfError> =
Elf::try_from(slice);
assert!(elf.is_err());
assert_eq!(elf.err(), Some(ElfError::BadMagic));
} | rust_cleaned_test_functions.jsonl/119479 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 135
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2089,
11008,
5673,
28238,
34199,
54612,
15,
368,
341,
262,
1077,
15983,
284,
609,
2749,
37,
18,
17,
57356,
2089,
22609,
55765,
30666,
49194,
15,
58,
15,
496,
935,
262,
1077,
40745,
25,
5714,
27,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_aliased_class_template_partially_instantiated_in_header() -> Result<()> {
// instantiate all members.
let ir = ir_from_cc(
r#" #pragma clang lifetime_elision
template <typename T>
struct MyTemplate {
const T& GetValue() { return field; }
T field;
};
inline void my_instantiation() {
MyTemplate<int> t;
// Members of MyTemplate are not used/instantiated.
}
using MyAlias = MyTemplate<int>; "#,
)?;
assert_ir_matches!(
ir,
quote! {
Record {
rs_name: "__CcTemplateInst10MyTemplateIiE", ...
cc_name: "MyTemplate<int>", ...
fields: [Field { identifier: Some("field"), ... }], ...
}
}
);
assert_ir_matches!(ir, quote! { Func { name: "GetValue", ... } });
Ok(())
} | rust_cleaned_test_functions.jsonl/37176 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 488
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
62,
7956,
1475,
4790,
8693,
10495,
33475,
1243,
4706,
10029,
1243,
8757,
368,
1464,
5714,
71698,
341,
1066,
262,
442,
40902,
678,
3613,
624,
262,
1077,
6216,
284,
6216,
5673,
28955,
1006,
286,
435... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_auth_header() {
let header =
parse_auth_header(r#"X-Matrix origin=foo.com,key="key_id",sig="some_signature""#)
.unwrap();
assert_eq!(header.origin, "foo.com");
assert_eq!(header.key_id, "key_id");
assert_eq!(header.signature, "some_signature");
} | rust_cleaned_test_functions.jsonl/39733 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 173
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
14014,
8757,
368,
341,
286,
1077,
4247,
4035,
310,
4715,
14014,
8757,
2601,
55543,
55,
5251,
2555,
6238,
28,
7975,
905,
53624,
428,
792,
842,
497,
21339,
428,
14689,
39859,
3014,
2,
340,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_help() {
for help_flg in vec!["-h", "--help"] {
new_ucmd!()
.arg(&help_flg)
.succeeds()
.no_stderr()
.stdout_contains("USAGE:");
}
} | rust_cleaned_test_functions.jsonl/82217 | {
"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,
26926,
368,
341,
262,
369,
1492,
86258,
304,
7486,
0,
1183,
12,
71,
497,
14482,
8653,
1341,
341,
286,
501,
68887,
2277,
0,
741,
310,
659,
858,
2099,
8653,
86258,
340,
310,
659,
82,
29264,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 2 |
#[test]
fn test_case_1() {
let key = "d6a2df78c16c96a52d4fb01ea4ecf70e81ac001b08d6577bd91ce991c4c45c46";
let nonce = "bc84d5465fc9139bf17042ae7313181f";
let expected_output =
"66d1fd5e89a564b55ccf0c339455449c20dfbc9d17081c85fbb430a157777be9";
hchacha_test_runner(key, nonce, expected_output);
} | rust_cleaned_test_functions.jsonl/44663 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 224
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
19096,
62,
16,
368,
341,
310,
1077,
1376,
284,
330,
67,
21,
64,
17,
2940,
22,
23,
66,
16,
21,
66,
24,
21,
64,
20,
17,
67,
19,
10798,
15,
16,
12508,
19,
757,
69,
22,
15,
68,
23,
16,
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_constant_time_lt() {
for a in 0..=255 {
for b in 0..=255 {
let expected = if a < b { 0xff } else { 0 };
assert_eq!(constant_time_lt(a, b), expected);
}
}
} | rust_cleaned_test_functions.jsonl/75430 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 150
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34967,
3009,
39164,
368,
341,
286,
369,
264,
304,
220,
15,
496,
28,
17,
20,
20,
341,
310,
369,
293,
304,
220,
15,
496,
28,
17,
20,
20,
341,
394,
1077,
3601,
284,
421,
264,
366,
293,
314,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_destroy_uninitialized_peer_when_there_exists_old_peer() {
// 4 stores cluster.
let mut cluster = new_node_cluster(0, 4);
cluster.cfg.raft_store.pd_store_heartbeat_tick_interval = ReadableDuration::millis(10);
cluster.cfg.raft_store.hibernate_regions = false;
let pd_client = cluster.pd_client.clone();
// Disable default max peer count check.
pd_client.disable_default_operator();
let r1 = cluster.run_conf_change();
let (key, value) = (b"k1", b"v1");
cluster.must_put(key, value);
assert_eq!(cluster.get(key), Some(value.to_vec()));
pd_client.must_add_peer(r1, new_peer(2, 2));
pd_client.must_add_peer(r1, new_peer(3, 3));
let epoch = pd_client.get_region_epoch(r1);
// Conf version must change.
assert!(epoch.get_conf_ver() > 2);
cluster.must_transfer_leader(r1, new_peer(2, 2));
// Isolate node 1
cluster.add_send_filter(IsolationFilterFactory::new(1));
cluster.must_put(format!("k{}", 2).as_bytes(), b"v1");
// Remove 3 and add 4
pd_client.must_add_peer(r1, new_learner_peer(4, 4));
pd_client.must_add_peer(r1, new_peer(4, 4));
pd_client.must_remove_peer(r1, new_peer(3, 3));
cluster.must_put(format!("k{}", 3).as_bytes(), b"v1");
// Ensure 5 drops all snapshot
let (notify_tx, _notify_rx) = mpsc::channel();
cluster
.sim
.wl()
.add_recv_filter(3, Box::new(DropSnapshotFilter::new(notify_tx)));
// Add learner 5 on store 3
pd_client.must_add_peer(r1, new_learner_peer(3, 5));
cluster.must_put(format!("k{}", 4).as_bytes(), b"v1");
// Remove and destroy the uninitialized 5
let peer_5 = new_learner_peer(3, 5);
pd_client.must_remove_peer(r1, peer_5.clone());
cluster.must_gc_peer(r1, 3, peer_5);
let region = block_on(pd_client.get_region_by_id(r1)).unwrap();
must_region_cleared(&cluster.get_all_engines(3), ®ion.unwrap());
// Unisolate 1 and try wakeup 3
cluster.clear_send_filters();
cluster.sim.wl().clear_recv_filters(3);
cluster.partition(vec![1, 3], vec![2, 4]);
sleep_until_election_triggered(&cluster.cfg);
let region = block_on(pd_client.get_region_by_id(r1)).unwrap();
must_region_cleared(&cluster.get_all_engines(3), ®ion.unwrap());
} | rust_cleaned_test_functions.jsonl/39367 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1008
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18066,
4907,
36161,
45159,
47636,
5854,
485,
9766,
21108,
45159,
368,
341,
262,
442,
220,
19,
10533,
10652,
624,
262,
1077,
5206,
10652,
284,
501,
5084,
28441,
7,
15,
11,
220,
19,
317,
262,
1065... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_tag() {
assert_eq!(StreamTag::Message.as_byte(), 0u8);
assert_eq!(StreamTag::Push.as_byte(), 1u8);
assert_eq!(StreamTag::Rekey.as_byte(), 2u8);
assert_eq!(StreamTag::Finish.as_byte(), 3u8);
assert!(StreamTag::try_from(4u8).is_err());
} | rust_cleaned_test_functions.jsonl/75560 | {
"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,
9372,
368,
341,
286,
2060,
10714,
10297,
3027,
5668,
486,
2052,
5357,
19737,
1507,
220,
15,
84,
23,
317,
286,
2060,
10714,
10297,
3027,
5668,
486,
16644,
5357,
19737,
1507,
220,
16,
84,
23,
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_min() {
let mut min = MinFunction::new(&DataType::Float64);
assert_eq!(DataType::Float64, min.return_type());
let values: Vec<f64> = vec![12.0, 22.0, 32.0, 6.0, 58.1];
min.execute(&vec![Value::Column(Rc::new(Array::from(values)))])
.unwrap();
let result = min.finish().unwrap();
match result {
Value::Scalar(ref v) => assert_eq!(v.get_f64().unwrap(), 6.0),
_ => panic!(),
}
} | rust_cleaned_test_functions.jsonl/124533 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 254
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7260,
368,
341,
286,
1077,
5206,
1308,
284,
3386,
5152,
486,
931,
2099,
22653,
486,
5442,
21,
19,
317,
286,
2060,
10714,
10297,
22653,
486,
5442,
21,
19,
11,
1308,
21458,
1819,
1423,
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_parses_and_encodes_complex() {
let js = "[null,true,1,[\"a\"],{\"b\":{\"c\":[[9.9],false]}},-1,1.0000001]";
let var = Variable::from_json(js).unwrap();
assert_eq!(js, var.to_string());
} | rust_cleaned_test_functions.jsonl/108391 | {
"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,
77113,
288,
8378,
13781,
2539,
41522,
368,
341,
286,
1077,
6994,
284,
10545,
2921,
21347,
11,
16,
17259,
2105,
64,
2105,
1125,
64238,
65,
92729,
66,
59,
8899,
58,
24,
13,
24,
1125,
3849,
13989,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_books_in_shops() -> Result<()> {
let sql = SqlBuilder::select_from("books AS b")
.field("b.title")
.field("s.total")
.left_outer()
.join("shops AS s")
.on("b.id = s.book")
.sql()?;
assert_eq!(
&sql,
"SELECT b.title, s.total FROM books AS b LEFT OUTER JOIN shops AS s ON b.id = s.book;"
);
let sql = SqlBuilder::select_from("books AS b")
.field("b.title")
.field("s.total")
.left_outer()
.join("shops AS s")
.on_eq("b.id", "s.book")
.sql()?;
assert_eq!(
&sql,
"SELECT b.title, s.total FROM books AS b LEFT OUTER JOIN shops AS s ON b.id = s.book;"
);
Ok(())
} | rust_cleaned_test_functions.jsonl/12608 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 484
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3180,
73084,
1243,
3712,
3721,
368,
1464,
5714,
71698,
341,
286,
1077,
5704,
284,
7224,
3297,
486,
1742,
5673,
445,
12110,
5752,
293,
1138,
310,
659,
2566,
445,
65,
6067,
1138,
310,
659,
2566,
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... | 3 |
#[test]
fn test_single_big_args() {
const FILE: &'static str = "single_big_args.txt";
const EXPECTED_FILE: &'static str = "single_big_args_expected.txt";
const LINES: usize = 1_000_000;
const N_ARG: usize = 100_000;
let (at, mut ucmd) = at_and_ucmd!();
let mut big_input = at.make_file(FILE);
for i in 0..LINES {
write!(&mut big_input, "Line {}\n", i).expect("Could not write to FILE");
}
big_input.flush().expect("Could not flush FILE");
let mut big_expected = at.make_file(EXPECTED_FILE);
for i in (LINES - N_ARG)..LINES {
write!(&mut big_expected, "Line {}\n", i).expect("Could not write to EXPECTED_FILE");
}
big_expected.flush().expect("Could not flush EXPECTED_FILE");
ucmd.arg(FILE)
.arg("-n")
.arg(format!("{}", N_ARG))
.run()
.stdout_is(at.read(EXPECTED_FILE));
} | rust_cleaned_test_functions.jsonl/31126 | {
"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,
19487,
36386,
8384,
368,
341,
262,
733,
11837,
25,
30136,
1978,
607,
284,
330,
15338,
36386,
8384,
3909,
876,
262,
733,
8921,
1479,
8087,
25,
30136,
1978,
607,
284,
330,
15338,
36386,
8384,
32190,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_lambda() {
let lambda = Lambda::new("cat", Var::new("cat"));
let query = Query::from(lambda);
let serialized = serde_json::to_value(&query).unwrap();
let expected = json!({
"lambda": "cat",
"expr": {"var": "cat"},
});
assert_eq!(expected, serialized);
} | rust_cleaned_test_functions.jsonl/49625 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 170
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
51884,
368,
341,
286,
1077,
12459,
284,
44521,
486,
931,
445,
4616,
497,
8735,
486,
931,
445,
4616,
4010,
286,
1077,
3239,
284,
11361,
486,
1499,
18205,
317,
286,
1077,
32916,
284,
61570,
9455,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_aux() {
let backend: Backend<test_client::runtime::Block> = Backend::new_test(0, 0);
assert!(backend.get_aux(b"test").unwrap().is_none());
backend.insert_aux(&[(&b"test"[..], &b"hello"[..])], &[]).unwrap();
assert_eq!(b"hello", &backend.get_aux(b"test").unwrap().unwrap()[..]);
backend.insert_aux(&[], &[&b"test"[..]]).unwrap();
assert!(backend.get_aux(b"test").unwrap().is_none());
} | rust_cleaned_test_functions.jsonl/94586 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 187
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
30468,
368,
341,
197,
10217,
19163,
25,
55260,
27,
1944,
8179,
486,
22255,
486,
4713,
29,
284,
55260,
486,
931,
4452,
7,
15,
11,
220,
15,
317,
197,
6948,
10297,
20942,
670,
30468,
1883,
1,
194... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_solid_field_ws_invert() {
let mut cmd = assert_cmd::Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
cmd.args(&["-s", "-f", "1-3,6", "--", "awk", "{print $0*2}"])
.write_stdin(" 1 \t 2 \t\t\t3 4\t5\n")
.assert()
.stdout("0 2 \t 4 \t\t\t3 4\t10\n");
} | rust_cleaned_test_functions.jsonl/7941 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 204
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
643,
5192,
5013,
50211,
1243,
1621,
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,
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_frame_vars_null_preserved() {
let json = r#"{
"vars": {
"despacito": null
}
}"#;
let frame = Annotated::new(Frame {
vars: Annotated::new({
let mut vars = Object::new();
vars.insert("despacito".to_string(), Annotated::empty());
vars.into()
}),
..Default::default()
});
assert_eq_dbg!(Annotated::from_json(json).unwrap(), frame);
assert_eq_str!(json, frame.to_json_pretty().unwrap());
} | rust_cleaned_test_functions.jsonl/14043 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 242
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8929,
11168,
15162,
32116,
2771,
368,
341,
262,
1077,
2951,
284,
435,
55543,
515,
220,
330,
15380,
788,
341,
262,
330,
5799,
44951,
6357,
788,
845,
198,
220,
456,
9863,
2,
280,
262,
1077,
4034,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_multipeek() {
let tokens = vec![
Token::ParenOpen,
Token::Semi,
Token::Dollar,
Token::ParenClose,
];
let mut tok_iter = TokenIter::new(tokens.clone().into_iter());
{
let mut multipeek = tok_iter.multipeek();
let mut expected_peeked = tokens.iter();
while let Some(t) = multipeek.peek_next() {
assert_eq!(expected_peeked.next(), Some(t));
}
// Exhausted the expected stream
assert_eq!(expected_peeked.next(), None);
}
// Original iterator still yields the expected values
assert_eq!(tokens, tok_iter.collect::<Vec<_>>());
} | rust_cleaned_test_functions.jsonl/39731 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 384
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
26290,
3444,
1225,
368,
341,
286,
1077,
11211,
284,
7486,
90515,
310,
9660,
486,
83997,
5002,
345,
310,
9660,
486,
50,
21780,
345,
310,
9660,
486,
35,
21295,
345,
310,
9660,
486,
83997,
7925,
34... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_simpleslicedeserializer_simpledeserializer_read_fail() {
let s: [u8; 8] = [0, 3, 0, 0, 0, 0, 0, 0];
let mut v = SimpleSliceDeserializer::new(&s[..2]);
assert!(matches!(v.read(3), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
let mut v = SimpleSliceDeserializer::new(&s[..0]);
assert!(matches!(v.read_u8(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
assert!(matches!(v.read_i8(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
let mut v = SimpleSliceDeserializer::new(&s[..1]);
assert!(matches!(v.read_u16(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
assert!(matches!(v.read_i16(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
let mut v = SimpleSliceDeserializer::new(&s[..3]);
assert!(matches!(v.read_u32(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
assert!(matches!(v.read_i32(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
assert!(matches!(v.read_f32(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
let mut v = SimpleSliceDeserializer::new(&s[..7]);
assert!(matches!(v.read_u64(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
assert!(matches!(v.read_i64(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
assert!(matches!(v.read_f64(), Err(ErrorKind::UnableToRead)));
assert_eq!(v.offset, 0);
assert_eq!(v.data_offset, 0);
let mut v = SimpleSliceDeserializer::new(&s[..4]);
assert!(matches!(v.read_byte_array(), Err(ErrorKind::UnableToRead)));
} | rust_cleaned_test_functions.jsonl/90006 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 897
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
643,
6664,
642,
415,
58526,
41939,
30015,
5799,
41939,
6443,
22121,
368,
341,
262,
1077,
274,
25,
508,
84,
23,
26,
220,
23,
60,
284,
508,
15,
11,
220,
18,
11,
220,
15,
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... | 1 |
#[test]
fn test_bit_set_symmetric_difference_with() {
//a should grow to include larger elements
let mut a = BitSet::new();
a.insert(0);
a.insert(1);
let mut b = BitSet::new();
b.insert(1);
b.insert(5);
let expected = BitSet::from_bit_vec(BitVec::from_bytes(&[0b10000100]));
a.symmetric_difference_with(&b);
assert_eq!(a, expected);
let mut a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b10100010]));
let b = BitSet::new();
let c = a.clone();
a.symmetric_difference_with(&b);
assert_eq!(a, c);
// Standard
let mut a = BitSet::from_bit_vec(BitVec::from_bytes(&[0b11100010]));
let mut b = BitSet::from_bit_vec(BitVec::from_bytes(&[0b01101010]));
let c = a.clone();
a.symmetric_difference_with(&b);
b.symmetric_difference_with(&c);
assert_eq!(a.len(), 2);
assert_eq!(b.len(), 2);
} | rust_cleaned_test_functions.jsonl/76235 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 497
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13996,
2602,
26825,
15903,
47525,
6615,
368,
341,
286,
442,
64,
1265,
3063,
311,
2924,
8131,
5424,
198,
286,
1077,
5206,
264,
284,
57227,
486,
931,
543,
286,
264,
7030,
7,
15,
317,
286,
264,
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_stop_logging() {
let mut runner = Runner::new();
let _query = runner.proxy.start_logging_forever(
"test",
&mut vec![&mut Metric::Temperature(Temperature {
sampling_interval_ms: 100,
statistics_args: None,
})]
.into_iter(),
false,
false,
);
runner.run_server_task_until_stalled();
// Check logger added to client with default values before first temperature poll.
assert_data_tree!(
runner.inspector,
root: {
MetricsLogger: {
test: {
TemperatureLogger: {
"elapsed time (ms)": std::i64::MIN,
"cpu": {
"data (°C)": f64::MIN,
},
"/dev/fake/gpu_temperature": {
"data (°C)": f64::MIN,
}
}
}
}
}
);
runner.cpu_temperature.set(35.0);
runner.gpu_temperature.set(45.0);
// Run a few logging tasks to populate Inspect node before we test `stop_logging`.
for _ in 0..10 {
assert_eq!(runner.iterate_logging_task(), true);
}
// Checked data populated to Inspect node.
assert_data_tree!(
runner.inspector,
root: {
MetricsLogger: {
test: {
TemperatureLogger: {
"elapsed time (ms)": 1_000i64,
"cpu": {
"data (°C)": 35.0,
},
"/dev/fake/gpu_temperature": {
"data (°C)": 45.0,
}
}
}
}
}
);
let mut query = runner.proxy.stop_logging("test");
assert_matches!(runner.executor.run_until_stalled(&mut query), Poll::Ready(Ok(true)));
runner.run_server_task_until_stalled();
assert_eq!(runner.iterate_logging_task(), false);
// Check temperature logger removed in Inspect.
assert_data_tree!(
runner.inspector,
root: {
MetricsLogger: {}
}
);
} | rust_cleaned_test_functions.jsonl/66701 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1549
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
19039,
59982,
368,
341,
286,
1077,
5206,
22259,
284,
44946,
486,
931,
1428,
286,
1077,
716,
1631,
284,
22259,
41103,
4962,
59982,
35563,
423,
1006,
310,
330,
1944,
756,
310,
609,
6984,
7486,
20703... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_post_order() {
let graph = create_test_graph();
assert_eq!(graph.compute_post_order(1).unwrap(), vec![5, 3, 4, 6, 2, 1]);
assert_eq!(graph.compute_post_order(5).unwrap(), vec![3, 4, 6, 2, 5]);
} | rust_cleaned_test_functions.jsonl/1477 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 123
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6333,
7869,
368,
341,
286,
1077,
4771,
284,
1855,
4452,
14738,
1428,
286,
2060,
10714,
10297,
4439,
35347,
6333,
7869,
7,
16,
568,
15454,
1507,
7486,
20703,
20,
11,
220,
18,
11,
220,
19,
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_exp2() {
assert_eq!(32.0, 5.0f64.exp2());
assert_eq!(1.0, 0.0f64.exp2());
let inf: f64 = Float::infinity();
let neg_inf: f64 = Float::neg_infinity();
let nan: f64 = Float::nan();
assert_eq!(inf, inf.exp2());
assert_eq!(0.0, neg_inf.exp2());
assert!(nan.exp2().is_nan());
} | rust_cleaned_test_functions.jsonl/7448 | {
"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,
14214,
17,
368,
341,
286,
2060,
10714,
10297,
18,
17,
13,
15,
11,
220,
20,
13,
15,
69,
21,
19,
13754,
17,
1423,
286,
2060,
10714,
10297,
16,
13,
15,
11,
220,
15,
13,
15,
69,
21,
19,
1375... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_branches_output_contains() {
assert!(Git::branches_output_contains("test", "test"));
assert!(Git::branches_output_contains("* test", "test"));
assert!(!Git::branches_output_contains("* tests", "test"));
assert!(Git::branches_output_contains("test\ntwo", "two"));
assert!(Git::branches_output_contains("test\n* two", "two"));
assert!(!Git::branches_output_contains("test\n* twos", "two"));
} | rust_cleaned_test_functions.jsonl/90666 | {
"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,
28031,
288,
7645,
63598,
368,
341,
286,
2060,
10297,
46562,
486,
67839,
7645,
63598,
445,
1944,
497,
330,
1944,
4010,
286,
2060,
10297,
46562,
486,
67839,
7645,
63598,
29592,
1273,
497,
330,
1944,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_load_vim_style_example() {
assert_eq!(
KeyConfig::read_file("vim_style_key_config.ron".into())
.is_ok(),
true
);
} | rust_cleaned_test_functions.jsonl/103393 | {
"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,
12411,
2273,
318,
15117,
39304,
368,
341,
197,
6948,
10714,
33673,
298,
55242,
2648,
486,
878,
2458,
445,
41194,
15117,
3097,
5332,
1746,
263,
3263,
18122,
2398,
571,
197,
2079,
19817,
3148,
298,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_empty_variable_sized() {
let array = new_empty_array(&DataType::Utf8);
let a = array.as_any().downcast_ref::<StringArray>().unwrap();
assert_eq!(a.len(), 0);
assert_eq!(a.value_offsets()[0], 0i32);
} | rust_cleaned_test_functions.jsonl/7986 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 126
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15124,
14635,
643,
1506,
368,
341,
286,
1077,
1334,
284,
501,
15124,
3858,
2099,
22653,
486,
38980,
23,
317,
286,
1077,
264,
284,
1334,
5357,
37248,
1005,
2923,
3829,
7793,
27638,
703,
1857,
10483... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_rt_offset() {
let spec = "output a: Int8 @1Hz := 1\noutput b: Int8 @1Hz := a[-1s].defaults(to: 0)";
assert_eq!(0, num_type_errors(spec));
} | rust_cleaned_test_functions.jsonl/110704 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 94
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
40169,
6917,
368,
341,
286,
1077,
1398,
284,
330,
3006,
264,
25,
1333,
23,
569,
16,
11475,
1669,
220,
16,
1699,
3006,
293,
25,
1333,
23,
569,
16,
11475,
1669,
264,
7609,
16,
82,
936,
26756,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_decode_error() {
let token = "eyJ0eXAiOiUzI1NiJ9.eyJpc3MizZWEifQ.L0c0gTyOYbmUQ_LUCn2OLhFs";
// decode the payload to standard jwt::Claims
let result = Token::<Claims>::decode(token);
match result {
Ok(token) => println!("{:?}", token),
Err(err) => println!("{:?}", err)
}
} | rust_cleaned_test_functions.jsonl/133972 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 169
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15227,
4096,
368,
341,
262,
1077,
3950,
284,
330,
84609,
15,
68,
59450,
72,
81096,
52,
89,
40,
16,
56494,
41,
24,
13,
84609,
3992,
18,
44,
449,
57,
12457,
333,
48,
1214,
15,
66,
15,
70,
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... | 2 |
#[test]
fn test_cvtsi2ss() {
assert_emit!(0xf3, 0x0f, 0x2a, 0xc1; cvtsi2ss(XMM0, 0, RCX));
assert_emit!(0xf3, 0x41, 0x0f, 0x2a, 0xdf; cvtsi2ss(XMM3, 0, R15));
assert_emit!(0xf3, 0x44, 0x0f, 0x2a, 0xc4; cvtsi2ss(XMM8, 0, RSP));
assert_emit!(0xf3, 0x48, 0x0f, 0x2a, 0xc1; cvtsi2ss(XMM0, 1, RCX));
assert_emit!(0xf3, 0x49, 0x0f, 0x2a, 0xdf; cvtsi2ss(XMM3, 1, R15));
assert_emit!(0xf3, 0x4c, 0x0f, 0x2a, 0xc4; cvtsi2ss(XMM8, 1, RSP));
} | rust_cleaned_test_functions.jsonl/85498 | {
"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,
778,
368,
341,
286,
2060,
69082,
10297,
15,
5848,
18,
11,
220,
15,
87,
15,
69,
11,
220,
15,
87,
17,
64,
11,
220,
15,
8148,
16,
26,
5544,
2576,
72,
17,
778,
7644,
803... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_arguments_preprocessor_args() {
let args = stringvec!["-c", "foo.c", "-fabc", "-MF", "file", "-o", "foo.o", "-MQ", "abc"];
let ParsedArguments {
input,
language,
depfile: _,
outputs,
preprocessor_args,
msvc_show_includes,
common_args,
..
} = match _parse_arguments(&args) {
CompilerArguments::Ok(args) => args,
o @ _ => panic!("Got unexpected parse result: {:?}", o),
};
assert!(true, "Parsed ok");
assert_eq!(Some("foo.c"), input.to_str());
assert_eq!(Language::C, language);
assert_map_contains!(outputs, ("obj", PathBuf::from("foo.o")));
//TODO: fix assert_map_contains to assert no extra keys!
assert_eq!(1, outputs.len());
assert_eq!(ovec!["-MF", "file", "-MQ", "abc"], preprocessor_args);
assert_eq!(ovec!["-fabc"], common_args);
assert!(!msvc_show_includes);
} | rust_cleaned_test_functions.jsonl/15017 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 518
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
43433,
10442,
29474,
8384,
368,
341,
286,
1077,
2827,
284,
914,
4083,
0,
1183,
12,
66,
497,
330,
7975,
520,
497,
6523,
69,
13683,
497,
6523,
31607,
497,
330,
1192,
497,
6523,
78,
497,
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_get_blocks() {
let block_manager = BlockManager::new();
let a = create_block("A", NULL_BLOCK_IDENTIFIER, 0);
let b = create_block("B", "A", 1);
let c = create_block("C", "B", 2);
block_manager
.put(vec![a.clone(), b.clone(), c.clone()])
.unwrap();
let mut get_block_iter = block_manager.get(&["A", "C", "D"]);
assert_eq!(get_block_iter.next(), Some(Some(a.clone())));
assert_eq!(get_block_iter.next(), Some(Some(c.clone())));
assert_eq!(get_block_iter.next(), Some(None));
assert_eq!(get_block_iter.next(), None);
// Should only return the items that are found.
let mut get_block_with_unknowns = block_manager.get(&["A", "X", "C"]);
assert_eq!(get_block_with_unknowns.next(), Some(Some(a.clone())));
assert_eq!(get_block_with_unknowns.next(), Some(None));
assert_eq!(get_block_with_unknowns.next(), Some(Some(c.clone())));
assert_eq!(get_block_with_unknowns.next(), None);
} | rust_cleaned_test_functions.jsonl/10252 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 489
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
25201,
368,
341,
286,
1077,
2504,
12144,
284,
8362,
2043,
486,
931,
543,
286,
1077,
264,
284,
1855,
7113,
445,
32,
497,
1770,
18756,
49554,
11,
220,
15,
317,
286,
1077,
293,
284,
1855,
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_verify_account_changes_owner() {
let system_program_id = system_program::id();
let alice_program_id = solana_sdk::pubkey::new_rand();
let mallory_program_id = solana_sdk::pubkey::new_rand();
assert_eq!(
Change::new(&system_program_id, &system_program_id)
.owner(&alice_program_id)
.verify(),
Ok(()),
"system program should be able to change the account owner"
);
assert_eq!(
Change::new(&system_program_id, &system_program_id)
.owner(&alice_program_id)
.read_only()
.verify(),
Err(InstructionError::ModifiedProgramId),
"system program should not be able to change the account owner of a read-only account"
);
assert_eq!(
Change::new(&mallory_program_id, &system_program_id)
.owner(&alice_program_id)
.verify(),
Err(InstructionError::ModifiedProgramId),
"system program should not be able to change the account owner of a non-system account"
);
assert_eq!(
Change::new(&mallory_program_id, &mallory_program_id)
.owner(&alice_program_id)
.verify(),
Ok(()),
"mallory should be able to change the account owner, if she leaves clear data"
);
assert_eq!(
Change::new(&mallory_program_id, &mallory_program_id)
.owner(&alice_program_id)
.data(vec![42], vec![0])
.verify(),
Ok(()),
"mallory should be able to change the account owner, if she leaves clear data"
);
assert_eq!(
Change::new(&mallory_program_id, &mallory_program_id)
.owner(&alice_program_id)
.executable(true, true)
.data(vec![42], vec![0])
.verify(),
Err(InstructionError::ModifiedProgramId),
"mallory should not be able to change the account owner, if the account executable"
);
assert_eq!(
Change::new(&mallory_program_id, &mallory_program_id)
.owner(&alice_program_id)
.data(vec![42], vec![42])
.verify(),
Err(InstructionError::ModifiedProgramId),
"mallory should not be able to inject data into the alice program"
);
} | rust_cleaned_test_functions.jsonl/15692 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1285
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
35638,
13500,
47526,
29027,
368,
341,
286,
1077,
1849,
25096,
842,
284,
1849,
25096,
486,
307,
543,
286,
1077,
70433,
25096,
842,
284,
2048,
3362,
61783,
486,
9585,
792,
486,
931,
33864,
543,
286,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_match_option_vec() {
let a = Some(vec![1i, 2, 3, 4]);
match a {
Some(v) => assert_eq!(v, vec![1i, 2, 3, 4]),
None => panic!("unexpected None while matching on Some(vec![1, 2, 3, 4])")
}
} | rust_cleaned_test_functions.jsonl/107077 | {
"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,
10708,
9672,
13251,
368,
341,
262,
1077,
264,
284,
4329,
25592,
20703,
16,
72,
11,
220,
17,
11,
220,
18,
11,
220,
19,
2558,
262,
2432,
264,
341,
286,
4329,
3747,
8,
589,
2060,
10714,
10297,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_output_after_set() {
let _ = env_logger::init();
let p = TOMLParser::new();
let (mut p, _) = p.parse(r#"animal = "bear"
[[car.owners]]
Name = """Bob Jones"""
Age = 25
[[car.owners]]
Name = 'Jane Doe'
Age = 44
[car.interior.seats]
type = '''fabric'''
count = 5
[car]
model = "Civic"
"ωλèèℓƨ" = 4
"ƭôƥ ƨƥèèδ" = 124.56
"Date of Manufacture" = 2007-05-16T10:12:13.2324+04:00
drivers = ["Bob", "Jane", "John", "Michael", { disallowed = "Chris", banned="Sally"}]
properties = { color = "red", "plate number" = "ABC 345",
accident_dates = [2008-09-29, 2011-01-16, 2014-11-30T03:13:54]}
"#);
p.set_value("car.interior.seats.type", Value::basic_string("leather").unwrap());
p.set_value("car.interior.seats.type", Value::basic_string("vinyl").unwrap());
p.set_value("car.owners[0].Age", Value::float_from_str("19.5").unwrap());
p.set_value("car.owners[1].Name", Value::ml_basic_string("Steve Parker").unwrap());
p.set_value("car.drivers[4].banned", Value::datetime_from_int(2013, 9, 23, 17, 34, 2).unwrap());
p.set_value("car.properties.color", Value::int(19));
p.set_value("car.properties.accident_dates[2]", Value::float(3443.34));
p.set_value("car.drivers[1]", Value::ml_literal_string("Mark").unwrap());
p.set_value("car.properties", Value::InlineTable(Rc::new(
vec![("make".into(), Value::literal_string("Honda").unwrap()),
("transmission".into(), Value::bool(true))]
)));
p.set_value("car.drivers", Value::Array(Rc::new(
vec![Value::basic_string("Phil").unwrap(), Value::basic_string("Mary").unwrap()]
)));
p.set_value("car.properties", Value::InlineTable(Rc::new(
vec![("prop1".into(), Value::bool_from_str("TrUe").unwrap()),
("prop2".into(), Value::bool_from_str("FALSE").unwrap()),
("prop3".into(), Value::bool_from_str("truE").unwrap()),
("prop4".into(), Value::bool_from_str("false").unwrap())]
)));
p.set_value("car.drivers", Value::Array(Rc::new(
vec![Value::int(1), Value::int(2), Value::int(3), Value::int(4),
Value::int(5), Value::int(6), Value::int(7), Value::int(8)]
)));
p.set_value("car.model", Value::literal_string("Accord").unwrap());
p.set_value("animal", Value::ml_basic_string("shark").unwrap());
assert_eq!(r#"animal = """shark"""
[[car.owners]]
Name = """Bob Jones"""
Age = 19.5
[[car.owners]]
Name = """Steve Parker"""
Age = 44
[car.interior.seats]
type = "vinyl"
count = 5
[car]
model = 'Accord'
"ωλèèℓƨ" = 4
"ƭôƥ ƨƥèèδ" = 124.56
"Date of Manufacture" = 2007-05-16T10:12:13.2324+04:00
drivers = [1, 2, 3, 4, 5, 6, 7, 8]
properties = { prop1 = true, prop2 = false, prop3 = true, prop4 = false }
"#, format!("{}", p));
} | rust_cleaned_test_functions.jsonl/122797 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1210
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7645,
19844,
2602,
368,
341,
262,
1077,
716,
284,
6105,
27413,
486,
2327,
543,
262,
1077,
281,
284,
82465,
43,
6570,
486,
931,
543,
262,
1077,
320,
6984,
281,
11,
27439,
284,
281,
4632,
2601,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_min_max_nan() {
let xs = &[1.0, 2.0, f64::NAN, 3.0, 4.0];
let summary = Summary::new(xs);
assert_eq!(summary.min, 1.0);
assert_eq!(summary.max, 4.0);
} | rust_cleaned_test_functions.jsonl/45499 | {
"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,
7260,
6345,
73936,
368,
341,
286,
1077,
11943,
284,
44590,
16,
13,
15,
11,
220,
17,
13,
15,
11,
282,
21,
19,
486,
45,
1093,
11,
220,
18,
13,
15,
11,
220,
19,
13,
15,
935,
286,
1077,
1212... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.