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_json2_ct() {
let resp = Response::build(StatusCode::OK)
.header(CONTENT_TYPE, "text/json")
.json2(&vec!["v1", "v2", "v3"]);
let ct = resp.headers().get(CONTENT_TYPE).unwrap();
assert_eq!(ct, HeaderValue::from_static("text/json"));
assert_eq!(resp.body().get_ref(), b"[\"v1\",\"v2\",\"v3\"]");
} | rust_cleaned_test_functions.jsonl/18841 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 191
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9455,
17,
26134,
368,
341,
286,
1077,
9039,
284,
5949,
486,
5834,
7,
15872,
486,
3925,
340,
310,
659,
2708,
98747,
1825,
4189,
11,
330,
1318,
8931,
1138,
310,
659,
2236,
17,
2099,
4083,
0,
118... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_lower() {
let mut level = Level::rtl();
assert_eq!(level.number(), 1);
assert!(level.lower(1).is_ok());
assert_eq!(level.number(), 0);
assert!(level.lower(1).is_err()); // underflow!
assert!(level.lower(250).is_err()); // underflow!
assert_eq!(level.number(), 0);
} | rust_cleaned_test_functions.jsonl/31776 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 167
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
30425,
368,
341,
286,
1077,
5206,
2188,
284,
9395,
486,
48468,
543,
286,
2060,
10714,
10297,
3294,
14341,
1507,
220,
16,
317,
286,
2060,
10297,
3294,
18073,
7,
16,
568,
285,
19817,
1423,
286,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_parse_config() {
let f = File::open("testdata/sticker.conf").unwrap();
let config = Config::from_toml_read(f).unwrap();
assert_eq!(*BASIC_LABELER_CHECK, config);
} | rust_cleaned_test_functions.jsonl/77730 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 100
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
5332,
368,
341,
286,
1077,
282,
284,
2887,
486,
2508,
445,
92425,
14272,
5215,
13937,
1827,
15454,
543,
286,
1077,
2193,
284,
5532,
486,
1499,
528,
316,
75,
6443,
955,
568,
15454,
543,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_custom_ops_invert() {
let ops = vec![
Operator {
repr: "invert",
bin_op: None,
unary_op: Some(|a: f32| 1.0 / a),
},
Operator {
repr: "sqrt",
bin_op: None,
unary_op: Some(|a: f32| a.sqrt()),
},
];
let expr = parse("sqrt(invert(a))", &ops).unwrap();
assert_float_eq_f32(expr.eval(&[0.25]).unwrap(), 2.0);
} | rust_cleaned_test_functions.jsonl/66723 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 323
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15875,
21959,
1243,
1621,
368,
341,
286,
1077,
27132,
284,
7486,
90515,
310,
28498,
341,
394,
30636,
25,
330,
83729,
756,
394,
9544,
10287,
25,
2240,
345,
394,
75678,
10287,
25,
4329,
22428,
64,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_recv_timeout_dealyed() {
futures::executor::block_on(async move {
let (mut sender, mut receiver) = channel("data/recv-timeout-delayed").unwrap();
std::thread::spawn(move || {
futures::executor::block_on(async move {
Delay::new(Duration::from_secs(1)).await;
sender.try_send(b"123").unwrap();
});
});
assert_eq!(
&*receiver
.recv_timeout(Delay::new(Duration::from_secs(2)))
.await
.unwrap()
.unwrap(),
b"123"
);
});
} | rust_cleaned_test_functions.jsonl/95825 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 425
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
36118,
20537,
2259,
5774,
291,
368,
341,
286,
36823,
486,
80787,
486,
4574,
4470,
18285,
3271,
341,
310,
1077,
320,
6984,
4646,
11,
5206,
13964,
8,
284,
5496,
445,
691,
14,
33977,
7246,
411,
451... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_gaussian_viterbi_simple_example() {
let transition = array![[0.5, 0.5], [0.4, 0.6]];
let observation = vec![
Normal::new(0.0, 1.0).unwrap(),
Normal::new(2.0, 1.0).unwrap(),
];
let initial = array![0.5, 0.5];
let hmm = GaussianHMM::with_float(&transition, observation, &initial)
.expect("Dimensions should be consistent");
let (path, log_prob) = viterbi(
&hmm,
&vec![-0.1, 0.1, -0.2, 0.5, 0.8, 1.1, 1.2, 1.5, 0.5, 0.2],
);
let prob = Prob::from(log_prob);
let expected = vec![0, 0, 0, 0, 0, 1, 1, 1, 0, 0]
.iter()
.map(|i| State(*i))
.collect::<Vec<State>>();
assert_eq!(expected, path);
assert_relative_eq!(2.64e-8_f64, *prob, epsilon = 1e-9_f64);
} | rust_cleaned_test_functions.jsonl/13088 | {
"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,
1889,
46972,
2273,
2015,
8221,
30015,
39304,
368,
341,
286,
1077,
9142,
284,
1334,
0,
15505,
15,
13,
20,
11,
220,
15,
13,
20,
1125,
508,
15,
13,
19,
11,
220,
15,
13,
21,
13204,
286,
1077,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_insert_lines_error_cases()
{
let tmpdir = assert_memfs_setup!();
let dir = tmpdir.mash("dir");
let file = dir.mash("file");
// fail abs
assert_eq!(
file::insert_lines("", &["foo"], r"foo", 0).unwrap_err().to_string(),
PathError::Empty.to_string()
);
// parent doesn't exist
assert_eq!(
file::insert_lines(&file, &["foo"], r"foo", 0).unwrap_err().to_string(),
PathError::does_not_exist(&file).to_string()
);
// exists but is not a file
assert_mkdir_p!(&dir);
assert_eq!(
file::insert_lines(&dir, &["foo"], r"foo", 0).unwrap_err().to_string(),
PathError::is_not_file(&dir).to_string()
);
// file exists and regix is invalid
assert_write_all!(&file, "foo");
assert_eq!(
file::insert_lines(&file, &["foo"], r"[", 0).unwrap_err().to_string(),
FileError::FailedToExtractString.to_string()
);
// Offset out of range
assert_eq!(
file::insert_lines(&file, &["foo"], r"", -2).unwrap_err().to_string(),
FileError::InsertLocationNotFound.to_string()
);
assert_remove_all!(&tmpdir);
} | rust_cleaned_test_functions.jsonl/110967 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 642
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17678,
18323,
4096,
41427,
741,
262,
341,
286,
1077,
4174,
3741,
284,
2060,
12976,
3848,
21363,
0,
543,
286,
1077,
5419,
284,
4174,
3741,
744,
988,
445,
3741,
797,
286,
1077,
1034,
284,
5419,
74... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_store_flush_load_cached() {
let mut db = AccountsDb::new(Vec::new(), &ClusterType::Development);
db.caching_enabled = true;
let key = Pubkey::default();
let account0 = AccountSharedData::new(1, 0, &key);
let slot = 0;
db.store_cached(slot, &[(&key, &account0)]);
db.mark_slot_frozen(slot);
// the account
db.flush_accounts_cache(true, None);
let ancestors = vec![(slot, 1)].into_iter().collect();
assert_eq!(
db.load_without_fixed_root(&ancestors, &key),
Some((account0.clone(), slot))
);
// Add root then flush
db.add_root(slot);
db.flush_accounts_cache(true, None);
assert_eq!(
db.load_without_fixed_root(&Ancestors::default(), &key),
Some((account0, slot))
);
} | rust_cleaned_test_functions.jsonl/1411 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 436
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14809,
39213,
12411,
64369,
368,
341,
286,
1077,
5206,
2927,
284,
40655,
7994,
486,
931,
49923,
486,
931,
1507,
609,
28678,
929,
486,
39419,
317,
286,
2927,
520,
11829,
18220,
284,
830,
280,
286,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_safe_checkout_independently_modified_blob() -> BitResult<()> {
BitRepo::with_minimal_repo(|repo| {
let target = commit! {
foo < "new content"
};
modify!(repo: "foo" < "new content");
bit_checkout!(repo: &rev!(target)).unwrap_err().try_into_checkout_conflict()?;
Ok(())
})
} | rust_cleaned_test_functions.jsonl/62963 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 177
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34067,
68186,
1243,
19510,
4402,
37749,
45908,
368,
1464,
6495,
2077,
71698,
341,
262,
6495,
25243,
486,
4197,
7260,
2861,
37784,
22428,
23476,
91,
341,
286,
1077,
2169,
284,
5266,
0,
341,
310,
15... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_intersect_line() {
//intersection
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.25, 0.25, 0.], &[1., 1., 0.]);
match a.get_intersect(&b) {
(true, Some(_loc)) => {}
_ => panic!("unexpected result for triprism line intersection"),
}
}
//intersection
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.5, -50., 0.], &[0.5, 50., 0.]);
match a.get_intersect(&b) {
(true, Some(_loc)) => {}
_ => panic!("unexpected result for triprism line intersection"),
}
}
//intersection
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.25, 0.25, 0.5], &[0.26, 0.26, 0.5]);
match a.get_intersect(&b) {
(true, Some(_loc)) => {}
_ => panic!("unexpected result for triprism line intersection"),
}
}
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.25, 0.25, 0.], &[1., 1., 0.]);
match b.get_intersect(&a) {
(true, Some(_loc)) => {}
_ => panic!("unexpected result for triprism line intersection"),
}
}
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.5, -50., 0.], &[0.5, 50., 0.]);
match b.get_intersect(&a) {
(true, Some(_loc)) => {}
_ => panic!("unexpected result for triprism line intersection"),
}
}
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.25, 0.25, 0.5], &[0.26, 0.26, 0.5]);
match b.get_intersect(&a) {
(true, Some(_loc)) => {}
_ => panic!("unexpected result for triprism line intersection"),
}
}
//no intersection
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0.25, 0.25, 1.5], &[1., 1., 1.5]);
match a.get_intersect(&b) {
(true, Some(_loc)) => {
panic!("unexpected result for triprism line intersection");
}
_ => {}
}
}
//no intersection
{
let a = TriPrism::init(&[0., 0., 0., 1., 0., 0., 1., 1., 0.], 1.);
let b = Line3::init(&[0., -5., 0.5], &[50., 45., 0.5]);
match a.get_intersect(&b) {
(true, Some(_loc)) => {
panic!("unexpected result for triprism line intersection");
}
_ => {}
}
}
} | rust_cleaned_test_functions.jsonl/104487 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1451
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
72747,
6528,
368,
341,
262,
442,
73648,
198,
262,
341,
286,
1077,
264,
284,
12359,
3533,
2142,
486,
2327,
2099,
58,
15,
2572,
220,
15,
2572,
220,
15,
2572,
220,
16,
2572,
220,
15,
2572,
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... | 9 |
#[test]
fn test_ed25519_pubkey_msg() {
// test-vector generated exactly as for test_empty_pubkey_msg
// but with the following modifications:
// var pubKey [32]byte
let encoded = vec![
0x2b, // length
0x17, 0xe, 0xd5, 0x7c, // prefix
0xa, 0x25, 0x16, 0x24, 0xde, 0x64, 0x20, 0x79, 0xce, 0xd, 0xe0, 0x43, 0x33, 0x4a, 0xec,
0xe0, 0x8b, 0x7b, 0xb5, 0x61, 0xbc, 0xe7, 0xc1, 0xd4, 0x69, 0xc3, 0x44, 0x26, 0xec,
0xef, 0xc0, 0x72, 0xa, 0x52, 0x4d, 0x37, 0x32, 0xef, 0xed,
];
let msg = PubKeyResponse {
pub_key_ed25519: vec![
0x79, 0xce, 0xd, 0xe0, 0x43, 0x33, 0x4a, 0xec, 0xe0, 0x8b, 0x7b, 0xb5, 0x61, 0xbc,
0xe7, 0xc1, 0xd4, 0x69, 0xc3, 0x44, 0x26, 0xec, 0xef, 0xc0, 0x72, 0xa, 0x52, 0x4d,
0x37, 0x32, 0xef, 0xed,
],
};
let mut got = vec![];
let _have = msg.encode(&mut got);
assert_eq!(got, encoded);
match PubKeyResponse::decode(&encoded) {
Ok(have) => assert_eq!(have, msg),
Err(err) => panic!(err),
}
} | rust_cleaned_test_functions.jsonl/80375 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 808
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
32370,
17,
20,
20,
16,
24,
34014,
792,
6483,
368,
341,
286,
442,
1273,
65192,
7907,
6896,
438,
369,
1273,
15124,
34014,
792,
6483,
198,
286,
442,
714,
448,
279,
2701,
28782,
510,
73363,
286,
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... | 2 |
#[test]
fn test_json_read_list_of_structs() {
let schema = Schema::new(vec![Field::new(
"c1",
DataType::List(Box::new(Field::new(
"item",
DataType::Struct(vec![Field::new("a", DataType::Int64, true)]),
true,
))),
true,
)]);
let decoder = Decoder::new(Arc::new(schema), 1024, None);
let batch = decoder
.next_batch(
// NOTE: total struct element count needs to be greater than
// logic
&mut vec![
Ok(serde_json::json!({
"c1": [{"a": 1}],
})),
Ok(serde_json::json!({
"c1": [{"a": 2}, {"a": 3}, {"a": 4}, {"a": 5}, {"a": 6}, {"a": 7}],
})),
Ok(serde_json::json!({
"c1": [{"a": 10}, {"a": 11}],
})),
]
.into_iter(),
)
.unwrap()
.unwrap();
assert_eq!(batch.num_columns(), 1);
assert_eq!(batch.num_rows(), 3);
} | rust_cleaned_test_functions.jsonl/22619 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 767
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9455,
6443,
2019,
3575,
15126,
82,
368,
341,
286,
1077,
10802,
284,
12539,
486,
931,
25592,
20703,
1877,
486,
931,
1006,
310,
330,
66,
16,
756,
310,
33172,
486,
852,
67758,
486,
931,
57788,
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_vec_schemas_compare() {
let empty_vec = Vec::<i32>::new();
let non_empty_vec = vec![1];
assert_eq!(
vec_schemas_cmp(false, false, empty_vec.is_empty(), empty_vec.is_empty()).unwrap(),
Ordering::Equal
);
assert_eq!(
vec_schemas_cmp(true, false, empty_vec.is_empty(), empty_vec.is_empty()).unwrap(),
Ordering::Less
);
assert_eq!(
vec_schemas_cmp(false, true, empty_vec.is_empty(), empty_vec.is_empty()).unwrap(),
Ordering::Greater
);
assert_eq!(
vec_schemas_cmp(false, false, non_empty_vec.is_empty(), empty_vec.is_empty()).unwrap(),
Ordering::Less
);
assert_eq!(
vec_schemas_cmp(false, false, empty_vec.is_empty(), non_empty_vec.is_empty()).unwrap(),
Ordering::Greater
);
assert!(vec_schemas_cmp(
false,
false,
non_empty_vec.is_empty(),
non_empty_vec.is_empty()
)
.is_none());
assert!(vec_schemas_cmp(true, true, empty_vec.is_empty(), empty_vec.is_empty()).is_none());
assert!(vec_schemas_cmp(
true,
true,
non_empty_vec.is_empty(),
non_empty_vec.is_empty()
)
.is_none());
} | rust_cleaned_test_functions.jsonl/108817 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 607
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13251,
643,
31126,
32235,
368,
341,
262,
1077,
4287,
13251,
284,
11312,
27638,
72,
18,
17,
6831,
931,
543,
262,
1077,
2477,
15124,
13251,
284,
7486,
20703,
16,
4821,
262,
2060,
10714,
33673,
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_parse_query_to_ast_hyphen() {
test_parse_query_to_ast_helper("\"www-form-encoded\"", "\"www-form-encoded\"");
test_parse_query_to_ast_helper("www-form-encoded", "\"www-form-encoded\"");
test_parse_query_to_ast_helper("www-form-encoded", "\"www-form-encoded\"");
} | rust_cleaned_test_functions.jsonl/64404 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 147
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
5738,
2346,
48019,
1523,
88,
14769,
368,
341,
286,
1273,
21039,
5738,
2346,
48019,
10418,
38915,
2136,
8460,
92262,
55853,
15898,
2136,
8460,
92262,
88385,
286,
1273,
21039,
5738,
2346,
48019,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_fetch_module_meta_data() {
let (_temp_dir, deno_dir) = test_setup();
let cwd = std::env::current_dir().unwrap();
let cwd_string = String::from(cwd.to_str().unwrap()) + "/";
tokio_util::init(|| {
// Test failure case.
let specifier = "hello.ts";
let referrer = add_root!("/baddir/badfile.ts");
let r = deno_dir.fetch_module_meta_data(specifier, referrer, true);
assert!(r.is_err());
// Assuming cwd is the deno repo root.
let specifier = "./js/main.ts";
let referrer = cwd_string.as_str();
let r = deno_dir.fetch_module_meta_data(specifier, referrer, true);
assert!(r.is_ok());
})
} | rust_cleaned_test_functions.jsonl/83875 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 309
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11803,
10750,
13381,
1769,
368,
341,
262,
1077,
5453,
3888,
4334,
11,
3371,
78,
4334,
8,
284,
1273,
21363,
1428,
262,
1077,
46938,
284,
1460,
486,
3160,
486,
3231,
4334,
1005,
15454,
543,
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... | 2 |
#[test]
fn test_serialize_move_type_tag() {
use TypeTag::*;
fn assert_serialize(t: TypeTag, expected: Value) {
let value = to_value(MoveType::from(t)).unwrap();
assert_json(value, expected)
}
assert_serialize(Bool, json!("bool"));
assert_serialize(U8, json!("u8"));
assert_serialize(U64, json!("u64"));
assert_serialize(U128, json!("u128"));
assert_serialize(Address, json!("address"));
assert_serialize(Signer, json!("signer"));
assert_serialize(Vector(Box::new(U8)), json!("vector<u8>"));
assert_serialize(
Struct(create_nested_struct()),
json!("0x1::Home::ABC<address, 0x1::Account::Base<u128, vector<u64>, vector<0x1::Type::String>, 0x1::Type::String>>"),
);
} | rust_cleaned_test_functions.jsonl/66273 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 396
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
88686,
17134,
1819,
9372,
368,
341,
286,
990,
3990,
5668,
56162,
286,
5168,
2060,
88686,
1155,
25,
3990,
5668,
11,
3601,
25,
5162,
8,
341,
310,
1077,
897,
284,
311,
3142,
3189,
994,
929,
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_guild_name() {
assert!(guild_name("aa"));
assert!(guild_name("a".repeat(100)));
assert!(!guild_name(""));
assert!(!guild_name("a"));
assert!(!guild_name("a".repeat(101)));
} | rust_cleaned_test_functions.jsonl/29955 | {
"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,
1889,
1498,
1269,
368,
341,
286,
2060,
10297,
57877,
1269,
445,
5305,
4010,
286,
2060,
10297,
57877,
1269,
445,
64,
3263,
30624,
7,
16,
15,
15,
22525,
286,
2060,
0,
3471,
57877,
1269,
89744,
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_climax_near_the_middle() {
let constraint: Box<dyn SinglePartConstraint> = Box::new(ClimaxNearTheMiddle);
assert!(!constraint.is_active(&vec![], 10));
run_scale_free_test(&constraint, &[0, 1, 0], 3, true);
run_scale_free_test(&constraint, &[0, -1, 0], 3, false);
run_scale_free_test(&constraint, &[0, 1, 2, 3, 4, 5, 4, 3, 2], 10, true);
run_scale_free_test(&constraint, &[0, 1, 2, 3, 4, 5, 5, 3, 2], 10, false);
} | rust_cleaned_test_functions.jsonl/74363 | {
"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,
6794,
75109,
76340,
16068,
62580,
368,
341,
286,
1077,
21568,
25,
8261,
92846,
11327,
5800,
17890,
29,
284,
8261,
486,
931,
3025,
4659,
706,
51962,
785,
43935,
317,
286,
2060,
0,
3471,
48057,
2079... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_typed() {
let len_function = len();
let mut niko_len = len_function.hide("Niko Matsakis".to_string());
assert_eq!(niko_len.call(), "Niko Matsakis".len());
// can be called twice
assert_eq!(niko_len.call(), "Niko Matsakis".len());
} | rust_cleaned_test_functions.jsonl/87494 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 137
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
528,
32501,
368,
341,
286,
1077,
2422,
9174,
284,
2422,
543,
286,
1077,
5206,
308,
23630,
6043,
284,
2422,
9174,
18242,
445,
45,
23630,
67179,
75777,
3263,
983,
3904,
5231,
286,
2060,
10714,
10297... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_parse_css_border_1() {
assert_eq!(
parse_css_border("5px solid red"),
Ok(StyleBorderSide {
border_width: PixelValue::px(5.0),
border_style: BorderStyle::Solid,
border_color: ColorU { r: 255, g: 0, b: 0, a: 255 },
})
);
} | rust_cleaned_test_functions.jsonl/37087 | {
"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,
21039,
25924,
31940,
62,
16,
368,
341,
286,
2060,
10714,
33673,
310,
4715,
25924,
31940,
445,
20,
1767,
6437,
2518,
4461,
310,
7622,
7,
2323,
10691,
16384,
341,
394,
3886,
7927,
25,
27469,
1130,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ld_r_imm() {
let mut emu = MockEmulator::new().unwrap();
emu.cpu.pc = 0xC000;
emu.wram[0] = 0x06;
emu.wram[1] = 1;
emu.wram[2] = 0x3E;
emu.wram[3] = 255;
execute_n(&mut emu, 2);
assert_eq!(emu.cpu.b, 1);
assert_eq!(emu.cpu.a, 255);
} | rust_cleaned_test_functions.jsonl/51426 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 213
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
50573,
1710,
71370,
368,
341,
286,
1077,
5206,
976,
84,
284,
14563,
2269,
10511,
486,
931,
1005,
15454,
1428,
286,
976,
84,
42387,
53335,
284,
220,
15,
12125,
15,
15,
15,
280,
286,
976,
84,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_group_type() {
let f1 = Type::primitive_type_builder("f1", PhysicalType::INT32)
.with_logical_type(LogicalType::INT_32)
.with_id(0)
.build();
assert!(f1.is_ok());
let f2 = Type::primitive_type_builder("f2", PhysicalType::BYTE_ARRAY)
.with_logical_type(LogicalType::UTF8)
.with_id(1)
.build();
assert!(f2.is_ok());
let mut fields = vec![];
fields.push(Rc::new(f1.unwrap()));
fields.push(Rc::new(f2.unwrap()));
let result = Type::group_type_builder("foo")
.with_repetition(Repetition::REPEATED)
.with_fields(&mut fields)
.with_id(1)
.build();
assert!(result.is_ok());
let tp = result.unwrap();
let basic_info = tp.get_basic_info();
assert!(tp.is_group());
assert!(!tp.is_primitive());
assert_eq!(basic_info.repetition(), Repetition::REPEATED);
assert_eq!(basic_info.logical_type(), LogicalType::NONE);
assert_eq!(basic_info.id(), 1);
assert_eq!(tp.get_fields().len(), 2);
assert_eq!(tp.get_fields()[0].name(), "f1");
assert_eq!(tp.get_fields()[1].name(), "f2");
} | rust_cleaned_test_functions.jsonl/30052 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 660
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6288,
1819,
368,
341,
286,
1077,
282,
16,
284,
3990,
486,
73448,
1819,
28532,
445,
69,
16,
497,
27379,
929,
486,
3221,
18,
17,
340,
310,
659,
4197,
86484,
1819,
33028,
938,
929,
486,
3221,
62,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_resize_down_gaussian() {
// 217x447px => 100x200
let img = setup_default_test_image();
let operation = ImgOp::Resize((100, 200));
let (xa, ya) = img.dimensions();
assert_eq!(xa, 217);
assert_eq!(ya, 447);
let mut operator = ImageEngine::new(img);
let done = operator.ignite(&[Instr::Operation(operation)]);
assert!(done.is_ok());
let img_result = done.unwrap();
let (xb, yb) = img_result.dimensions();
assert_eq!(xb, 100);
assert_eq!(yb, 200);
output_test_image_for_manual_inspection(&img_result, out_!("test_scale_100x200.png"));
} | rust_cleaned_test_functions.jsonl/21156 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 319
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53370,
13998,
1889,
46972,
368,
341,
286,
442,
220,
17,
16,
22,
87,
19,
19,
22,
1767,
589,
220,
16,
15,
15,
87,
17,
15,
15,
198,
286,
1077,
4964,
284,
6505,
9993,
4452,
4954,
543,
286,
107... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_modified_ciphertext_err() {
let key = SecretKey::default();
let plaintext = "Secret message".as_bytes();
let mut dst_ciphertext = seal(&key, plaintext).unwrap();
// Modify ciphertext
dst_ciphertext[25] ^= 1;
assert!(open(&key, &dst_ciphertext).is_err());
} | rust_cleaned_test_functions.jsonl/104187 | {
"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,
37749,
666,
45043,
9266,
368,
341,
310,
1077,
1376,
284,
8599,
1592,
486,
2258,
543,
310,
1077,
60847,
284,
330,
19773,
1943,
3263,
300,
12524,
1428,
310,
1077,
5206,
10648,
666,
45043,
284,
25349... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_failing_sign_verify() {
let seckey_a: [u8; 32] = [169, 195, 92, 103, 2, 159, 75, 46, 158, 79, 249, 49, 208, 28, 48, 210, 5, 47, 136, 77, 21, 51, 224, 54, 213, 165, 90, 122, 233, 199, 0, 248];
let seckey = SecretKey::parse(&seckey_a).unwrap();
let pubkey = PublicKey::from_secret_key(&seckey);
let message_arr = [6u8; 32];
let message = Message::parse(&message_arr);
let (sig, recid) = sign(&message, &seckey).unwrap();
let tmp: u8 = recid.into();
assert_eq!(tmp, 1u8);
let recovered_pubkey = recover(&message, &sig, &recid).unwrap();
let rpa = recovered_pubkey.serialize();
let opa = pubkey.serialize();
let rpr: &[u8] = &rpa;
let opr: &[u8] = &opa;
assert_eq!(rpr, opr);
} | rust_cleaned_test_functions.jsonl/129815 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 338
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
761,
14277,
11172,
35638,
368,
341,
262,
1077,
511,
377,
1195,
4306,
25,
508,
84,
23,
26,
220,
18,
17,
60,
284,
508,
16,
21,
24,
11,
220,
16,
24,
20,
11,
220,
24,
17,
11,
220,
16,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_c_try_return() {
assert_eq!((), ffi::c_try_return_void().unwrap());
assert_eq!(2020, ffi::c_try_return_primitive().unwrap());
assert_eq!(
"logic error",
ffi::c_fail_return_primitive().unwrap_err().what(),
);
assert_eq!(2020, ffi::c_try_return_box().unwrap().0);
assert_eq!("2020", *ffi::c_try_return_ref(&"2020".to_owned()).unwrap());
assert_eq!("2020", ffi::c_try_return_str("2020").unwrap());
assert_eq!(b"2020", ffi::c_try_return_sliceu8(b"2020").unwrap());
assert_eq!("2020", ffi::c_try_return_rust_string().unwrap());
assert_eq!("2020", &*ffi::c_try_return_unique_ptr_string().unwrap());
} | rust_cleaned_test_functions.jsonl/50896 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 306
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
666,
53283,
12511,
368,
341,
262,
2060,
10714,
10297,
1507,
76956,
486,
66,
53283,
12511,
37775,
1005,
15454,
1423,
262,
2060,
10714,
10297,
17,
15,
17,
15,
11,
76956,
486,
66,
53283,
12511,
84087... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_cp_one_file_system() {
use crate::common::util::AtPath;
use walkdir::WalkDir;
let scene = TestScenario::new(util_name!());
if scene.cmd("whoami").run().stdout_str() != "root\n" {
return;
}
let at = scene.fixtures.clone();
let at_src = AtPath::new(&at.plus(TEST_MOUNT_COPY_FROM_FOLDER));
let at_dst = AtPath::new(&at.plus(TEST_COPY_TO_FOLDER_NEW));
// Prepare the mount
at_src.mkdir(TEST_MOUNT_MOUNTPOINT);
let mountpoint_path = &at_src.plus_as_string(TEST_MOUNT_MOUNTPOINT);
scene
.cmd("mount")
.arg("-t")
.arg("tmpfs")
.arg("-o")
.arg("size=640k") // ought to be enough
.arg("tmpfs")
.arg(mountpoint_path)
.succeeds();
at_src.touch(TEST_MOUNT_OTHER_FILESYSTEM_FILE);
// Begin testing -x flag
scene
.ucmd()
.arg("-rx")
.arg(TEST_MOUNT_COPY_FROM_FOLDER)
.arg(TEST_COPY_TO_FOLDER_NEW)
.succeeds();
// Ditch the mount before the asserts
scene.cmd("umount").arg(mountpoint_path).succeeds();
assert!(!at_dst.file_exists(TEST_MOUNT_OTHER_FILESYSTEM_FILE));
// Check if the other files were copied from the source folder hierarchy
for entry in WalkDir::new(at_src.as_string()) {
let entry = entry.unwrap();
let relative_src = entry
.path()
.strip_prefix(at_src.as_string())
.unwrap()
.to_str()
.unwrap();
let ft = entry.file_type();
match (ft.is_dir(), ft.is_file(), ft.is_symlink()) {
(true, _, _) => assert!(at_dst.dir_exists(relative_src)),
(_, true, _) => assert!(at_dst.file_exists(relative_src)),
(_, _, _) => panic!(),
}
}
} | rust_cleaned_test_functions.jsonl/21275 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 902
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39811,
11667,
2458,
17687,
368,
341,
262,
990,
17717,
486,
5464,
486,
1314,
486,
86422,
280,
262,
990,
4227,
3741,
486,
48849,
6184,
401,
262,
1077,
6109,
284,
3393,
54031,
486,
931,
67811,
1269,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_enum_fromvec() {
let v = vec![1, 3];
let span = Span::from_vec(v.clone()).unwrap();
if let Span::Discontinuous(span) = span {
for (target, test) in span.into_iter().zip(v) {
assert_eq!(target, test);
}
} else {
assert_eq!(0, 1);
}
} | rust_cleaned_test_functions.jsonl/4980 | {
"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,
31054,
5673,
4083,
368,
341,
286,
1077,
348,
284,
7486,
20703,
16,
11,
220,
18,
935,
286,
1077,
9390,
284,
11903,
486,
1499,
13251,
3747,
15997,
6011,
15454,
543,
286,
421,
1077,
11903,
486,
483... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_inherit_env() {
use env;
let result = env_cmd().output().unwrap();
let output = String::from_utf8(result.stdout).unwrap();
for (ref k, ref v) in env::vars() {
// Windows has hidden environment variables whose names start with
// `set` command.
assert!((cfg!(windows) && k.starts_with("=")) ||
k.starts_with("DYLD") ||
output.contains(&format!("{}={}", *k, *v)),
"output doesn't contain `{}={}`\n{}",
k, v, output);
}
} | rust_cleaned_test_functions.jsonl/60712 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 332
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1243,
9263,
15879,
368,
341,
286,
990,
6105,
401,
286,
1077,
1102,
284,
6105,
11684,
1005,
3006,
1005,
15454,
543,
286,
1077,
2550,
284,
923,
486,
1499,
39453,
23,
4456,
24839,
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... | 5 |
#[test]
fn test_blockinfo_encode() -> BaseRtResult<()> {
let mut blk: Block = Default::default();
let headers = vec![
new_block_header(b"a".to_vec(), BqlType::LowCardinalityString, false),
new_block_header(b"b".to_vec(), BqlType::UInt(64), true),
];
blk.ncols = headers.len();
blk.nrows = 0; //for empty data case
blk.columns.extend(headers);
let mut bs = BytesMut::with_capacity(1);
blk.encode_to(&mut bs, None)?;
let expected_bs: Vec<u8> = vec![
0x01, 0x00, 0x01, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x02, 0x00, 0x01,
0x61, 0x16, 0x4c, 0x6f, 0x77, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c,
0x69, 0x74, 0x79, 0x28, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x01, 0x62,
0x10, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x55, 0x49, 0x6e,
0x74, 0x36, 0x34, 0x29,
];
assert_eq!(&bs[..], &expected_bs);
let mut blk: Block = Default::default();
let headers = vec![
new_block_header(b"trip_id".to_vec(), BqlType::UInt(32), false),
new_block_header(b"pickup_datetime".to_vec(), BqlType::DateTime, false),
];
blk.ncols = headers.len();
blk.nrows = 0; //for empty data case
blk.columns.extend(headers);
let mut bs = BytesMut::with_capacity(1);
blk.encode_to(&mut bs, None)?;
let expected_bs: Vec<u8> = vec![
0x01, 0x00, 0x01, 0x00, 0x02, 0xff, 0xff, 0xff, 0xff, 0x00, 0x02, 0x00, 0x07,
0x74, 0x72, 0x69, 0x70, 0x5f, 0x69, 0x64, 0x06, 0x55, 0x49, 0x6e, 0x74, 0x33,
0x32, 0x0f, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61, 0x74, 0x65,
0x74, 0x69, 0x6d, 0x65, 0x08, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,
];
assert_eq!(&bs[..], &expected_bs);
Ok(())
} | rust_cleaned_test_functions.jsonl/23916 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1165
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7113,
2733,
11224,
368,
1464,
5351,
49,
83,
2077,
71698,
341,
286,
1077,
5206,
40643,
25,
8362,
284,
7899,
486,
2258,
543,
286,
1077,
7102,
284,
7486,
90515,
310,
501,
7113,
8757,
1883,
56693,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_parse_section_xdp() {
let mut obj = fake_obj();
assert_matches!(
obj.parse_section(fake_section("xdp/foo", bytes_of(&fake_ins()))),
Ok(())
);
assert_matches!(
obj.programs.get("foo"),
Some(Program {
section: ProgramSection::Xdp { .. },
..
})
);
} | rust_cleaned_test_functions.jsonl/132933 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 234
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
16221,
3212,
9796,
368,
341,
286,
1077,
5206,
2839,
284,
12418,
7328,
1428,
286,
2060,
38344,
33673,
310,
2839,
4632,
16221,
74138,
16221,
445,
9703,
79,
60555,
497,
5820,
3575,
2099,
30570,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_custom_enum_message_into_policy() {
let message = EnumMessage::Variant(1);
let policy = message.clone().into_policy();
match policy {
CachePolicy::Cacheable(value) => assert_eq!(value, message),
CachePolicy::NonCacheable(_) => assert!(false),
};
} | rust_cleaned_test_functions.jsonl/86729 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 118
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15875,
31054,
6462,
45514,
22773,
368,
341,
262,
1077,
1943,
284,
14086,
2052,
486,
20746,
7,
16,
317,
262,
1077,
4842,
284,
1943,
15997,
1005,
18122,
22773,
543,
262,
2432,
4842,
341,
286,
19479,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_pos_macro() {
let a = posof!(1, 2);
let b = posof!([1, 2]);
assert_eq!(a, b);
} | rust_cleaned_test_functions.jsonl/20818 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 65
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6479,
58810,
368,
341,
262,
1077,
264,
284,
1133,
1055,
10297,
16,
11,
220,
17,
317,
262,
1077,
293,
284,
1133,
1055,
0,
2561,
16,
11,
220,
17,
2558,
262,
2060,
10714,
10297,
64,
11,
293,
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 |
#[test]
fn test_null() {
let mut list: ConcurrentList<()> = ConcurrentList::new();
assert_eq!(*list.head.get_mut(), ptr::null_mut());
assert_eq!(list.head(), None);
assert_eq!(list.head_mut(), None);
assert_eq!(list.iter().next(), None);
assert_eq!(list.iter_mut().next(), None);
assert_eq!(list.len(), 0);
assert!(list.is_empty());
} | rust_cleaned_test_functions.jsonl/99282 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 159
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15162,
368,
341,
262,
1077,
5206,
1140,
25,
42704,
852,
71698,
284,
42704,
852,
486,
931,
543,
262,
2060,
10714,
0,
4071,
1607,
16042,
670,
29523,
1507,
10087,
486,
2921,
29523,
1423,
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_merge_fruits_tree_1() {
let mut tree_left = get_test_tree(&[
("red".to_string(), 50, "1900".to_string(), 25),
("blue".to_string(), 30, "1900".to_string(), 30),
]);
let tree_right = get_test_tree(&[
("red".to_string(), 60, "1900".to_string(), 30),
("blue".to_string(), 25, "1900".to_string(), 50),
]);
tree_left.merge_fruits(&tree_right);
let tree_expected = get_test_tree(&[
("red".to_string(), 110, "1900".to_string(), 55),
("blue".to_string(), 55, "1900".to_string(), 80),
]);
assert_eq!(tree_left, tree_expected);
} | rust_cleaned_test_functions.jsonl/132447 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 344
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20888,
761,
67898,
11663,
62,
16,
368,
341,
286,
1077,
5206,
4916,
9579,
284,
633,
4452,
11663,
2099,
9640,
310,
3489,
1151,
3263,
983,
3904,
1507,
220,
20,
15,
11,
330,
16,
24,
15,
15,
3263,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_from_vec4() {
// checks that the 4th element is unused.
let v1 = Vec3A::from(Vec4::new(1.0, 2.0, 3.0, 4.0));
assert_eq!(v1.max_element(), 3.0);
let v2 = Vec3A::from(Vec4::new(4.0, 3.0, 2.0, 1.0));
assert_eq!(v2.min_element(), 2.0);
} | rust_cleaned_test_functions.jsonl/23408 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 175
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7260,
6345,
5673,
13251,
19,
368,
341,
286,
442,
12341,
429,
279,
220,
19,
339,
2392,
374,
20006,
624,
286,
1077,
348,
16,
284,
11312,
18,
32,
486,
1499,
49923,
19,
486,
931,
7,
16,
13,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_decode_smul_bb() {
assert_eq!(
decode_32(0xfb1efe08),
Instruction::SMUL {
params: Reg3HighParams {
rd: Reg::LR,
rn: Reg::LR,
rm: Reg::R8,
n_high: false,
m_high: false
}
}
);
} | rust_cleaned_test_functions.jsonl/64863 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 230
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15227,
15874,
360,
50255,
368,
341,
1066,
262,
2060,
10714,
33673,
286,
16895,
62,
18,
17,
7,
15,
46071,
16,
44953,
15,
23,
1326,
286,
29051,
486,
9501,
1094,
341,
310,
3628,
25,
3184,
18,
119... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_extract_struct_keep_comments_and_attrs_on_variant_tuple() {
check_assist(
extract_struct_from_enum_variant,
r#"
enum A {
/* comment */
// other
/// comment
#[attr]
$0One(u32, u32)
}"#,
r#"
/* comment */
// other
/// comment
#[attr]
struct One(u32, u32);
enum A {
One(One)
}"#,
);
} | rust_cleaned_test_functions.jsonl/36301 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 208
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39123,
15126,
50293,
30359,
8378,
39578,
4470,
46112,
21773,
368,
341,
286,
1779,
12083,
380,
1006,
310,
8649,
15126,
5673,
31054,
46112,
345,
310,
435,
2,
698,
9018,
362,
341,
262,
1391,
3980,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ofile_basic() {
let mut file = NamedTempFile::new().unwrap();
writeln!(file, "T").unwrap();
let p = file.path();
let ofile_pid = opath(p).unwrap().pop().unwrap();
assert_eq!(ofile_pid.0, std::process::id());
} | rust_cleaned_test_functions.jsonl/44577 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 134
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3575,
457,
34729,
368,
341,
286,
1077,
5206,
1034,
284,
40459,
12151,
1703,
486,
931,
1005,
15454,
543,
286,
80947,
10297,
1192,
11,
330,
51,
1827,
15454,
1428,
286,
1077,
281,
284,
1034,
3875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_error_unpaired_brackets() {
let mut tree = Tree {
raw: "(2 + 3)) * 5".to_owned(),
..Default::default()
};
tree.parse_pos().unwrap();
assert_eq!(tree.parse_operators(), Err(Error::UnpairedBrackets));
} | rust_cleaned_test_functions.jsonl/28447 | {
"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,
4096,
4907,
76167,
17682,
18382,
368,
341,
286,
1077,
5206,
4916,
284,
8942,
341,
310,
7112,
25,
11993,
17,
488,
220,
18,
593,
353,
220,
20,
3263,
983,
51973,
3148,
310,
5241,
3675,
486,
2258,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_bump_fee_low_abs() {
let (wallet, _, _) = get_funded_wallet(get_test_wpkh());
let addr = wallet.get_new_address().unwrap();
let (psbt, mut details) = wallet
.create_tx(
TxBuilder::with_recipients(vec![(addr.script_pubkey(), 25_000)]).enable_rbf(),
)
.unwrap();
let tx = psbt.extract_tx();
let txid = tx.txid();
details.transaction = Some(tx);
wallet.database.borrow_mut().set_tx(&details).unwrap();
wallet
.bump_fee(&txid, TxBuilder::new().fee_absolute(10))
.unwrap();
} | rust_cleaned_test_functions.jsonl/11353 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 338
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
1510,
34305,
23767,
31170,
368,
341,
286,
1077,
320,
35735,
11,
8358,
27439,
284,
633,
761,
36053,
62308,
5433,
4452,
1670,
20819,
71,
1423,
286,
1077,
10789,
284,
15085,
670,
5921,
6744,
100... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_disk_resolver_resolve_path() {
let test_folder = testutils::setup_test_folder("disk_resolver");
let base_path = test_folder.path().join("parts");
std::fs::create_dir(&base_path).unwrap_or_default();
// Create disk-based resolver
let resolver = DiskResolver::new_from_catalog(test_folder.path()).unwrap();
// Create a dummy file and resolve its reference filename to the on-disk filename
let dummy_filename = base_path.join("dummy.ldr");
{
let mut f = std::fs::File::create(&dummy_filename).unwrap();
f.write(b"dummy content").unwrap();
}
assert_eq!(dummy_filename, resolver.resolve_path("dummy.ldr").unwrap());
// Resolve its content
assert!(resolver.resolve("dummy.ldr").is_ok());
// Delete test file
std::fs::remove_file(&dummy_filename).unwrap_or_default();
// Fail to resolve non-existing file
let dummy_filename = base_path.join("non_existing.ldr");
if dummy_filename.is_file() {
std::fs::remove_file(&dummy_filename).unwrap_or_default();
}
assert!(matches!(
resolver.resolve("non_existing.ldr"),
Err(weldr::ResolveError {
filename: _,
resolve_error: _,
})
));
} | rust_cleaned_test_functions.jsonl/32874 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 621
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
41687,
91578,
77291,
2638,
368,
341,
286,
1077,
1273,
15268,
284,
1273,
6031,
486,
15188,
4452,
15268,
445,
30496,
91578,
797,
286,
1077,
2331,
2638,
284,
1273,
15268,
3875,
1005,
5987,
445,
18252,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_unicode_encode_error() {
let gil = Python::acquire_gil();
let py = gil.python();
let take_str = wrap_pyfunction!(take_str)(py);
py_run!(
py,
take_str,
r#"
try:
take_str('\ud800')
except UnicodeEncodeError as e:
error_msg = "'utf-8' codec can't encode character '\\ud800' in position 0: surrogates not allowed"
assert str(e) == error_msg
"#
);
} | rust_cleaned_test_functions.jsonl/63664 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 236
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
54662,
11224,
4096,
368,
341,
262,
1077,
342,
321,
284,
13027,
486,
580,
984,
1889,
321,
543,
262,
1077,
4510,
284,
342,
321,
43193,
1428,
262,
1077,
1896,
2895,
284,
15061,
40291,
1688,
10297,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_conditioncode_try_from_usize() {
for value in ConditionCode::values() {
let converted = <ConditionCode as TryFrom<usize>>::try_from(value as usize).unwrap();
assert_eq!(converted, value);
}
assert!(<ConditionCode as TryFrom<usize>>::try_from(IcedConstants::CONDITION_CODE_ENUM_COUNT).is_err());
assert!(<ConditionCode as TryFrom<usize>>::try_from(core::usize::MAX).is_err());
} | rust_cleaned_test_functions.jsonl/5967 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 156
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27656,
1851,
53283,
5673,
11306,
551,
368,
341,
2023,
897,
304,
15180,
2078,
486,
3661,
368,
341,
197,
10217,
16099,
284,
366,
10547,
2078,
438,
9735,
3830,
90244,
77595,
1539,
5673,
3679,
438,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_into_response() {
let resp: Response = "test".into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("text/plain; charset=utf-8")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
let resp: Response = b"test".as_ref().into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("application/octet-stream")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
let resp: Response = "test".to_owned().into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("text/plain; charset=utf-8")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
let resp: Response = (&"test".to_owned()).into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("text/plain; charset=utf-8")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
let b = Bytes::from_static(b"test");
let resp: Response = b.into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("application/octet-stream")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
let b = Bytes::from_static(b"test");
let resp: Response = b.into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("application/octet-stream")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
let b = BytesMut::from("test");
let resp: Response = b.into();
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(
resp.headers().get(CONTENT_TYPE).unwrap(),
HeaderValue::from_static("application/octet-stream")
);
assert_eq!(resp.status(), StatusCode::OK);
assert_eq!(resp.body().get_ref(), b"test");
} | rust_cleaned_test_functions.jsonl/18842 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1238
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45514,
9655,
368,
341,
286,
1077,
9039,
25,
5949,
284,
330,
1944,
3263,
18122,
543,
286,
2060,
10714,
10297,
18243,
4299,
1507,
53403,
486,
3925,
317,
286,
2060,
10714,
33673,
310,
9039,
18022,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_eq_member() {
let joined_at = Timestamp::from_secs(1_632_072_645).expect("non zero");
let member = Member {
avatar: None,
deaf: false,
guild_id: GuildId::new(3).expect("non zero"),
joined_at,
mute: true,
nick: Some("member nick".to_owned()),
pending: false,
premium_since: None,
roles: Vec::new(),
user: user(),
};
assert_eq!(cached_member(), member);
} | rust_cleaned_test_functions.jsonl/115507 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 288
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10714,
19388,
368,
341,
286,
1077,
10859,
3752,
284,
32758,
486,
1499,
68718,
7,
16,
62,
21,
18,
17,
62,
15,
22,
17,
62,
21,
19,
20,
568,
17119,
445,
6280,
7168,
3071,
286,
1077,
4462,
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_projective_scalar_multiplication() {
let g = G2Projective::generator();
let a = Scalar::from_raw([
0x2b56_8297_a56d_a71c,
0xd8c3_9ecb_0ef3_75d1,
0x435c_38da_67bf_bf96,
0x8088_a050_26b6_59b2,
]);
let b = Scalar::from_raw([
0x785f_dd9b_26ef_8b85,
0xc997_f258_3769_5c18,
0x4c8d_bc39_e7b7_56c1,
0x70d9_b6cc_6d87_df20,
]);
let c = a * b;
assert_eq!((g * a) * b, g * c);
} | rust_cleaned_test_functions.jsonl/47808 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 308
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16352,
533,
41652,
91802,
1693,
368,
341,
262,
1077,
342,
284,
479,
17,
7849,
533,
486,
35851,
543,
262,
1077,
264,
284,
35176,
486,
1499,
16067,
8956,
286,
220,
15,
87,
17,
65,
20,
21,
62,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_from_iterator() {
let logger = slog::Logger::root(slog::Discard, slog::o!());
let string_subsystem = Subsystem::new(64, &logger);
let s = Name::new("ศไทย中华Việt Nam", &string_subsystem);
let t = "ศไทย中华";
let u = "Việt Nam";
let mut a = t.to_string();
a.extend(u.chars());
assert_eq!(s, a);
let b: String = vec![t, u].into_iter().collect();
assert_eq!(s, b);
let mut c = t.to_string();
c.extend(vec![u]);
assert_eq!(s, c);
} | rust_cleaned_test_functions.jsonl/109237 | {
"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,
5673,
13491,
368,
341,
197,
10217,
5925,
284,
34949,
486,
7395,
486,
2888,
1141,
839,
486,
23477,
567,
11,
34949,
486,
78,
0,
1423,
197,
10217,
914,
5228,
8948,
284,
3719,
8948,
486,
931,
7,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_basic() {
let tmp = Builder::new().prefix("test_basic").tempdir().unwrap();
let path = tmp.path().to_str().unwrap();
let fake_engine = Arc::new(
engine_rocks::raw_util::new_engine_opt(
path,
DBOptions::new(),
vec![
CFOptions::new(CF_DEFAULT, ColumnFamilyOptions::new()),
CFOptions::new(CF_WRITE, ColumnFamilyOptions::new()),
CFOptions::new(CF_LOCK, ColumnFamilyOptions::new()),
CFOptions::new(CF_RAFT, ColumnFamilyOptions::new()),
],
)
.unwrap(),
);
let write = vec![
(b"k", 104, 105),
(b"k", 102, 103),
(b"k", 100, 101),
(b"k", 98, 99),
];
let default = vec![
(b"k", 104),
(b"k", 102),
(b"k", 100),
(b"k", 98),
];
let lock = vec![
(b"k", 100, 0, LockType::Put, false),
(b"k", 100, 0, LockType::Delete, false),
(b"k", 100, 0, LockType::Put, true),
(b"k", 100, 0, LockType::Delete, true),
];
let mut kv = vec![];
for (key, start_ts, commit_ts) in write {
let write = Write::new(WriteType::Put, start_ts.into(), None);
kv.push((
CF_WRITE,
Key::from_raw(key).append_ts(commit_ts.into()),
write.as_ref().to_bytes(),
));
}
for (key, ts) in default {
kv.push((
CF_DEFAULT,
Key::from_raw(key).append_ts(ts.into()),
b"v".to_vec(),
));
}
for (key, ts, for_update_ts, tp, short_value) in lock {
let v = if short_value {
Some(b"v".to_vec())
} else {
None
};
let lock = Lock::new(
tp,
vec![],
ts.into(),
0,
v,
for_update_ts.into(),
0,
TimeStamp::zero(),
);
kv.push((CF_LOCK, Key::from_raw(key), lock.to_bytes()));
}
let mut wb = fake_engine.c().write_batch();
for &(cf, ref k, ref v) in &kv {
wb.put_cf(cf, &keys::data_key(k.as_encoded()), v).unwrap();
}
wb.write().unwrap();
let manager = ResetToVersionManager::new(fake_engine.c().clone());
manager.start(100.into());
manager.wait();
let readopts = IterOptions::new(None, None, false);
let mut write_iter = fake_engine
.c()
.iterator_cf_opt(CF_WRITE, readopts.clone())
.unwrap();
write_iter.seek(SeekKey::Start).unwrap();
let mut remaining_writes = vec![];
while write_iter.valid().unwrap() {
let write = WriteRef::parse(write_iter.value()).unwrap().to_owned();
let key = write_iter.key().to_vec();
write_iter.next().unwrap();
remaining_writes.push((key, write));
}
let mut default_iter = fake_engine
.c()
.iterator_cf_opt(CF_DEFAULT, readopts.clone())
.unwrap();
default_iter.seek(SeekKey::Start).unwrap();
let mut remaining_defaults = vec![];
while default_iter.valid().unwrap() {
let key = default_iter.key().to_vec();
let value = default_iter.value().to_vec();
default_iter.next().unwrap();
remaining_defaults.push((key, value));
}
let mut lock_iter = fake_engine.c().iterator_cf_opt(CF_LOCK, readopts).unwrap();
lock_iter.seek(SeekKey::Start).unwrap();
let mut remaining_locks = vec![];
while lock_iter.valid().unwrap() {
let lock = Lock::parse(lock_iter.value()).unwrap().to_owned();
let key = lock_iter.key().to_vec();
lock_iter.next().unwrap();
remaining_locks.push((key, lock));
}
// Writes which start_ts >= 100 should be removed.
assert_eq!(remaining_writes.len(), 1);
let (key, _) = &remaining_writes[0];
// So the only write left is the one with start_ts = 99
assert_eq!(
Key::from_encoded(key.clone()).decode_ts().unwrap(),
99.into()
);
// Defaults corresponding to the removed writes should be removed.
assert_eq!(remaining_defaults.len(), 1);
let (key, _) = &remaining_defaults[0];
assert_eq!(
Key::from_encoded(key.clone()).decode_ts().unwrap(),
98.into()
);
// All locks should be removed.
assert!(remaining_locks.is_empty());
} | rust_cleaned_test_functions.jsonl/2816 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2667
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34729,
368,
341,
286,
1077,
4174,
284,
20626,
486,
931,
1005,
11849,
445,
1944,
34729,
1827,
3888,
3741,
1005,
15454,
543,
286,
1077,
1815,
284,
4174,
3875,
1005,
983,
2895,
1005,
15454,
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... | 9 |
#[test]
fn test_decode_date() {
let buf = [0; 4];
let date: Date = Decode::<Postgres>::decode(PgValue::from_bytes(&buf)).unwrap();
assert_eq!(date, date!(2000 - 01 - 01));
let buf = 366i32.to_be_bytes();
let date: Date = Decode::<Postgres>::decode(PgValue::from_bytes(&buf)).unwrap();
assert_eq!(date, date!(2001 - 01 - 01));
let buf = 7284i32.to_be_bytes();
let date: Date = Decode::<Postgres>::decode(PgValue::from_bytes(&buf)).unwrap();
assert_eq!(date, date!(2019 - 12 - 11));
} | rust_cleaned_test_functions.jsonl/21441 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 225
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15227,
4164,
368,
341,
262,
1077,
6607,
284,
508,
15,
26,
220,
19,
935,
262,
1077,
2400,
25,
2631,
284,
50194,
27638,
4133,
17818,
6831,
18196,
5304,
70,
1130,
486,
1499,
12524,
2099,
5909,
4579... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_nbf() {
let key_set = KeyStore::new();
let jwk = key_set.decode(TOKEN).unwrap();
let time = SystemTime::UNIX_EPOCH + Duration::new(TIME_NBF - 1, 0);
assert!(jwk.early_time(time).unwrap());
} | rust_cleaned_test_functions.jsonl/124814 | {
"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,
1089,
13233,
368,
341,
286,
1077,
1376,
2602,
284,
5309,
6093,
486,
931,
1428,
286,
1077,
502,
50522,
284,
1376,
2602,
15922,
4140,
12900,
568,
15454,
1428,
286,
1077,
882,
284,
739,
1462,
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_eval_ite() {
let e = Expr::list(&[
Expr::symbol("if"),
Expr::list(&[Expr::symbol("True")]),
Expr::list(&[Expr::symbol("x")]),
Expr::list(&[Expr::symbol("y")]),
]);
let mut env = Environment::default();
let result = eval(e, &mut env);
if let EvalResult::Expr(expr) = result {
assert_eq!(Expr::list(&[Expr::symbol("x".into())]), expr);
} else {
assert!(false, "Expected expression, got {:?}", result);
}
} | rust_cleaned_test_functions.jsonl/55388 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 294
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21296,
62,
632,
368,
341,
286,
1077,
384,
284,
28819,
486,
1607,
2099,
9640,
310,
28819,
486,
18785,
445,
333,
4461,
310,
28819,
486,
1607,
2099,
58,
16041,
486,
18785,
445,
2514,
899,
17036,
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_filter_array_high_density() {
// this test exercises the all 1's branch of the filter algorithm
let mut data_values = (1..=65).map(Some).collect::<Vec<_>>();
let mut filter_values = (1..=65)
.map(|i| !matches!(i % 65, 0))
.collect::<Vec<bool>>();
// set second data value to null
data_values[1] = None;
// set up two more values after the batch
data_values.extend_from_slice(&[Some(66), None, Some(67), None]);
filter_values.extend_from_slice(&[false, true, true, true]);
let a = Int32Array::from(data_values);
let b = BooleanArray::from(filter_values);
let c = filter(&a, &b).unwrap();
let d = c.as_ref().as_any().downcast_ref::<Int32Array>().unwrap();
assert_eq!(67, d.len());
assert_eq!(3, d.null_count());
assert_eq!(1, d.value(0));
assert_eq!(true, d.is_null(1));
assert_eq!(64, d.value(63));
assert_eq!(true, d.is_null(64));
assert_eq!(67, d.value(65));
} | rust_cleaned_test_functions.jsonl/28227 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 508
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8727,
3858,
22680,
53349,
368,
341,
286,
442,
419,
1273,
22932,
279,
678,
220,
16,
594,
8870,
315,
279,
4051,
12111,
198,
286,
1077,
5206,
821,
9146,
284,
320,
16,
496,
28,
21,
20,
568,
2186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_insult_to_html() {
let insult = Insult::new("Rust, motherfucker, do you speak it?".to_string(), "UnitTest".to_string());
let insult = insult.render(ContentType::Html);
assert!(insult.contains("<h1 class=\"title\">Rust"));
assert!(insult.contains("<h2 class=\"subtitle\">UnitTest</h2>"));
} | rust_cleaned_test_functions.jsonl/102758 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 129
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34386,
494,
2346,
9564,
368,
341,
262,
1077,
26132,
284,
9726,
494,
486,
931,
445,
49,
590,
11,
6554,
69,
24370,
11,
653,
498,
6468,
432,
30,
3263,
983,
3904,
1507,
330,
97330,
3263,
983,
3904... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_record_literal_enum_variant() {
check(
r#"
enum E { A { a: u32 } }
fn foo() {
let _ = E::A { $0 }
}
"#,
expect![[r#"
fd a u32
"#]],
);
} | rust_cleaned_test_functions.jsonl/39748 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 155
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14192,
34100,
31054,
46112,
368,
341,
286,
1779,
1006,
310,
435,
2,
698,
9018,
468,
314,
362,
314,
264,
25,
575,
18,
17,
335,
456,
8822,
15229,
368,
341,
262,
1077,
716,
284,
468,
486,
32,
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_check_tx_durable_nonce_ok() {
let (bank, _mint_keypair, custodian_keypair, nonce_keypair) =
setup_nonce_with_bank(10_000_000, |_| {}, 5_000_000, 250_000, None).unwrap();
let custodian_pubkey = custodian_keypair.pubkey();
let nonce_pubkey = nonce_keypair.pubkey();
let nonce_hash = get_nonce_account(&bank, &nonce_pubkey).unwrap();
let tx = Transaction::new_signed_with_payer(
&[
system_instruction::advance_nonce_account(&nonce_pubkey, &nonce_pubkey),
system_instruction::transfer(&custodian_pubkey, &nonce_pubkey, 100_000),
],
Some(&custodian_pubkey),
&[&custodian_keypair, &nonce_keypair],
nonce_hash,
);
let nonce_account = bank.get_account(&nonce_pubkey).unwrap();
assert_eq!(
bank.check_tx_durable_nonce(&tx),
Some((nonce_pubkey, nonce_account))
);
} | rust_cleaned_test_functions.jsonl/2617 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 503
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
17805,
814,
18329,
48508,
19817,
368,
341,
286,
1077,
320,
17033,
11,
716,
67791,
3097,
12670,
11,
16564,
63849,
3097,
12670,
11,
39676,
3097,
12670,
8,
4035,
310,
6505,
48508,
6615,
35733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_next() {
let mut ema = ExponentialMovingAverage::new(3).unwrap();
assert_eq!(ema.next(2.0), 2.0);
assert_eq!(ema.next(5.0), 3.5);
assert_eq!(ema.next(1.0), 2.25);
assert_eq!(ema.next(6.25), 4.25);
let mut ema = ExponentialMovingAverage::new(3).unwrap();
let bar1 = Bar::new().close(2);
let bar2 = Bar::new().close(5);
assert_eq!(ema.next(&bar1), 2.0);
assert_eq!(ema.next(&bar2), 3.5);
} | rust_cleaned_test_functions.jsonl/124094 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 260
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11257,
368,
341,
286,
1077,
5206,
976,
64,
284,
1374,
59825,
39732,
26292,
486,
931,
7,
18,
568,
15454,
1428,
286,
2060,
10714,
10297,
9176,
4529,
7,
17,
13,
15,
701,
220,
17,
13,
15,
317,
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_batch_matmul_trans_square_lhs() {
// blas is used
with(|g: &mut ag::Graph<f32>| {
let a_: ag::Tensor<f32> = g.constant(array![[[1., 2.], [3., 4.]], [[1., 2.], [3., 4.]]]);
let a: ag::Tensor<f32> = g.transpose(a_, &[0, 2, 1]);
let b: ag::Tensor<f32> = g.constant(array![[[1., 2.], [3., 4.]], [[1., 2.], [3., 4.]]]);
let c = g.batch_matmul(a, b);
let ans = array![[[10., 14.], [14., 20.]], [[10., 14.], [14., 20.]]].into_dyn();
let ret = c.eval(&[]).unwrap();
assert!(ret.all_close(&ans, 1e-4));
assert_eq!(ret.shape(), &[2, 2, 2]);
});
} | rust_cleaned_test_functions.jsonl/22776 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 343
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14534,
16610,
24160,
7965,
39794,
84284,
368,
341,
262,
442,
48577,
374,
1483,
198,
262,
448,
22428,
70,
25,
609,
6984,
933,
486,
11212,
63895,
18,
17,
69844,
341,
286,
1077,
264,
23211,
933,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_conflicting_ns_funcs() {
let cxx = indoc! {"
uint32_t A::get() { return 10; }
uint32_t B::get() { return 20; }
"};
let hdr = indoc! {"
#include <cstdint>
namespace A {
uint32_t get();
}
namespace B {
uint32_t get();
}
"};
let rs = quote! {
assert_eq!(ffi::A::get(), 10);
assert_eq!(ffi::B::get(), 20);
};
run_test(cxx, hdr, rs, &["A::get", "B::get"], &[]);
} | rust_cleaned_test_functions.jsonl/9810 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 284
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16059,
78208,
34728,
64124,
368,
341,
262,
1077,
272,
4146,
284,
1257,
509,
0,
314,
698,
286,
2622,
18,
17,
528,
362,
486,
455,
368,
314,
470,
220,
16,
15,
26,
456,
286,
2622,
18,
17,
528,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_done() {
let subcommand = Subcommand::Modify {
filter: Filter {
conditions: vec![Condition::IdList(vec![TaskId::WorkingSetId(123)])],
},
modification: Modification {
status: Some(Status::Completed),
..Default::default()
},
};
assert_eq!(
Subcommand::parse(argv!["123", "done"]).unwrap(),
(&EMPTY[..], subcommand)
);
} | rust_cleaned_test_functions.jsonl/84277 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 266
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
24390,
368,
341,
286,
1077,
1186,
5631,
284,
3719,
5631,
486,
44427,
341,
310,
4051,
25,
12339,
341,
394,
4682,
25,
7486,
20703,
10547,
486,
764,
852,
25592,
20703,
6262,
764,
486,
33978,
1649,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ccw_iterator() {
let mut dcel = DCEL::new();
let mut vs = Vec::new();
let central = dcel.insert_vertex(());
assert_eq!(dcel.vertex(central).ccw_out_edges().next(), None);
for _ in 0..5 {
vs.push(dcel.insert_vertex(()));
}
let mut last_edge = dcel.connect_two_isolated_vertices(central, vs[0], 0);
last_edge = dcel.edge(last_edge).sym().fix();
for vertex in &vs[1..] {
last_edge = dcel.connect_edge_to_isolated_vertex(last_edge, *vertex);
last_edge = dcel.edge(last_edge).sym().fix();
}
let out_edge = dcel.vertex(central).out_edge().unwrap();
let mut neighs: Vec<_> = out_edge.ccw_iter().map(|e| e.to().fix()).collect();
assert_eq!(neighs.len(), 5);
for i in 0..5 {
let first = neighs[i];
let second = neighs[(i + 1) % 5];
assert_eq!(first - 1, second % 5);
}
let revs: Vec<_> = out_edge.ccw_iter().rev().map(|e| e.to().fix()).collect();
neighs.reverse();
assert_eq!(neighs, revs);
} | rust_cleaned_test_functions.jsonl/7379 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 575
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
28955,
86,
13491,
368,
341,
286,
1077,
5206,
294,
3672,
284,
422,
41664,
486,
931,
543,
286,
1077,
5206,
6165,
284,
11312,
486,
931,
543,
286,
1077,
8622,
284,
294,
3672,
7030,
26611,
7,
1423,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 4 |
#[test]
fn test_filter_bitmask() {
assert_eq!(filter_bitmask(0, 1), 0x1);
assert_eq!(filter_bitmask(1, 1), 0b10);
assert_eq!(filter_bitmask(0, 4), 0xf);
assert_eq!(filter_bitmask(1, 3), 0xe);
assert_eq!(filter_bitmask(8, 1), 0x100);
assert_eq!(filter_bitmask(8, 4), 0xf00);
} | rust_cleaned_test_functions.jsonl/21598 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 179
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8727,
13996,
11258,
368,
341,
286,
2060,
10714,
10297,
5315,
13996,
11258,
7,
15,
11,
220,
16,
701,
220,
15,
87,
16,
317,
286,
2060,
10714,
10297,
5315,
13996,
11258,
7,
16,
11,
220,
16,
701,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_pcr() {
let mut p = PacketInfo::null_packet();
let pcr: u64 = 23647;
p.set_pcr(pcr);
assert!(p.has_pcr());
assert_eq!(p.pcr(), pcr);
} | rust_cleaned_test_functions.jsonl/47194 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 119
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
620,
5082,
368,
341,
286,
1077,
5206,
281,
284,
28889,
1731,
486,
2921,
21078,
543,
286,
1077,
281,
5082,
25,
575,
21,
19,
284,
220,
17,
18,
21,
19,
22,
280,
286,
281,
980,
620,
5082,
1295,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_enum_as_json() {
test_none_with_extra(cast_enum_as_json);
let mut jo1: BTreeMap<String, Json> = BTreeMap::new();
jo1.insert(
String::from("a"),
Json::from_string(String::from("b")).unwrap(),
);
// HasParseToJSONFlag
let cs = vec![
(
EnumRef::new("{\"a\": \"b\"}".as_bytes(), &1),
Json::from_object(jo1).unwrap(),
true,
),
(
EnumRef::new("{}".as_bytes(), &1),
Json::from_object(BTreeMap::new()).unwrap(),
true,
),
(
EnumRef::new("[1, 2, 3]".as_bytes(), &1),
Json::from_array(vec![
Json::from_i64(1).unwrap(),
Json::from_i64(2).unwrap(),
Json::from_i64(3).unwrap(),
])
.unwrap(),
true,
),
(
EnumRef::new("[]".as_bytes(), &1),
Json::from_array(Vec::new()).unwrap(),
true,
),
(
EnumRef::new("9223372036854775807".as_bytes(), &1),
Json::from_i64(9223372036854775807).unwrap(),
true,
),
(
EnumRef::new("-9223372036854775808".as_bytes(), &1),
Json::from_i64(-9223372036854775808).unwrap(),
true,
),
(
EnumRef::new("18446744073709551615".as_bytes(), &1),
Json::from_f64(18446744073709552000.0).unwrap(),
true,
),
(
EnumRef::new("0.0".as_bytes(), &1),
Json::from_f64(0.0).unwrap(),
true,
),
(
EnumRef::new("\"abcde\"".as_bytes(), &1),
Json::from_string("abcde".to_string()).unwrap(),
true,
),
(
EnumRef::new("\"\"".as_bytes(), &1),
Json::from_string("".to_string()).unwrap(),
true,
),
(
EnumRef::new("true".as_bytes(), &1),
Json::from_bool(true).unwrap(),
true,
),
(
EnumRef::new("false".as_bytes(), &1),
Json::from_bool(false).unwrap(),
true,
),
];
for (input, expect, parse_to_json) in cs {
let mut rft = FieldType::default();
if parse_to_json {
let fta = rft.as_mut_accessor();
fta.set_flag(FieldTypeFlag::PARSE_TO_JSON);
}
let extra = make_extra(&rft);
let result = cast_enum_as_json(&extra, Some(input));
let result_str = result.as_ref().map(|x| x.as_ref().map(|x| x.to_string()));
let log = format!(
"input: {}, parse_to_json: {}, expect: {:?}, result: {:?}",
input, parse_to_json, expect, result_str
);
check_result(Some(&expect), &result, log.as_str());
}
} | rust_cleaned_test_functions.jsonl/103222 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2055
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31054,
11898,
9455,
368,
341,
286,
1273,
31488,
6615,
31858,
1337,
559,
31054,
11898,
9455,
626,
286,
1077,
5206,
7647,
16,
25,
425,
6533,
2227,
3464,
11,
8308,
29,
284,
425,
6533,
2227,
486,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_gen_changelog_lint_list() {
let lints = vec![
Lint::new("should_assert_eq", "group1", "abc", None, "module_name"),
Lint::new("should_assert_eq2", "group2", "abc", None, "module_name"),
Lint::new("incorrect_internal", "internal_style", "abc", None, "module_name"),
];
let expected = vec![
format!("[`should_assert_eq`]: {}#should_assert_eq", DOCS_LINK.to_string()),
format!("[`should_assert_eq2`]: {}#should_assert_eq2", DOCS_LINK.to_string()),
];
assert_eq!(expected, gen_changelog_lint_list(lints));
} | rust_cleaned_test_functions.jsonl/1260 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 264
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16322,
4138,
61873,
907,
396,
2019,
368,
341,
262,
1077,
326,
21042,
284,
7486,
90515,
286,
444,
396,
486,
931,
445,
5445,
16553,
10714,
497,
330,
4074,
16,
497,
330,
13683,
497,
2240,
11,
330,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_clear() {
let mut cache = LruCache::new(2);
cache.put("apple", "red");
cache.put("banana", "yellow");
assert_eq!(cache.len(), 2);
assert_opt_eq(cache.get(&"apple"), "red");
assert_opt_eq(cache.get(&"banana"), "yellow");
cache.clear();
assert_eq!(cache.len(), 0);
} | rust_cleaned_test_functions.jsonl/77944 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 176
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21811,
368,
341,
286,
1077,
5206,
6500,
284,
444,
2672,
8233,
486,
931,
7,
17,
626,
286,
6500,
3597,
445,
22377,
497,
330,
1151,
797,
286,
6500,
3597,
445,
87747,
497,
330,
27869,
3071,
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_scrypt() {
let salt = botan::hex_decode("4E61436C").unwrap();
let n = 1024;
let r = 8;
let p = 16;
let passphrase = "password";
let expected_output = botan::hex_decode("fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622e").unwrap();
let output = botan::scrypt(expected_output.len(), passphrase, &salt, n, r, p).unwrap();
assert_eq!(output, expected_output);
} | rust_cleaned_test_functions.jsonl/95294 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 193
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13171,
3571,
368,
1476,
262,
1077,
12021,
284,
10924,
276,
486,
17308,
15227,
445,
19,
36,
21,
16,
19,
18,
21,
34,
1827,
15454,
543,
262,
1077,
308,
284,
220,
16,
15,
17,
19,
280,
262,
1077,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_quick_error() {
let expanded = parse_macro(
r#"
macro_rules! quick_error {
(SORT [enum $name:ident $( #[$meta:meta] )*]
items [$($( #[$imeta:meta] )*
=> $iitem:ident: $imode:tt [$( $ivar:ident: $ityp:ty ),*]
{$( $ifuncs:tt )*} )* ]
buf [ ]
queue [ ]
) => {
quick_error!(ENUMINITION [enum $name $( #[$meta] )*]
body []
queue [$(
$( #[$imeta] )*
=>
$iitem: $imode [$( $ivar: $ityp ),*]
)*]
);
};
}
"#,
)
.expand_tt(
r#"
quick_error ! (SORT [enum Wrapped # [derive (Debug)]] items [
=> One : UNIT [] {}
=> Two : TUPLE [s :String] {display ("two: {}" , s) from ()}
] buf [] queue []) ;
"#,
);
assert_eq!(expanded.to_string(), "quick_error ! (ENUMINITION [enum Wrapped # [derive (Debug)]] body [] queue [=> One : UNIT [] => Two : TUPLE [s : String]]) ;");
} | rust_cleaned_test_functions.jsonl/28771 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 569
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
82094,
4096,
368,
341,
262,
1077,
17183,
284,
4715,
58810,
1006,
286,
435,
2,
698,
32606,
21407,
0,
3974,
4096,
1476,
320,
80177,
508,
9018,
400,
606,
25,
1713,
4930,
671,
3442,
5490,
25,
5490,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_constructor_make_unique() {
let hdr = indoc! {"
#include <stdint.h>
struct A {
uint32_t a;
};
"};
let rs = quote! {
ffi::A::make_unique();
};
run_test("", hdr, rs, &["A"], &[]);
} | rust_cleaned_test_functions.jsonl/9960 | {
"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,
6536,
66210,
28230,
21218,
368,
341,
262,
1077,
36615,
284,
1257,
509,
0,
314,
698,
262,
671,
997,
366,
31435,
860,
397,
262,
2036,
362,
341,
286,
2622,
18,
17,
528,
264,
280,
262,
2605,
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_issue_186() {
let img: RgbImage = ImageBuffer::new(100, 100);
let _ = resize(&img, 50, 50, FilterType::Lanczos3);
} | rust_cleaned_test_functions.jsonl/984 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 75
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53340,
62,
16,
23,
21,
368,
341,
286,
1077,
4964,
25,
431,
9511,
1906,
284,
4654,
4095,
486,
931,
7,
16,
15,
15,
11,
220,
16,
15,
15,
317,
286,
1077,
716,
284,
20925,
2099,
1892,
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 |
#[test]
fn test_insert_into_array() {
given(r#"
a = [1,2,3]
b = []"#
).running(|root| {
{
let a = root.entry("a");
let a = as_array!(a);
assert_eq!(a.len(), 3);
assert!(a.get(2).is_some());
assert!(a.push(4));
assert_eq!(a.len(), 4);
a.fmt();
}
let b = root.entry("b");
let b = as_array!(b);
assert!(b.is_empty());
assert!(b.push("hello"));
assert_eq!(b.len(), 1);
}).produces(r#"
a = [1, 2, 3, 4]
b = ["hello"]
"#
);
} | rust_cleaned_test_functions.jsonl/36885 | {
"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,
17678,
45514,
3858,
368,
341,
262,
2661,
2601,
2,
698,
286,
264,
284,
508,
16,
11,
17,
11,
18,
921,
286,
293,
284,
3056,
1,
4956,
262,
7457,
27173,
22428,
2888,
91,
341,
286,
341,
310,
1077,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_fq2_negation() {
use super::fq::FqRepr;
use ff::PrimeField;
let a = Fq2 {
c0: Fq::from_repr(FqRepr([
0x00, 0xf8, 0xd2, 0x95, 0xb2, 0xde, 0xd9, 0xdc, 0xcc, 0xc6, 0x49, 0xc4, 0xb9, 0x53,
0x2b, 0xf3, 0xb9, 0x66, 0xce, 0x3b, 0xc2, 0x10, 0x8b, 0x13, 0x8b, 0x1a, 0x52, 0xe0,
0xa9, 0x0f, 0x59, 0xed, 0x11, 0xe5, 0x9e, 0xa2, 0x21, 0xa3, 0xb6, 0xd2, 0x2d, 0x00,
0x78, 0x03, 0x69, 0x23, 0xff, 0xc7,
]))
.unwrap(),
c1: Fq::from_repr(FqRepr([
0x01, 0x2d, 0x11, 0x37, 0xb8, 0xa6, 0xa8, 0x37, 0x4e, 0x46, 0x4d, 0xea, 0x5b, 0xcf,
0xd4, 0x1e, 0xb3, 0xf8, 0xaf, 0xc0, 0xee, 0x24, 0x8c, 0xad, 0xbe, 0x20, 0x34, 0x11,
0xc6, 0x6f, 0xb3, 0xa5, 0x94, 0x6a, 0xe5, 0x2d, 0x68, 0x4f, 0xa7, 0xed, 0x97, 0x7d,
0xf6, 0xef, 0xcd, 0xae, 0xe0, 0xdb,
]))
.unwrap(),
}
.neg();
assert_eq!(
a,
Fq2 {
c0: Fq::from_repr(FqRepr([
0x19, 0x08, 0x3f, 0x54, 0x86, 0xa1, 0x0c, 0xbd, 0x7e, 0x55, 0x5d, 0xf1, 0x89, 0xf8,
0x80, 0xe3, 0xab, 0x10, 0x7d, 0x49, 0x31, 0x74, 0x87, 0xab, 0xdc, 0x16, 0x7f, 0xc0,
0x4d, 0xa1, 0x9c, 0x37, 0x0c, 0xc6, 0x61, 0x5c, 0x8f, 0xb0, 0x49, 0x2d, 0x8c, 0xfe,
0x87, 0xfc, 0x96, 0xdb, 0xaa, 0xe4,
]))
.unwrap(),
c1: Fq::from_repr(FqRepr([
0x18, 0xd4, 0x00, 0xb2, 0x80, 0xd9, 0x3e, 0x62, 0xfc, 0xd5, 0x59, 0xcb, 0xe7, 0x7b,
0xd8, 0xb8, 0xb0, 0x7e, 0x9b, 0xc4, 0x05, 0x60, 0x86, 0x11, 0xa9, 0x10, 0x9e, 0x8f,
0x30, 0x41, 0x42, 0x7e, 0x8a, 0x41, 0x1a, 0xd1, 0x49, 0x04, 0x58, 0x12, 0x22, 0x81,
0x09, 0x10, 0x32, 0x50, 0xc9, 0xd0,
]))
.unwrap(),
}
);
} | rust_cleaned_test_functions.jsonl/45346 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1357
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
761,
80,
17,
28209,
367,
368,
341,
262,
990,
2256,
486,
63919,
486,
37,
80,
693,
649,
280,
262,
990,
25539,
486,
32306,
1877,
401,
262,
1077,
264,
284,
434,
80,
17,
341,
286,
272,
15,
25,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_from_str_radix() {
let r = to_str_pairs();
for num_pair in r.iter() {
let &(ref n, ref rs) = num_pair;
for str_pair in rs.iter() {
let &(ref radix, ref str) = str_pair;
assert_eq!(n,
&BigUint::from_str_radix(str, *radix).unwrap());
}
}
let zed = BigUint::from_str_radix("Z", 10).ok();
assert_eq!(zed, None);
let blank = BigUint::from_str_radix("_", 2).ok();
assert_eq!(blank, None);
let minus_one = BigUint::from_str_radix("-1", 10).ok();
assert_eq!(minus_one, None);
} | rust_cleaned_test_functions.jsonl/90140 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 376
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5673,
2895,
39764,
941,
368,
341,
286,
1077,
435,
284,
311,
2895,
36430,
543,
286,
369,
1629,
14445,
304,
435,
19471,
368,
341,
310,
1077,
22796,
1097,
308,
11,
2053,
10036,
8,
284,
1629,
14445,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_array_schema() {
check_schema(
r#"{"type": "array", "items": "string"}"#,
SchemaPiece::Array(Box::new(SchemaPieceOrNamed::Piece(SchemaPiece::String))),
);
} | rust_cleaned_test_functions.jsonl/23002 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 119
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3858,
25371,
368,
341,
286,
1779,
25371,
1006,
310,
435,
55543,
4913,
1313,
788,
330,
1653,
497,
330,
3615,
788,
330,
917,
9207,
57676,
345,
310,
12539,
31209,
486,
1857,
67758,
486,
931,
3759,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_encoding_function_input_as_fixed_array() {
use validators::functions;
let first = [0x11u8; 20];
let second = [0x22u8; 20];
let encoded_from_array = functions::add_two_validators::encode_input([first.clone(), second.clone()]);
let encoded_from_array_wrapped = functions::add_two_validators::encode_input([Wrapper(first), Wrapper(second)]);
let encoded_from_string = functions::set_title::encode_input("foo");
let expected_array = "7de33d2000000000000000000000000011111111111111111111111111111111111111110000000000000000000000002222222222222222222222222222222222222222".to_owned();
let expected_string = "72910be000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003666f6f0000000000000000000000000000000000000000000000000000000000".to_owned();
assert_eq!(expected_array, encoded_from_array.to_hex::<String>());
assert_eq!(expected_array, encoded_from_array_wrapped.to_hex::<String>());
assert_eq!(expected_string, encoded_from_string.to_hex::<String>())
} | rust_cleaned_test_functions.jsonl/20150 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 338
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
37613,
9174,
5898,
11898,
37839,
3858,
368,
341,
197,
41819,
38588,
486,
21409,
401,
197,
10217,
1156,
284,
508,
15,
87,
16,
16,
84,
23,
26,
220,
17,
15,
935,
197,
10217,
2086,
284,
508,
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_index() {
fn prop(v3: Vec3) -> bool {
v3[0] == v3.x &&
v3[1] == v3.y &&
v3[2] == v3.z
}
quickcheck(prop as fn(Vec3) -> bool);
} | rust_cleaned_test_functions.jsonl/114285 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 141
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3560,
368,
341,
286,
5168,
2004,
3747,
18,
25,
11312,
18,
8,
1464,
1807,
341,
310,
348,
18,
58,
15,
60,
621,
348,
18,
1993,
6561,
310,
348,
18,
58,
16,
60,
621,
348,
18,
2384,
6561,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_try_from_put_drives() {
let (mut sender, receiver) = UnixStream::pair().unwrap();
let mut connection = HttpConnection::new(receiver);
let body = "{ \
\"drive_id\": \"string\", \
\"path_on_host\": \"string\", \
\"is_root_device\": true, \
\"partuuid\": \"string\", \
\"is_read_only\": true, \
\"cache_type\": \"Unsafe\", \
\"rate_limiter\": { \
\"bandwidth\": { \
\"size\": 0, \
\"one_time_burst\": 0, \
\"refill_time\": 0 \
}, \
\"ops\": { \
\"size\": 0, \
\"one_time_burst\": 0, \
\"refill_time\": 0 \
} \
} \
}";
sender
.write_all(http_request("PUT", "/drives/string", Some(&body)).as_bytes())
.unwrap();
assert!(connection.try_read().is_ok());
let req = connection.pop_parsed_request().unwrap();
assert!(ParsedRequest::try_from_request(&req).is_ok());
} | rust_cleaned_test_functions.jsonl/106580 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 644
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53283,
5673,
15557,
26680,
1886,
368,
341,
286,
1077,
320,
6984,
4646,
11,
13964,
8,
284,
46995,
3027,
486,
12670,
1005,
15454,
543,
286,
1077,
5206,
3633,
284,
4823,
4526,
486,
931,
78126,
317,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_reorg_claims_x() -> Result<(), Error> {
// Test configuration
const NUM_BLOCKS_MAIN: u64 = 6; // Number of blocks to mine in main chain
const REORG_DEPTH: u64 = 5; // Number of blocks to be discarded from main chain after reorg
const DIR_NAME: &str = ".bmw_reorg2";
clean_output_dir(DIR_NAME);
global::set_local_chain_type(ChainTypes::AutomatedTesting);
let kc = ExtKeychain::from_random_seed(false).unwrap();
// build claim tx
let binary_location = "./tests/resources/gen_bin1.bin";
let keychain = ExtKeychain::from_seed(&[0; 32], true).unwrap();
let builder = ProofBuilder::new(&keychain);
let mut utxo_data = UtxoData::new(ChainType::Bypass).unwrap();
utxo_data.load_binary(binary_location)?;
let utxo_data = Arc::new(RwLock::new(utxo_data));
let mut sig_vec = Vec::new();
let mut rec_id_vec = Vec::new();
let signatures = vec![
"IBhOFbM5gg+HBTL0tTxgO1a9fTuO+gTuRAyaBJ9jmeLnDFTTii6yINcFeOJ6m2pO/cN12Bg971n5aS5EbUTQs/c="
.to_string(),
];
let fee = 100;
let amount = 100_000_000_000_000;
let index = 0;
for sig in signatures {
let signature = base64::decode(sig).unwrap();
let recid = RecoveryId::from_i32(i32::from((signature[0] - 27) & 3)).unwrap();
let recsig = RecoverableSignature::from_compact(&signature[1..], recid).unwrap();
sig_vec.push(recsig);
rec_id_vec.push(signature[0]);
}
let pri_view = SecretKey::from_slice(
&keychain.secp(),
&[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1 + index as u8,
],
)
.unwrap();
let pub_view = PublicKey::from_secret_key(keychain.secp(), &pri_view).unwrap();
let recipient_addr = Address::from_one_pubkey(&pub_view, global::ChainTypes::AutomatedTesting);
let (out, kern) = reward::output_btc_claim(
&keychain,
&builder,
recipient_addr,
fee,
true,
amount,
index,
sig_vec.clone(),
rec_id_vec.clone(),
None,
0,
Some(pri_view),
PaymentId::new(),
)
.unwrap();
let tx1 = Transaction {
offset: BlindingFactor::zero(),
body: TransactionBody {
inputs: Inputs(Vec::new()),
outputs: vec![out],
kernels: vec![kern],
},
};
let fee = 101;
let signatures = vec![
"IEcBejZXsar/M7ovQD3yF3auTAmyLmmb+SBp/Eyh7v8iTjI8s+fKFET2PihJgUneHtRDDiZcj8aFx+DKJ3x1BcI="
.to_string(),
];
let mut sig_vec = Vec::new();
let mut rec_id_vec = Vec::new();
for sig in signatures {
let signature = base64::decode(sig).unwrap();
let recid = RecoveryId::from_i32(i32::from((signature[0] - 27) & 3)).unwrap();
let recsig = RecoverableSignature::from_compact(&signature[1..], recid).unwrap();
sig_vec.push(recsig);
rec_id_vec.push(signature[0]);
}
let pri_view = SecretKey::from_slice(
&keychain.secp(),
&[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1 + index as u8,
],
)
.unwrap();
let pub_view = PublicKey::from_secret_key(keychain.secp(), &pri_view).unwrap();
let recipient_addr = Address::from_one_pubkey(&pub_view, global::ChainTypes::AutomatedTesting);
let (out, kern) = reward::output_btc_claim(
&keychain,
&builder,
recipient_addr,
fee,
true,
amount,
index,
sig_vec,
rec_id_vec,
None,
0,
Some(pri_view),
PaymentId::new(),
)
.unwrap();
let tx2 = Transaction {
offset: BlindingFactor::zero(),
body: TransactionBody {
inputs: Inputs(Vec::new()),
outputs: vec![out],
kernels: vec![kern],
},
};
let valid = tx1.validate(
Weighting::AsTransaction,
verifier_cache(),
100,
Some(Arc::downgrade(&utxo_data)),
None,
);
assert_eq!(valid.is_ok(), true);
let valid = tx2.validate(
Weighting::AsTransaction,
verifier_cache(),
101,
Some(Arc::downgrade(&utxo_data)),
None,
);
assert_eq!(valid.is_ok(), true);
let genesis = pow::mine_genesis_block().unwrap();
{
// Create chain that reports last block status
let last_status = RwLock::new(None);
let adapter = Arc::new(StatusAdapter::new(last_status));
let chain = setup_with_status_adapter(
DIR_NAME,
genesis.clone(),
adapter.clone(),
Some(Arc::downgrade(&utxo_data)),
);
// Add blocks to main chain with gradually increasing difficulty
let mut prev = chain.head_header().unwrap();
for n in 1..=NUM_BLOCKS_MAIN {
let b = if n == NUM_BLOCKS_MAIN - 1 {
prepare_block_tx(&kc, &prev, &chain, n, &[tx1.clone()])
} else {
prepare_block(&kc, &prev, &chain, n)
};
prev = b.header.clone();
chain.process_block(b, chain::Options::SKIP_POW).unwrap();
}
let head = chain.head().unwrap();
assert_eq!(head.height, NUM_BLOCKS_MAIN);
assert_eq!(head.hash(), prev.hash());
// Reorg chain should exceed main chain's total difficulty to be considered
// but first a small block
let fork_head = chain
.get_header_by_height(NUM_BLOCKS_MAIN - REORG_DEPTH)
.unwrap();
let b = prepare_block(&kc, &fork_head, &chain, 2);
chain
.process_block(b.clone(), chain::Options::SKIP_POW)
.unwrap();
let reorg_difficulty = head.total_difficulty.to_num();
let b = prepare_block_tx(
&kc,
&b.header.clone(),
&chain,
reorg_difficulty,
&[tx1.clone()],
);
let reorg_head = b.header.clone();
chain
.process_block(b.clone(), chain::Options::SKIP_POW)
.unwrap();
// Chain should be switched to the reorganized chain
let head = chain.head().unwrap();
assert_eq!(head.height, NUM_BLOCKS_MAIN - REORG_DEPTH + 2);
assert_eq!(head.hash(), reorg_head.hash());
let prev = b.header.clone();
let b = prepare_block_tx(&kc, &prev, &chain, reorg_difficulty, &[tx2.clone()]);
let res = chain.process_block(b.clone(), chain::Options::SKIP_POW);
// this is an error because this one was already claimed.
assert_eq!(res.is_err(), true);
}
// Cleanup chain directory
clean_output_dir(DIR_NAME);
Ok(())
} | rust_cleaned_test_functions.jsonl/90401 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2759
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1288,
1775,
6794,
25676,
3212,
368,
1464,
5714,
68843,
4600,
29,
341,
197,
322,
3393,
6546,
198,
4777,
15943,
86542,
32276,
25,
575,
21,
19,
284,
220,
21,
26,
442,
5624,
315,
10010,
311,
10485,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_submit_params_cmp() {
let submit_params_1 = SubmissionParameters {
account_id: 1337,
nonce: 12,
height: 112,
block: 0,
deadline_unadjusted: 7123,
deadline: 1193,
gen_sig: [0; 32],
};
let mut submit_params_2 = submit_params_1.clone();
submit_params_2.block += 1;
assert!(submit_params_1 < submit_params_2);
let mut submit_params_2 = submit_params_1.clone();
submit_params_2.deadline -= 1;
assert!(submit_params_1 < submit_params_2);
let mut submit_params_2 = submit_params_1.clone();
submit_params_2.gen_sig[0] = 1;
submit_params_2.deadline += 1;
assert!(submit_params_1 < submit_params_2);
let mut submit_params_2 = submit_params_1.clone();
submit_params_2.deadline += 1;
assert!(submit_params_1 > submit_params_2);
} | rust_cleaned_test_functions.jsonl/89909 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 467
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31674,
6745,
35193,
368,
341,
286,
1077,
9318,
6745,
62,
16,
284,
58734,
9706,
341,
310,
2692,
842,
25,
220,
16,
18,
18,
22,
345,
310,
39676,
25,
220,
16,
17,
345,
310,
2608,
25,
220,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_new() {
let pos = position!(1.0, 10.0, 3.0, 115.0, -3.0);
let vel = vec3(0.0, 1.0, 2.0);
let data = BaseEntityData::new(pos, vel);
assert_eq!(data.read_position(), Ok(pos));
assert_eq!(data.read_velocity(), Ok(vel));
} | rust_cleaned_test_functions.jsonl/50449 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 151
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5921,
368,
341,
286,
1077,
1133,
284,
2309,
10297,
16,
13,
15,
11,
220,
16,
15,
13,
15,
11,
220,
18,
13,
15,
11,
220,
16,
16,
20,
13,
15,
11,
481,
18,
13,
15,
317,
286,
1077,
9054,
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_basic_highlight_decl_no_write() {
check(
r#"
fn foo() {
let i<|>;
i = 1;
}
"#,
expect![[r#"
i Local FileId(0) 19..20 Other
FileId(0) 26..27 Other Write
"#]],
);
} | rust_cleaned_test_functions.jsonl/47783 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 180
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34729,
74546,
35814,
6536,
9165,
368,
341,
286,
1779,
1006,
310,
435,
2,
698,
8822,
15229,
368,
341,
262,
1077,
600,
27,
91,
10133,
262,
600,
284,
220,
16,
280,
532,
57676,
345,
310,
1720,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_lion() {
let key = randombytes(32);
let message = randombytes(1024);
let mut message_clone = message.clone();
lion_transform(&mut message_clone[..], &key[..], [1, 1, 1]);
assert!(&message_clone[..] != &message[..]);
lion_transform(&mut message_clone[..], &key[..], [1, 1, 1]);
assert!(&message_clone[..] == &message[..]);
} | rust_cleaned_test_functions.jsonl/114622 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 181
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
907,
290,
368,
341,
286,
1077,
1376,
284,
4194,
9651,
7,
18,
17,
317,
286,
1077,
1943,
284,
4194,
9651,
7,
16,
15,
17,
19,
626,
286,
1077,
5206,
1943,
54742,
284,
1943,
15997,
543,
286,
3903... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_describe_account_override() {
println!("Running test_describe_account_override");
verify_account_override(LoginOverride::AutologinGuest, "autologinguest");
verify_account_override(LoginOverride::None, "none");
verify_account_override(LoginOverride::AuthProvider, "auth");
} | rust_cleaned_test_functions.jsonl/60456 | {
"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,
15768,
3114,
13500,
48576,
368,
341,
286,
13751,
17223,
18990,
1273,
15768,
3114,
13500,
48576,
797,
286,
10146,
13500,
48576,
44862,
2177,
486,
19602,
1609,
258,
37804,
11,
330,
2717,
1609,
287,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_wasi_get_wasi_version_snapshot0() {
(assert_c! {
#include "tests/wasmer.h"
int main() {
wasm_engine_t* engine = wasm_engine_new();
wasm_store_t* store = wasm_store_new(engine);
wasm_byte_vec_t wat;
wasmer_byte_vec_new_from_string(&wat, "(module (import \"wasi_unstable\" \"args_get\" (func (param i32 i32) (result i32))))");
wasm_byte_vec_t wasm;
wat2wasm(&wat, &wasm);
wasm_module_t* module = wasm_module_new(store, &wasm);
assert(module);
assert(wasi_get_wasi_version(module) == SNAPSHOT0);
wasm_module_delete(module);
wasm_byte_vec_delete(&wasm);
wasm_byte_vec_delete(&wat);
wasm_store_delete(store);
wasm_engine_delete(engine);
return 0;
}
})
.success();
} | rust_cleaned_test_functions.jsonl/86302 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 570
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1670,
10215,
3062,
1670,
10215,
9438,
53265,
15,
368,
341,
286,
320,
2207,
666,
0,
341,
310,
671,
997,
330,
23841,
6324,
300,
1174,
860,
1837,
310,
526,
1887,
368,
341,
394,
98263,
24823,
528,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ecdsa_send_support() {
ic_test_utilities::artifact_pool_config::with_test_pool_config(|pool_config| {
with_test_replica_logger(|logger| {
let (mut ecdsa_pool, pre_signer) =
create_pre_signer_dependencies(pool_config, logger);
let id = create_transcript_id(1);
let dealing = create_dealing(id, NODE_2);
let change_set = vec![EcdsaChangeAction::AddToValidated(
EcdsaMessage::EcdsaSignedDealing(dealing),
)];
ecdsa_pool.apply_changes(change_set);
let t = create_transcript_param(id, &[NODE_2], &[NODE_1]);
let block_reader =
TestEcdsaBlockReader::for_pre_signer_test(Height::from(100), vec![t]);
let change_set = pre_signer.send_dealing_support(&ecdsa_pool, &block_reader);
assert_eq!(change_set.len(), 1);
assert!(is_dealing_support_added_to_validated(
&change_set,
&id,
&NODE_2,
));
ecdsa_pool.apply_changes(change_set);
// more support.
let change_set = pre_signer.send_dealing_support(&ecdsa_pool, &block_reader);
assert!(change_set.is_empty());
})
})
} | rust_cleaned_test_functions.jsonl/86717 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 820
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
36844,
96780,
13565,
25827,
368,
341,
286,
17902,
4452,
94044,
486,
63722,
15709,
5332,
486,
4197,
4452,
15709,
5332,
22428,
10285,
5332,
91,
341,
310,
448,
4452,
25533,
15317,
27413,
22428,
9786,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_lookup3_xy() {
let mut rng = XorShiftRng::from_seed([0x3dbe6259, 0x8d313d76, 0x3237db17, 0xe5bc0656]);
for _ in 0..100 {
let mut cs = TestConstraintSystem::<Bls12>::new();
let a_val = rng.gen();
let a = Boolean::from(
AllocatedBit::alloc(cs.namespace(|| "a"), Some(a_val)).unwrap()
);
let b_val = rng.gen();
let b = Boolean::from(
AllocatedBit::alloc(cs.namespace(|| "b"), Some(b_val)).unwrap()
);
let c_val = rng.gen();
let c = Boolean::from(
AllocatedBit::alloc(cs.namespace(|| "c"), Some(c_val)).unwrap()
);
let bits = vec![a, b, c];
let points: Vec<(Fr, Fr)> = (0..8).map(|_| (rng.gen(), rng.gen())).collect();
let res = lookup3_xy(&mut cs, &bits, &points).unwrap();
assert!(cs.is_satisfied());
let mut index = 0;
if a_val { index += 1 }
if b_val { index += 2 }
if c_val { index += 4 }
assert_eq!(res.0.get_value().unwrap(), points[index].0);
assert_eq!(res.1.get_value().unwrap(), points[index].1);
}
} | rust_cleaned_test_functions.jsonl/66526 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 691
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
27464,
18,
40920,
368,
341,
286,
1077,
5206,
28422,
284,
1599,
269,
24841,
49,
968,
486,
1499,
33809,
2561,
15,
87,
18,
83406,
21,
17,
20,
24,
11,
220,
15,
87,
23,
67,
18,
16,
18,
67,
22,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 8 |
#[test]
fn test_split_mix64() {
let mut rng = SplitMix64::new();
let l = rng.next_long();
let i = rng.next_int();
println!("SplitMix64 64 bit signed: {}", l);
println!("SplitMix64 32 bit signed: {}", i);
assert_ne!(l, i as i64);
} | rust_cleaned_test_functions.jsonl/54530 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 144
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17052,
67729,
21,
19,
368,
341,
286,
1077,
5206,
28422,
284,
27810,
58083,
21,
19,
486,
931,
543,
286,
1077,
326,
284,
28422,
4529,
17799,
543,
286,
1077,
600,
284,
28422,
4529,
4042,
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_process_transactions_returns_unprocessed_txs() {
solana_logger::setup();
let GenesisBlockInfo {
genesis_block,
mint_keypair,
..
} = create_genesis_block(10_000);
let bank = Arc::new(Bank::new(&genesis_block));
let pubkey = Pubkey::new_rand();
let transactions =
vec![system_transaction::transfer(&mint_keypair, &pubkey, 1, genesis_block.hash(),); 3];
let ledger_path = get_tmp_ledger_path!();
{
let blocktree =
Blocktree::open(&ledger_path).expect("Expected to be able to open database ledger");
let (poh_recorder, _entry_receiver) = PohRecorder::new(
bank.tick_height(),
bank.last_blockhash(),
bank.slot(),
Some((4, 4)),
bank.ticks_per_slot(),
&Pubkey::new_rand(),
&Arc::new(blocktree),
&Arc::new(LeaderScheduleCache::new_from_bank(&bank)),
&Arc::new(PohConfig::default()),
);
// record
let poh_recorder = Arc::new(Mutex::new(poh_recorder));
let (processed_transactions_count, mut retryable_txs) =
BankingStage::process_transactions(&bank, &transactions, &poh_recorder);
assert_eq!(processed_transactions_count, 0,);
retryable_txs.sort();
let expected: Vec<usize> = (0..transactions.len()).collect();
assert_eq!(retryable_txs, expected);
}
Blocktree::destroy(&ledger_path).unwrap();
} | rust_cleaned_test_functions.jsonl/58838 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 849
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11305,
68182,
58900,
4907,
34022,
17805,
82,
368,
341,
286,
2048,
3362,
27413,
486,
15188,
543,
286,
1077,
40788,
4713,
1731,
341,
310,
59366,
7113,
345,
310,
28337,
3097,
12670,
345,
310,
54538,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_dyn_value_clone_drop() {
let val1 = OwnedDynValue::new(big_struct_1());
let val2 = OwnedDynValue::new(big_struct_2());
assert_eq!(val1, val1);
assert_eq!(val1.clone(), val1);
assert_eq!(val1.clone(), val1.clone().clone());
assert_eq!(val2, val2);
assert_eq!(val2.clone(), val2);
assert_eq!(val2.clone(), val2.clone().clone());
assert_ne!(val1, val2);
assert_ne!(val2, val1);
} | rust_cleaned_test_functions.jsonl/114236 | {
"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,
69213,
3142,
54742,
29584,
368,
341,
286,
1077,
1044,
16,
284,
85093,
95709,
1130,
486,
931,
75616,
15126,
62,
16,
1423,
286,
1077,
1044,
17,
284,
85093,
95709,
1130,
486,
931,
75616,
15126,
62,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_super_1() {
check_output_default(
"class A {\n\
method() {\n\
print \"A method\";\n\
}\n\
}\n\
\n\
class B < A {\n\
method() {\n\
print \"B method\";\n\
}\n\
\n\
test() {\n\
super.method();\n\
}\n\
}\n\
\n\
class C < B {}\n\
\n\
C().test();",
"'A method'",
)
} | rust_cleaned_test_functions.jsonl/111859 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 434
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
38886,
62,
16,
368,
341,
286,
1779,
7645,
9993,
1006,
310,
330,
1040,
362,
28152,
77,
5661,
2290,
1714,
368,
28152,
77,
5661,
338,
1173,
7245,
32,
1714,
2105,
17882,
77,
5661,
2290,
51300,
77,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_push_many() {
macro_rules! t(
(s: $path:expr, $push:expr, $exp:expr) => (
{
let mut p = Path::new($path);
p.push_many($push);
assert!(p.as_str() == Some($exp));
}
);
(v: $path:expr, $push:expr, $exp:expr) => (
{
let mut p = Path::new($path);
p.push_many($push);
assert!(p.as_vec() == $exp);
}
)
)
t!(s: "a/b/c", ["d", "e"], "a/b/c/d/e");
t!(s: "a/b/c", ["d", "/e"], "/e");
t!(s: "a/b/c", ["d", "/e", "f"], "/e/f");
t!(s: "a/b/c", ["d".to_string(), "e".to_string()], "a/b/c/d/e");
t!(v: b"a/b/c", [b"d", b"e"], b"a/b/c/d/e");
t!(v: b"a/b/c", [b"d", b"/e", b"f"], b"/e/f");
t!(v: b"a/b/c", [b"d".to_vec(), b"e".to_vec()], b"a/b/c/d/e");
} | rust_cleaned_test_functions.jsonl/7684 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 669
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14218,
22101,
368,
341,
286,
18072,
21407,
0,
259,
1006,
310,
320,
82,
25,
400,
2343,
96011,
11,
400,
9077,
96011,
11,
400,
4580,
96011,
8,
589,
2399,
394,
341,
503,
1077,
5206,
281,
284,
7933... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_definition_with_assign_body() {
let input = "def hello do
a = true
end";
let result = parsers::definition::parse(input);
assert_eq!(
result,
Ok((
"",
parsers::definition::Definition {
ident: parsers::ident::Ident {
body: "hello".to_string()
},
params: None,
body: Some(vec![parsers::definition::DefinitionBody::Assign(
parsers::assign::Assign {
ident: parsers::ident::Ident {
body: "a".to_string()
},
body: parsers::assign::AssignBody::Bool(parsers::bool::Bool {
body: true
})
}
)]),
}
))
)
} | rust_cleaned_test_functions.jsonl/41237 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 660
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31698,
6615,
20688,
14114,
368,
341,
286,
1077,
1946,
284,
330,
750,
23811,
653,
715,
310,
264,
284,
830,
198,
286,
835,
3302,
286,
1077,
1102,
284,
87073,
486,
18375,
486,
6400,
5384,
317,
286,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_file_reader_rows_projection_list() {
let schema = "
message spark_schema {
OPTIONAL group a (LIST) {
REPEATED group list {
OPTIONAL group element (LIST) {
REPEATED group list {
OPTIONAL group element (LIST) {
REPEATED group list {
OPTIONAL BYTE_ARRAY element (UTF8);
}
}
}
}
}
}
}
";
let schema = parse_message_type(&schema).unwrap();
let rows =
test_file_reader_rows("nested_lists.snappy.parquet", Some(schema)).unwrap();
let expected_rows = vec![
row![(
"a".to_string(),
list![
list![
list![Field::Str("a".to_string()), Field::Str("b".to_string())],
list![Field::Str("c".to_string())]
],
list![Field::Null, list![Field::Str("d".to_string())]]
]
)],
row![(
"a".to_string(),
list![
list![
list![Field::Str("a".to_string()), Field::Str("b".to_string())],
list![Field::Str("c".to_string()), Field::Str("d".to_string())]
],
list![Field::Null, list![Field::Str("e".to_string())]]
]
)],
row![(
"a".to_string(),
list![
list![
list![Field::Str("a".to_string()), Field::Str("b".to_string())],
list![Field::Str("c".to_string()), Field::Str("d".to_string())],
list![Field::Str("e".to_string())]
],
list![Field::Null, list![Field::Str("f".to_string())]]
]
)],
];
assert_eq!(rows, expected_rows);
} | rust_cleaned_test_functions.jsonl/69591 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1268
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2458,
22306,
10949,
72738,
2019,
368,
341,
286,
1077,
10802,
284,
6228,
414,
1943,
15186,
25371,
341,
286,
76232,
1874,
264,
320,
22852,
8,
341,
688,
3596,
1740,
9005,
1874,
1140,
341,
310,
76232,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_check_and_slash_expired_rewards() {
let mut t = new_test_ext();
t.execute_with(|| {
// let purchased_submit_bn: u64 = 50;
// let current_bn: u64 = 50;
advance_session();
advance_session();
advance_session();
advance_session();
advance_session();
advance_session();
advance_session();
advance_session();
assert_eq!(<frame_system::Pallet<Test>>::block_number(), 40 );
assert_eq!(Session::current_index(), 8 );
assert_eq!(OracleFinance::current_era(), Some(3));
assert_eq!(OracleFinance::eras_start_session_index(3), Some(8));
const ACCOUNT_ID_1: u64 = 1;
const ACCOUNT_ID_2: u64 = 2;
const ACCOUNT_ID_3: u64 = 3;
OracleFinance::reserve_for_ask_quantity(ACCOUNT_ID_2, to_test_vec("Purchased_ID_BN_55"), 2);
assert_ok!(OracleFinance::record_submit_point(ACCOUNT_ID_1, to_test_vec("Purchased_ID_BN_55"), <frame_system::Pallet<Test>>::block_number() ,2 ));
assert_ok!(OracleFinance::record_submit_point(ACCOUNT_ID_3, to_test_vec("Purchased_ID_BN_55"), <frame_system::Pallet<Test>>::block_number() ,2 ));
assert_ok!(OracleFinance::pay_to_ask(to_test_vec("Purchased_ID_BN_55"), 2));
// check pot
assert_eq!(OracleFinance::pot(),(OracleFinance::account_id(), 2000000000000));
assert_eq!(<RewardEra<Test>>::get(ACCOUNT_ID_1), vec![
(3, 2, to_test_vec("Purchased_ID_BN_55"))
]);
assert_eq!(<RewardEra<Test>>::get(ACCOUNT_ID_3), vec![
(3, 2, to_test_vec("Purchased_ID_BN_55"))
]);
println!(" current {}, depth {}", OracleFinance::current_era_num(), HistoryDepth::get());
// count check_ear
let check_era = OracleFinance::current_era_num() - HistoryDepth::get() - 1;
// check none
assert_eq!(OracleFinance::check_and_slash_expired_rewards(check_era), None);
});
t.execute_with(|| {
// let _purchased_submit_bn: u64 = 50;
// let current_bn: u64 = 90;
const ACCOUNT_ID_1: u64 = 1;
const ACCOUNT_ID_2: u64 = 2;
const ACCOUNT_ID_3: u64 = 3;
// check storage struct.
assert!(<PaymentTrace<Test>>::contains_key(to_test_vec("Purchased_ID_BN_55"), ACCOUNT_ID_2));
assert!(<AskEraPayment<Test>>::contains_key(3, (ACCOUNT_ID_2, to_test_vec("Purchased_ID_BN_55"))));
assert_eq!(false, <RewardTrace<Test>>::contains_key(3, ACCOUNT_ID_1));
assert_eq!(false, <RewardTrace<Test>>::contains_key(3, ACCOUNT_ID_3));
assert!(<AskEraPoint<Test>>::contains_key(3, (ACCOUNT_ID_1, to_test_vec("Purchased_ID_BN_55"))));
assert!(<AskEraPoint<Test>>::contains_key(3, (ACCOUNT_ID_3, to_test_vec("Purchased_ID_BN_55"))));
assert_eq!(OracleFinance::pot(),(OracleFinance::account_id(), 2000000000000));
// if reward is expired
// assert_eq!(
advance_session();
advance_session();
advance_session();
advance_session();
advance_session();
advance_session();
assert_eq!(<frame_system::Pallet<Test>>::block_number(), 70 );
assert_eq!(Session::current_index(), 14 );
assert_eq!(OracleFinance::current_era(), Some(6));
assert_eq!(OracleFinance::eras_start_session_index(6), Some(14));
assert_eq!(
OracleFinance::take_reward(3, ACCOUNT_ID_1),
Err(Error::<Test>::RewardEraHasExpired)
);
// store clean
assert_eq!(false, <AskEraPayment<Test>>::contains_key(3, (ACCOUNT_ID_2, to_test_vec("Purchased_ID_BN_55"))));
assert_eq!(false, <RewardTrace<Test>>::contains_key(3, ACCOUNT_ID_1));
assert_eq!(false, <RewardTrace<Test>>::contains_key(3, ACCOUNT_ID_3));
assert_eq!(false, <AskEraPoint<Test>>::contains_key(3, (ACCOUNT_ID_1, to_test_vec("Purchased_ID_BN_55"))));
assert_eq!(false, <AskEraPoint<Test>>::contains_key(3, (ACCOUNT_ID_3, to_test_vec("Purchased_ID_BN_55"))));
assert_eq!(OracleFinance::pot(),(OracleFinance::account_id(), 0));
assert_eq!(<RewardEra<Test>>::get(ACCOUNT_ID_1), vec![]);
assert_eq!(<RewardEra<Test>>::get(ACCOUNT_ID_3), vec![]);
});
} | rust_cleaned_test_functions.jsonl/35128 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1649
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7200,
8378,
11886,
988,
80221,
77997,
368,
341,
10217,
5206,
259,
284,
501,
4452,
9927,
543,
3244,
7769,
6615,
79453,
341,
197,
197,
322,
1077,
14733,
31674,
58112,
25,
575,
21,
19,
284,
220,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_analysis_from_document() {
let it = doc! {
KEY_ID: "amenakaonsen",
KEY_POSITIVE_ION: {},
KEY_NEGATIVE_ION: {},
KEY_UNDISSOCIATED: {},
KEY_GAS: {},
KEY_MINOR: {},
KEY_TOTAL_POSITIVE_ION: {
KEY_MG: 4583.0,
KEY_MVAL: 202.3,
KEY_MMOL: "--"
},
KEY_TOTAL_NEGATIVE_ION: {
KEY_MG: 7881.0,
KEY_MVAL: 216.6,
KEY_MMOL: "--"
},
KEY_TOTAL_UNDISSOCIATED: {
KEY_MG: 164.3,
KEY_MVAL: 0.0,
KEY_MMOL: 2.63
},
KEY_TOTAL_GAS: {
KEY_MG: 29.0,
KEY_MVAL: 0.0,
KEY_MMOL: 0.7
},
KEY_NAME: "雨中温泉",
KEY_PH: 7.5,
KEY_YIELD: 1220.0,
KEY_TEMPERATURE: 48.8,
"quality": "含硫黄-ナトリウム-塩化物温泉 (硫化水素型)"
};
let r = Analysis::try_from(&it);
if !r.is_ok() {
println!("Error {:?}", &r);
}
assert!(r.is_ok());
let mut meta = HashMap::new();
meta.insert("quality".to_string(),
"含硫黄-ナトリウム-塩化物温泉 (硫化水素型)".to_string());
assert_eq!(r.unwrap(), Analysis {
id: Some("amenakaonsen".to_string()),
name: "雨中温泉".to_string(),
gensen_yield: CellValue::Number(1220.0),
temperature: Some(48.8),
ph: CellValue::Number(7.5),
positive_ion: ComponentTable::new(),
negative_ion: ComponentTable::new(),
undissociated: ComponentTable::new(),
gas: ComponentTable::new(),
minor: ComponentTable::new(),
total_positive_ion: MgMvalMmol {
mg: CellValue::Number(4583.0),
mval: CellValue::Number(202.3),
mmol: CellValue::Text("--".to_string()),
mval_percent: CellValue::Null
},
total_negative_ion: MgMvalMmol {
mg: CellValue::Number(7881.0),
mval: CellValue::Number(216.6),
mmol: CellValue::Text("--".to_string()),
mval_percent: CellValue::Null
},
total_undissociated: MgMvalMmol {
mg: CellValue::Number(164.3),
mval: CellValue::Number(0.0),
mmol: CellValue::Number(2.63),
mval_percent: CellValue::Null,
},
total_gas: MgMvalMmol {
mg: CellValue::Number(29.0),
mval: CellValue::Number(0.0),
mmol: CellValue::Number(0.7),
mval_percent: CellValue::Null
},
total_minor: MgMvalMmol {
mg: CellValue::Null,
mval: CellValue::Null,
mmol: CellValue::Null,
mval_percent: CellValue::Null
},
meta: meta
});
} | rust_cleaned_test_functions.jsonl/16364 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1952
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
42682,
5673,
26231,
368,
341,
286,
1077,
432,
284,
4629,
0,
341,
310,
12013,
3450,
25,
330,
24774,
13334,
2382,
268,
756,
310,
12013,
18313,
44350,
62,
1271,
25,
14573,
310,
12013,
62368,
23215,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_rule_only() {
let json = r#"["@test","a"]"#;
let remark = Remark::new(RemarkType::Annotated, "@test");
assert_eq_dbg!(remark, serde_json::from_str(json).unwrap());
assert_eq_str!(json, &serde_json::to_string(&remark).unwrap());
} | rust_cleaned_test_functions.jsonl/126371 | {
"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,
21124,
18410,
368,
341,
286,
1077,
2951,
284,
435,
55543,
74528,
1944,
2198,
64,
1341,
57676,
280,
286,
1077,
13841,
284,
82733,
486,
931,
2785,
21115,
929,
486,
2082,
87029,
11,
8428,
1944,
3071,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_insert_checking_memory_limit() {
let _guard = TEST_MUTEX.lock().unwrap();
defer!(GLOBAL_MEM_SIZE.set(0));
let mut locks = PeerPessimisticLocks::default();
let res = locks.insert(vec![(Key::from_raw(b"k1"), lock(&[0; 512000]))]);
assert!(res.is_ok());
// Exceeding the region limit
let res = locks.insert(vec![(Key::from_raw(b"k2"), lock(&[0; 32000]))]);
assert!(res.is_err());
assert!(locks.get(&Key::from_raw(b"k2")).is_none());
GLOBAL_MEM_SIZE.set(101 << 20);
let res = locks.insert(vec![(Key::from_raw(b"k2"), lock(b"abc"))]);
assert!(res.is_err());
assert!(locks.get(&Key::from_raw(b"k2")).is_none());
} | rust_cleaned_test_functions.jsonl/83914 | {
"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,
17678,
7200,
287,
19195,
14763,
368,
341,
286,
1077,
716,
26098,
284,
13602,
66994,
21003,
1005,
15454,
543,
286,
17956,
10297,
16492,
13209,
4098,
980,
7,
15,
3237,
286,
1077,
5206,
31676,
284,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_bump_txn_sanitize_tracking_maps() {
// verify we clean then right after expiration of ANTI_REORG_DELAY.
let chanmon_cfgs = create_chanmon_cfgs(2);
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
let chan = create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1000000, 59000000, InitFeatures::known(), InitFeatures::known());
// Lock HTLC in both directions
let payment_preimage = route_payment(&nodes[0], &vec!(&nodes[1])[..], 9_000_000).0;
route_payment(&nodes[1], &vec!(&nodes[0])[..], 9_000_000).0;
let revoked_local_txn = get_local_commitment_txn!(nodes[1], chan.2);
assert_eq!(revoked_local_txn[0].input.len(), 1);
assert_eq!(revoked_local_txn[0].input[0].previous_output.txid, chan.3.txid());
// Revoke local commitment tx
claim_payment(&nodes[0], &vec!(&nodes[1])[..], payment_preimage);
// Broadcast set of revoked txn on A
connect_blocks(&nodes[0], TEST_FINAL_CLTV + 2 - CHAN_CONFIRM_DEPTH);
expect_pending_htlcs_forwardable_ignore!(nodes[0]);
assert_eq!(nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().len(), 0);
mine_transaction(&nodes[0], &revoked_local_txn[0]);
check_closed_broadcast!(nodes[0], true);
check_added_monitors!(nodes[0], 1);
check_closed_event!(nodes[0], 1, ClosureReason::CommitmentTxConfirmed);
let penalty_txn = {
let mut node_txn = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap();
assert_eq!(node_txn.len(), 4);
check_spends!(node_txn[0], revoked_local_txn[0]);
check_spends!(node_txn[1], revoked_local_txn[0]);
check_spends!(node_txn[2], revoked_local_txn[0]);
let penalty_txn = vec![node_txn[0].clone(), node_txn[1].clone(), node_txn[2].clone()];
node_txn.clear();
penalty_txn
};
let header_130 = BlockHeader { version: 0x20000000, prev_blockhash: nodes[0].best_block_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 };
connect_block(&nodes[0], &Block { header: header_130, txdata: penalty_txn });
connect_blocks(&nodes[0], ANTI_REORG_DELAY - 1);
{
let monitors = nodes[0].chain_monitor.chain_monitor.monitors.read().unwrap();
if let Some(monitor) = monitors.get(&OutPoint { txid: chan.3.txid(), index: 0 }) {
assert!(monitor.inner.lock().unwrap().onchain_tx_handler.pending_claim_requests.is_empty());
assert!(monitor.inner.lock().unwrap().onchain_tx_handler.claimable_outpoints.is_empty());
}
}
} | rust_cleaned_test_functions.jsonl/16949 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1025
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
1510,
92299,
643,
58652,
66105,
46512,
368,
341,
1572,
197,
322,
10146,
582,
4240,
1221,
1290,
1283,
31692,
315,
2100,
26614,
2192,
44927,
33410,
382,
10217,
26023,
1645,
18343,
82,
284,
1855,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ipv6_display() {
// Test that `addr` is formatted the same by our `Display` impl as by
// the standard library's `Display` impl. Optionally test that it
// matches a particular expected string.
fn test_one(addr: Ipv6Addr, expect: Option<&str>) {
let formatted = format!("{}", addr);
if let Some(expect) = expect {
assert_eq!(formatted, expect);
}
// NOTE: We use `std` here even though we're not inside of the
// `std_tests` module because we're using `std` to test
// functionality that is present even when the `std` Cargo feature
// is not used.
// std::net::Ipv6Addr` impl is not emitted.
let formatted_std = format!("{}", std::net::Ipv6Addr::from(addr.segments()));
assert_eq!(formatted, formatted_std);
}
test_one(Ipv6::UNSPECIFIED_ADDRESS, Some("::"));
test_one(*Ipv6::LOOPBACK_ADDRESS, Some("::1"));
test_one(Ipv6::MULTICAST_SUBNET.network, Some("ff00::"));
test_one(Ipv6::LINK_LOCAL_UNICAST_SUBNET.network, Some("fe80::"));
test_one(*Ipv6::ALL_NODES_LINK_LOCAL_MULTICAST_ADDRESS, Some("ff02::1"));
test_one(*Ipv6::ALL_NODES_LINK_LOCAL_MULTICAST_ADDRESS, Some("ff02::1"));
test_one(*Ipv6::ALL_ROUTERS_LINK_LOCAL_MULTICAST_ADDRESS, Some("ff02::2"));
test_one(Ipv6::SITE_LOCAL_UNICAST_SUBNET.network, Some("fec0::"));
test_one(Ipv6Addr::new([1, 0, 0, 0, 0, 0, 0, 0]), Some("1::"));
test_one(Ipv6Addr::new([0, 0, 0, 1, 2, 3, 4, 5]), Some("::1:2:3:4:5"));
// through every possible IPv6 address. Since the formatting algorithm
// gives us effectively complete coverage of the input space.
for byte in 0u8..=255 {
test_one(
Ipv6Addr::new([
u16::from(byte & 0b1),
u16::from((byte & 0b10) >> 1),
u16::from((byte & 0b100) >> 2),
u16::from((byte & 0b1000) >> 3),
u16::from((byte & 0b10000) >> 4),
u16::from((byte & 0b100000) >> 5),
u16::from((byte & 0b1000000) >> 6),
u16::from((byte & 0b10000000) >> 7),
]),
None,
);
}
} | rust_cleaned_test_functions.jsonl/31873 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1317
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
49378,
21,
14825,
368,
341,
286,
442,
3393,
429,
1565,
6214,
63,
374,
23126,
279,
1852,
553,
1039,
1565,
7020,
63,
11605,
438,
553,
198,
286,
442,
279,
5297,
6733,
594,
1565,
7020,
63,
11605,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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() {
let num = super::get();
if let Some(n) = env_var("NUM_CPUS_TEST_GET") {
assert_eq!(num, n);
} else {
assert!(num > 0);
assert!(num < 236_451);
}
} | rust_cleaned_test_functions.jsonl/35691 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 148
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
368,
341,
286,
1077,
1629,
284,
2256,
486,
455,
543,
286,
421,
1077,
4329,
1445,
8,
284,
6105,
4612,
445,
17488,
45976,
2034,
11641,
12702,
899,
341,
310,
2060,
10714,
10297,
2413,
11,
308... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.