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_peer_credit_misbehavior() {
let mut ctx = CsmTestContext::new_established();
let mut stream = TestStream::new();
stream.write_state = StreamState::WouldBlock;
ctx.set_stream(stream);
// Fill up the TX buffer.
let data = vec![0u8; ctx.pkt.buf().unwrap().len()];
ctx.init_data_pkt(data.as_slice());
for _i in 0..(csm_defs::CONN_TX_BUF_SIZE / data.len()) {
ctx.send();
}
// Then try to send more data.
ctx.send();
// The connection should've committed suicide.
assert_eq!(ctx.conn.state, ConnState::Killed);
assert!(ctx.conn.has_pending_rx());
ctx.recv();
assert_eq!(ctx.pkt.op(), uapi::VSOCK_OP_RST);
} | rust_cleaned_test_functions.jsonl/83296 | {
"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,
45159,
51569,
717,
285,
55866,
368,
341,
286,
1077,
5206,
5635,
284,
356,
3563,
2271,
1972,
486,
931,
18583,
5102,
291,
1428,
286,
1077,
5206,
4269,
284,
3393,
3027,
486,
931,
543,
286,
4269,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_call_hierarchy_in_different_files() {
check_hierarchy(
r#"
//- /lib.rs
mod foo;
use foo::callee;
fn caller() {
call$0ee();
}
//- /foo/mod.rs
pub fn callee() {}
"#,
expect![["callee Function FileId(1) 0..18 7..13"]],
expect![["caller Function FileId(0) 27..56 30..36 : [45..51]"]],
expect![[]],
);
} | rust_cleaned_test_functions.jsonl/38289 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 215
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13429,
95043,
1243,
82741,
10931,
368,
341,
286,
1779,
95043,
1006,
310,
435,
2,
698,
61463,
608,
2740,
25638,
198,
2593,
15229,
280,
810,
15229,
486,
86476,
401,
8822,
19865,
368,
341,
262,
1618,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_convert_object() {
let b = ast::BaseNode::default();
let pkg = ast::Package {
base: b.clone(),
path: "path".to_string(),
package: "main".to_string(),
files: vec![ast::File {
base: b.clone(),
name: "foo.flux".to_string(),
metadata: String::new(),
package: None,
imports: Vec::new(),
body: vec![ast::Statement::Expr(Box::new(ast::ExprStmt {
base: b.clone(),
expression: ast::Expression::Object(Box::new(ast::ObjectExpr {
base: b.clone(),
lbrace: None,
with: None,
properties: vec![ast::Property {
base: b.clone(),
key: ast::PropertyKey::Identifier(ast::Identifier {
base: b.clone(),
name: "a".to_string(),
}),
separator: None,
value: Some(ast::Expression::Integer(ast::IntegerLit {
base: b.clone(),
value: 10,
})),
comma: None,
}],
rbrace: None,
})),
}))],
eof: None,
}],
};
let want = Package {
loc: b.location.clone(),
package: "main".to_string(),
files: vec![File {
loc: b.location.clone(),
package: None,
imports: Vec::new(),
body: vec![Statement::Expr(ExprStmt {
loc: b.location.clone(),
expression: Expression::Object(Box::new(ObjectExpr {
loc: b.location.clone(),
typ: type_info(),
with: None,
properties: vec![Property {
loc: b.location.clone(),
key: Identifier {
loc: b.location.clone(),
name: "a".to_string(),
},
value: Expression::Integer(IntegerLit {
loc: b.location.clone(),
value: 10,
}),
}],
})),
})],
}],
};
let got = test_convert(pkg).unwrap();
assert_eq!(want, got);
} | rust_cleaned_test_functions.jsonl/30440 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1821
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34910,
5314,
368,
341,
286,
1077,
293,
284,
11763,
486,
3978,
1955,
486,
2258,
543,
286,
1077,
24793,
284,
11763,
486,
13100,
341,
310,
2331,
25,
293,
15997,
3148,
310,
1815,
25,
330,
2343,
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_nodes() {
assert_eq!(
nodes("node"),
Ok((
"",
vec![KdlNode {
name: "node".into(),
values: Vec::new(),
properties: HashMap::new(),
children: Vec::new(),
}]
))
);
assert_eq!(
nodes("node\n"),
Ok((
"",
vec![KdlNode {
name: "node".into(),
values: Vec::new(),
properties: HashMap::new(),
children: Vec::new(),
}]
))
);
assert_eq!(
nodes("\nnode\n"),
Ok((
"",
vec![KdlNode {
name: "node".into(),
values: Vec::new(),
properties: HashMap::new(),
children: Vec::new(),
}]
))
);
assert_eq!(
nodes("node1\nnode2"),
Ok((
"",
vec![
KdlNode {
name: "node1".into(),
values: Vec::new(),
properties: HashMap::new(),
children: Vec::new(),
},
KdlNode {
name: "node2".into(),
values: Vec::new(),
properties: HashMap::new(),
children: Vec::new(),
}
]
))
);
} | rust_cleaned_test_functions.jsonl/118109 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1179
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
14896,
368,
341,
286,
2060,
10714,
33673,
310,
7798,
445,
3509,
4461,
310,
7622,
94702,
394,
8324,
394,
7486,
20703,
42,
8736,
1955,
341,
503,
829,
25,
330,
3509,
3263,
18122,
3148,
503,
2750,
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_foreign_value() {
let interp = Interpreter::new();
interp.scope().add_named_value("my-value", MyType{a: 123}.into());
assert_eq!(eval(&interp, "my-value").unwrap(), "MyType { a: 123 }");
assert_eq!(eval(&interp, "(type-of my-value)").unwrap(), "MyType");
assert_eq!(eval(&interp, "(is 'MyType my-value)").unwrap(), "true");
} | rust_cleaned_test_functions.jsonl/112660 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 154
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
78983,
3142,
368,
341,
262,
1077,
47271,
284,
82493,
486,
931,
1428,
262,
47271,
48371,
1005,
718,
71834,
3142,
445,
2408,
19083,
497,
3017,
929,
90,
64,
25,
220,
16,
17,
18,
7810,
18122,
5231,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_put_del() {
let dir = TempDir::new("test").unwrap();
let env = Environment::new().open(dir.path()).unwrap();
let db = env.open_db(None).unwrap();
let mut txn = env.begin_rw_txn().unwrap();
let mut cursor = txn.open_rw_cursor(db).unwrap();
cursor.put(b"key1", b"val1", WriteFlags::empty()).unwrap();
cursor.put(b"key2", b"val2", WriteFlags::empty()).unwrap();
cursor.put(b"key3", b"val3", WriteFlags::empty()).unwrap();
assert_eq!((Some(&b"key3"[..]), &b"val3"[..]), cursor.get(None, None, MDB_GET_CURRENT).unwrap());
cursor.del(WriteFlags::empty()).unwrap();
assert_eq!((Some(&b"key2"[..]), &b"val2"[..]), cursor.get(None, None, MDB_LAST).unwrap());
} | rust_cleaned_test_functions.jsonl/15140 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 354
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15557,
18029,
368,
341,
286,
1077,
5419,
284,
19944,
6184,
486,
931,
445,
1944,
1827,
15454,
543,
286,
1077,
6105,
284,
11586,
486,
931,
1005,
2508,
14161,
3875,
6011,
15454,
543,
286,
1077,
2927,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_repository() {
assert_eq!("INSERT OR REPLACE INTO repositories (name) VALUES ('rejasupotaro/cref')",
insert_repository(&"rejasupotaro/cref".to_string()));
} | rust_cleaned_test_functions.jsonl/33810 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 95
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17678,
47301,
368,
341,
286,
2060,
10714,
17223,
12698,
2726,
84371,
12496,
49657,
320,
606,
8,
14710,
4319,
265,
29726,
454,
354,
17165,
14,
837,
69,
863,
756,
310,
5656,
47301,
2099,
1,
265,
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 |
#[test]
fn test_truncate_end() {
let mut buf = Buffer::new();
buf.insert(0, &['a', 'b', 'c', 'd', 'e', 'f', 'g']);
let end = buf.num_chars();
buf.truncate(end);
assert_eq!(String::from(buf), "abcdefg");
} | rust_cleaned_test_functions.jsonl/61885 | {
"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,
3547,
26900,
6213,
368,
341,
286,
1077,
5206,
6607,
284,
10312,
486,
931,
543,
286,
6607,
7030,
7,
15,
11,
609,
677,
64,
516,
364,
65,
516,
364,
66,
516,
364,
67,
516,
364,
68,
516,
364,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_prepare_failures() {
let db = checked_memory_handle();
db.execute_batch("CREATE TABLE foo(x INTEGER);").unwrap();
let err = db.prepare("SELECT * FROM does_not_exist").unwrap_err();
assert!(format!("{}", err).contains("does_not_exist"));
} | rust_cleaned_test_functions.jsonl/25514 | {
"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,
47460,
22121,
1413,
368,
341,
286,
1077,
2927,
284,
10067,
19195,
10630,
543,
286,
2927,
7769,
14534,
445,
22599,
14363,
15229,
2075,
30381,
1215,
1827,
15454,
1428,
286,
1077,
1848,
284,
2927,
2193... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_get_block_config() {
let rpc = RpcHandler::start();
let confirmed_block_signatures = rpc.create_test_transactions_and_populate_blockstore();
let request = create_test_request(
"getBlock",
Some(json!([
0u64,
RpcBlockConfig {
encoding: None,
transaction_details: Some(TransactionDetails::Signatures),
rewards: Some(false),
commitment: None,
max_supported_transaction_version: None,
},
])),
);
let result: Option<UiConfirmedBlock> =
parse_success_result(rpc.handle_request_sync(request));
let confirmed_block = result.unwrap();
assert!(confirmed_block.transactions.is_none());
assert!(confirmed_block.rewards.is_none());
for (i, signature) in confirmed_block.signatures.unwrap()[..2].iter().enumerate() {
assert_eq!(*signature, confirmed_block_signatures[i].to_string());
}
let request = create_test_request(
"getBlock",
Some(json!([
0u64,
RpcBlockConfig {
encoding: None,
transaction_details: Some(TransactionDetails::None),
rewards: Some(true),
commitment: None,
max_supported_transaction_version: None,
},
])),
);
let result: Option<UiConfirmedBlock> =
parse_success_result(rpc.handle_request_sync(request));
let confirmed_block = result.unwrap();
assert!(confirmed_block.transactions.is_none());
assert!(confirmed_block.signatures.is_none());
assert_eq!(confirmed_block.rewards.unwrap(), vec![]);
} | rust_cleaned_test_functions.jsonl/6329 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 940
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
7113,
5332,
368,
341,
286,
1077,
35596,
284,
79961,
3050,
486,
2468,
543,
286,
1077,
10774,
7113,
11172,
2789,
284,
35596,
2520,
4452,
68182,
8378,
17061,
6334,
7113,
4314,
1428,
286,
1077,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_gsv() {
let mut nmea = Nmea::new();
nmea.parse("$GPGSV,3,1,11,10,63,137,17,07,61,098,15,05,59,290,20,08,54,157,30*70")
.unwrap();
nmea.parse("$GPGSV,3,2,11,02,39,223,19,13,28,070,17,26,23,252,,04,14,186,14*79")
.unwrap();
nmea.parse("$GPGSV,3,3,11,29,09,301,24,16,09,020,,36,,,*76")
.unwrap();
assert_eq!(nmea.satellites().len(), 11);
let sat: &Satellite = &(nmea.satellites()[0]);
assert_eq!(sat.gnss_type, GnssType::Gps);
assert_eq!(sat.prn, 10);
assert_eq!(sat.elevation, Some(63.0));
assert_eq!(sat.azimuth, Some(137.0));
assert_eq!(sat.snr, Some(17.0));
} | rust_cleaned_test_functions.jsonl/65857 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 457
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1889,
3492,
368,
341,
286,
1077,
5206,
308,
2660,
64,
284,
451,
2660,
64,
486,
931,
543,
1789,
286,
308,
2660,
64,
4632,
20912,
38,
11383,
17803,
11,
18,
11,
16,
11,
16,
16,
11,
16,
15,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_find_by_headers_none() {
let headers = ["Name", "Age"];
let bad_headers = ["Name", "BAD"];
assert_eq!(None, Table::find_by_headers("", &headers));
assert_eq!(None, Table::find_by_headers("foo", &headers));
assert_eq!(None, Table::find_by_headers(HTML_NO_TABLE, &headers));
assert_eq!(None, Table::find_by_headers(TABLE_EMPTY, &bad_headers));
assert_eq!(None, Table::find_by_headers(TABLE_TH, &bad_headers));
assert_eq!(None, Table::find_by_headers(TABLE_TD, &headers));
assert_eq!(None, Table::find_by_headers(TABLE_TD, &bad_headers));
} | rust_cleaned_test_functions.jsonl/47583 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 281
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21814,
3710,
26719,
31488,
368,
341,
286,
1077,
7102,
284,
4383,
675,
497,
330,
16749,
6332,
286,
1077,
3873,
26719,
284,
4383,
675,
497,
330,
53572,
31797,
286,
2060,
10714,
10297,
4064,
11,
6633... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_invalid_signature() {
let proto_txn: crate::proto::types::SignedTransaction = SignedTransaction::new(
RawTransaction::new_script(
AccountAddress::random(),
0,
Script::new(vec![], vec![], vec![]),
0,
0,
lbr_type_tag(),
std::time::Duration::new(0, 0),
),
Ed25519PrivateKey::generate_for_testing().public_key(),
Ed25519Signature::try_from(&[1u8; 64][..]).unwrap(),
)
.into();
let txn = SignedTransaction::try_from(proto_txn)
.expect("initial conversion from_proto should succeed");
txn.check_signature()
.expect_err("signature checking should fail");
} | rust_cleaned_test_functions.jsonl/130130 | {
"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,
31433,
39859,
368,
341,
262,
1077,
18433,
92299,
25,
17717,
486,
15110,
486,
9242,
486,
49312,
8070,
284,
52453,
8070,
486,
931,
1006,
286,
23022,
8070,
486,
931,
14660,
1006,
310,
8615,
4286,
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_identifier_start_valid() {
assert_parse_success!(identifier, r"\u0024", "$".to_string());
assert_parse_success!(identifier, r"_", "_".to_string());
} | rust_cleaned_test_functions.jsonl/66446 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 80
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
33176,
4906,
8337,
368,
341,
1066,
262,
2060,
21039,
18632,
10297,
15909,
11,
435,
11934,
84,
15,
15,
17,
19,
497,
5201,
3263,
983,
3904,
1423,
262,
2060,
21039,
18632,
10297,
15909,
11,
435,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_is_sign_positive() {
assert!(INFINITY.is_sign_positive());
assert!(1f64.is_sign_positive());
assert!(0f64.is_sign_positive());
assert!(!(-0f64).is_sign_positive());
assert!(!(-1f64).is_sign_positive());
assert!(!NEG_INFINITY.is_sign_positive());
assert!(!(1f64/NEG_INFINITY).is_sign_positive());
assert!(!NAN.is_sign_positive());
} | rust_cleaned_test_functions.jsonl/7439 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 211
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6892,
11172,
54160,
368,
341,
286,
2060,
10297,
687,
55990,
2079,
11172,
54160,
1423,
286,
2060,
10297,
16,
69,
21,
19,
2079,
11172,
54160,
1423,
286,
2060,
10297,
15,
69,
21,
19,
2079,
11172,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_serialize_shutdown() {
let cmd = DevopsCommand {
target_actor_selection: "/foo/bar".to_string(),
headers: Default::default(),
piggyback_command: PiggybackCommand::Shutdown {
reason: ShutdownReason::PurgeNamespace {
namespace: "ns".to_string(),
},
},
};
assert_eq!(
serde_json::to_value(cmd).unwrap(),
json!({
"targetActorSelection": "/foo/bar",
"headers": {
"aggregate": false
},
"piggybackCommand": {
"type": "common.commands:shutdown",
"reason": {
"type": "purge-namespace",
"details": "ns",
}
}
})
);
} | rust_cleaned_test_functions.jsonl/61459 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 553
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
88686,
54804,
368,
341,
286,
1077,
5439,
284,
6040,
3721,
4062,
341,
310,
2169,
54818,
23672,
25,
3521,
7975,
49513,
3263,
983,
3904,
3148,
310,
7102,
25,
7899,
486,
2258,
3148,
310,
23694,
4577,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_with_vars_set_unset() {
let not_my_var_not_set = env::var("NOT_MY_VAR");
assert!(not_my_var_not_set.is_err(), "`NOT_MY_VAR` must not be set.");
crate::with_vars(
vec![
("NOT_MY_VAR", Some("it is set")),
("NOT_MY_VAR", None::<&str>),
],
|| {
let not_my_var_not_set_new = env::var("NOT_MY_VAR");
assert!(
not_my_var_not_set_new.is_err(),
"`NOT_MY_VAR` must not be set."
);
},
);
let not_my_var_not_set_after = env::var("NOT_MY_VAR");
assert!(
not_my_var_not_set_after.is_err(),
"`NOT_MY_VAR` must not be set."
);
} | rust_cleaned_test_functions.jsonl/49891 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 493
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6615,
11168,
2602,
98109,
368,
341,
286,
1077,
537,
35686,
4612,
7913,
2602,
284,
6105,
486,
947,
445,
14065,
84395,
25750,
797,
286,
2060,
10297,
1921,
35686,
4612,
7913,
2602,
2079,
9266,
1507,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_enable() {
let got = command(b"A123 enable UTF8=ACCEPT ENABLE\r\n").unwrap().1;
assert_eq!(
Command::new(
"A123".try_into().unwrap(),
CommandBody::Enable {
capabilities: vec![
Capability::Other("UTF8=ACCEPT".try_into().unwrap()),
Capability::Enable
]
.try_into()
.unwrap()
}
),
got
);
} | rust_cleaned_test_functions.jsonl/125413 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 353
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18988,
368,
341,
286,
1077,
2684,
284,
3210,
1883,
29133,
16,
17,
18,
7283,
20076,
23,
28,
97356,
33240,
12016,
1699,
1827,
15454,
1005,
16,
280,
286,
2060,
10714,
33673,
310,
7348,
486,
931,
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_mark_disabled() {
let mut batch = PacketBatch::default();
batch.packets.push(Packet::default());
let mut batches: Vec<PacketBatch> = vec![batch];
mark_disabled(&mut batches, &[vec![0]]);
assert!(batches[0].packets[0].meta.discard());
mark_disabled(&mut batches, &[vec![1]]);
assert!(!batches[0].packets[0].meta.discard());
} | rust_cleaned_test_functions.jsonl/22069 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 187
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18924,
51401,
368,
341,
286,
1077,
5206,
7162,
284,
28889,
21074,
486,
2258,
543,
286,
7162,
556,
18382,
2552,
92222,
486,
2258,
1423,
286,
1077,
5206,
44792,
25,
11312,
27,
16679,
21074,
29,
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_strbox_serialize() {
let strx: &'static str = "hello world";
let serialized = serialize_little(&Cow::Borrowed(strx), Infinite).unwrap();
let deserialized: Cow<'static, String> =
deserialize_from_little(&mut &serialized[..], Infinite).unwrap();
let stringx: String = deserialized.into_owned();
assert!(strx == &stringx[..]);
} | rust_cleaned_test_functions.jsonl/11963 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 146
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2895,
2011,
88686,
368,
341,
262,
1077,
607,
87,
25,
30136,
1978,
607,
284,
330,
14990,
1879,
876,
262,
1077,
32916,
284,
24235,
907,
2377,
2099,
89915,
486,
33,
7768,
291,
4199,
87,
701,
54543,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_deadbeef_all_32k_test_count_bytes() {
new_ucmd!()
.args(&[
"ibs=531",
"obs=1031",
"count=32x1024",
"oflag=count_bytes",
"if=deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test",
])
.succeeds()
.stdout_is_fixture_bytes("deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test");
} | rust_cleaned_test_functions.jsonl/99868 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 241
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
53427,
1371,
823,
5705,
62,
18,
17,
74,
4452,
3180,
12524,
368,
341,
262,
501,
68887,
2277,
0,
741,
286,
659,
2116,
2099,
9640,
310,
330,
54341,
28,
20,
18,
16,
756,
310,
330,
5481,
28,
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_split_within() {
fn t(s: &str, i: usize, u: &[String]) {
let v = each_split_within(&(s.to_string()), i);
assert!(v.iter().zip(u.iter()).all(|(a, b)| a == b));
}
t("", 0, &[]);
t("", 15, &[]);
t("hello", 15, &["hello".to_string()]);
t(
"\nMary had a little lamb\nLittle lamb\n",
15,
&[
"Mary had a".to_string(),
"little lamb".to_string(),
"Little lamb".to_string(),
],
);
t(
"\nMary had a little lamb\nLittle lamb\n",
::std::usize::MAX,
&[
"Mary had a little lamb".to_string(),
"Little lamb".to_string(),
],
);
} | rust_cleaned_test_functions.jsonl/52353 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 388
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17052,
72385,
368,
341,
262,
5168,
259,
1141,
25,
609,
495,
11,
600,
25,
22301,
11,
575,
25,
44590,
703,
2467,
341,
286,
1077,
348,
284,
1817,
17052,
72385,
29089,
82,
2389,
3904,
11858,
600,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_progress_become_replicate() {
setup_for_test();
let mut p = new_progress(ProgressState::Probe, 1, 5, 0, 256);
p.become_replicate();
assert_eq!(p.state, ProgressState::Replicate);
assert_eq!(p.matched, 1);
assert_eq!(p.matched + 1, p.next_idx);
} | rust_cleaned_test_functions.jsonl/107083 | {
"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,
27200,
880,
51421,
25533,
48795,
368,
341,
262,
6505,
5478,
4452,
543,
262,
1077,
5206,
281,
284,
501,
27200,
7,
9496,
1397,
486,
81426,
11,
220,
16,
11,
220,
20,
11,
220,
15,
11,
220,
17,
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_raw_int() {
let (sql, params) = Postgres::build(Select::default().value(1.raw())).unwrap();
assert_eq!("SELECT 1", sql);
assert!(params.is_empty());
} | rust_cleaned_test_functions.jsonl/6456 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 93
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16067,
4042,
368,
341,
286,
1077,
320,
3544,
11,
3628,
8,
284,
3877,
17818,
486,
5834,
7,
3379,
486,
2258,
1005,
957,
7,
16,
18152,
34670,
15454,
543,
286,
2060,
10714,
17223,
4858,
220,
16,
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 |
#[test]
fn test_select_2() {
let mut model = Model::new();
let g_id = add_get(&mut model);
let b_id = add_select(&mut model, g_id, |input| {
vec![
exp::and(
exp::gt(exp::cref(input, 0), exp::cref(input, 1)),
exp::lt(exp::cref(input, 2), exp::cref(input, 3)),
),
]
});
assert_derived_attribute(&mut model, b_id, |r#box| {
HashSet::from([
cref(input(&r#box, 0), 0),
cref(input(&r#box, 0), 1),
cref(input(&r#box, 0), 2),
cref(input(&r#box, 0), 3),
])
});
} | rust_cleaned_test_functions.jsonl/42343 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 449
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13051,
62,
17,
368,
341,
286,
1077,
5206,
1614,
284,
4903,
486,
931,
543,
286,
1077,
342,
842,
284,
912,
3062,
2099,
6984,
1614,
317,
286,
1077,
293,
842,
284,
912,
13051,
2099,
6984,
1614,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_retired_records() {
let address1 = AccountAddress::new([1u8; ADDRESS_LENGTH]);
let address2 = AccountAddress::new([2u8; ADDRESS_LENGTH]);
let address3 = AccountAddress::new([3u8; ADDRESS_LENGTH]);
let value1 = AccountStateBlob::from(vec![0x01]);
let value2 = AccountStateBlob::from(vec![0x02]);
let value2_update = AccountStateBlob::from(vec![0x12]);
let value3 = AccountStateBlob::from(vec![0x03]);
let value3_update = AccountStateBlob::from(vec![0x13]);
let tmp_dir = TempPath::new();
let db = LibraDB::new(&tmp_dir);
let store = &db.state_store;
// Update.
// ```text
// | batch | 0 | 1 | 2 |
// | address1 | value1 | | |
// | address2 | value2 | value2_update | |
// | address3 | | value3 | value3_update |
let root0 = put_account_state_set(
store,
vec![(address1, value1.clone()), (address2, value2.clone())],
0, /* version */
3, /* expected_nodes_created */
0, /* expected_nodes_retired */
0, /* expected_blobs_retired */
);
let root1 = put_account_state_set(
store,
vec![
(address2, value2_update.clone()),
(address3, value3.clone()),
],
1, /* version */
3, /* expected_nodes_created */
2, /* expected_nodes_retired */
1, /* expected_blobs_retired */
);
let root2 = put_account_state_set(
store,
vec![(address3, value3_update.clone())],
2, /* version */
2, /* expected_nodes_created */
2, /* expected_nodes_retired */
1, /* expected_blobs_retired */
);
// Verify.
{
prune_stale_indices(
store, 0, /* least_readable_version */
1, /* target_least_readable_version */
0, /* limit */
);
verify_state_in_store(store, address1, Some(&value1), 0, root0);
}
// Prune till version=1.
{
prune_stale_indices(
store, 0, /* least_readable_version */
1, /* target_least_readable_version */
100, /* limit */
);
// root0 is gone.
assert!(store
.get_account_state_with_proof_by_version(address2, 0)
.is_err());
// root1 is still there.
verify_state_in_store(store, address1, Some(&value1), 1, root1);
verify_state_in_store(store, address2, Some(&value2_update), 1, root1);
verify_state_in_store(store, address3, Some(&value3), 1, root1);
}
// Prune till version=2.
{
prune_stale_indices(
store, 1, /* least_readable_version */
2, /* target_least_readable_version */
100, /* limit */
);
// root1 is gone.
assert!(store
.get_account_state_with_proof_by_version(address2, 1)
.is_err());
// root2 is still there.
verify_state_in_store(store, address1, Some(&value1), 2, root2);
verify_state_in_store(store, address2, Some(&value2_update), 2, root2);
verify_state_in_store(store, address3, Some(&value3_update), 2, root2);
}
} | rust_cleaned_test_functions.jsonl/77836 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1593
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21695,
2690,
31279,
368,
341,
262,
1077,
2621,
16,
284,
8615,
4286,
486,
931,
2561,
16,
84,
23,
26,
64428,
15023,
2558,
262,
1077,
2621,
17,
284,
8615,
4286,
486,
931,
2561,
17,
84,
23,
26,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_textobject_surround() {
let tests = &[
(
"simple (single) surround pairs",
vec![
(3, Inside, (3, 3), '(', 1),
(7, Inside, (8, 14), ')', 1),
(10, Inside, (8, 14), '(', 1),
(14, Inside, (8, 14), ')', 1),
(3, Around, (3, 3), '(', 1),
(7, Around, (7, 15), ')', 1),
(10, Around, (7, 15), '(', 1),
(14, Around, (7, 15), ')', 1),
],
),
(
"samexx 'single' surround pairs",
vec![
(3, Inside, (3, 3), '\'', 1),
(7, Inside, (7, 7), '\'', 1),
(10, Inside, (8, 14), '\'', 1),
(14, Inside, (14, 14), '\'', 1),
(3, Around, (3, 3), '\'', 1),
(7, Around, (7, 7), '\'', 1),
(10, Around, (7, 15), '\'', 1),
(14, Around, (14, 14), '\'', 1),
],
),
(
"(nested (surround (pairs)) 3 levels)",
vec![
(0, Inside, (1, 35), '(', 1),
(6, Inside, (1, 35), ')', 1),
(8, Inside, (9, 25), '(', 1),
(8, Inside, (9, 35), ')', 2),
(20, Inside, (9, 25), '(', 2),
(20, Inside, (1, 35), ')', 3),
(0, Around, (0, 36), '(', 1),
(6, Around, (0, 36), ')', 1),
(8, Around, (8, 26), '(', 1),
(8, Around, (8, 36), ')', 2),
(20, Around, (8, 26), '(', 2),
(20, Around, (0, 36), ')', 3),
],
),
(
"(mixed {surround [pair] same} line)",
vec![
(2, Inside, (1, 34), '(', 1),
(9, Inside, (8, 28), '{', 1),
(18, Inside, (18, 22), '[', 1),
(2, Around, (0, 35), '(', 1),
(9, Around, (7, 29), '{', 1),
(18, Around, (17, 23), '[', 1),
],
),
(
"(stepped (surround) pairs (should) skip)",
vec![(22, Inside, (1, 39), '(', 1), (22, Around, (0, 40), '(', 1)],
),
(
"[surround pairs{\non different]\nlines}",
vec![
(7, Inside, (1, 29), '[', 1),
(15, Inside, (16, 36), '{', 1),
(7, Around, (0, 30), '[', 1),
(15, Around, (15, 37), '{', 1),
],
),
];
for (sample, scenario) in tests {
let doc = Rope::from(*sample);
let slice = doc.slice(..);
for &case in scenario {
let (pos, objtype, expected_range, ch, count) = case;
let result = textobject_surround(slice, Range::point(pos), objtype, ch, count);
assert_eq!(
result,
expected_range.into(),
"\nCase failed: {:?} - {:?}",
sample,
case
);
}
}
} | rust_cleaned_test_functions.jsonl/107629 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2256
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4326,
1700,
49946,
1049,
368,
341,
1789,
286,
1077,
7032,
284,
609,
9640,
310,
2399,
394,
330,
22944,
320,
15338,
8,
8995,
13530,
756,
394,
7486,
90515,
503,
320,
18,
11,
27368,
11,
320,
18,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 6 |
#[test]
fn test_update_new() {
let mut crds = Crds::default();
let original = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
&Pubkey::default(),
0,
)));
let value_hash = hash(&serialize(&original).unwrap());
assert_matches!(crds.insert(original, 0), Ok(()));
let val = CrdsValue::new_unsigned(CrdsData::ContactInfo(ContactInfo::new_localhost(
&Pubkey::default(),
1,
)));
assert_eq!(crds.insert(val.clone(), 1), Ok(()));
assert_eq!(*crds.purged.back().unwrap(), (value_hash, 1));
assert_eq!(crds.table[&val.label()].local_timestamp, 1);
} | rust_cleaned_test_functions.jsonl/10449 | {
"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,
8882,
5921,
368,
341,
286,
1077,
5206,
1560,
5356,
284,
4553,
5356,
486,
2258,
543,
286,
1077,
4024,
284,
4553,
5356,
1130,
486,
931,
67830,
3025,
81,
5356,
1043,
486,
8732,
1731,
99102,
1731,
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_missing_name() {
let p: Person = Person::from(",1");
assert_eq!(p.name, "John");
assert_eq!(p.age, 30);
} | rust_cleaned_test_functions.jsonl/1615 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 83
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
40447,
1269,
368,
341,
286,
1077,
281,
25,
7357,
284,
7357,
486,
1499,
12918,
16,
797,
286,
2060,
10714,
10297,
79,
2644,
11,
330,
13079,
797,
286,
2060,
10714,
10297,
79,
30810,
11,
220,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_invalid() {
assert!(validate("1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62j").unwrap_err() ==
"checksum did not validate")
} | rust_cleaned_test_functions.jsonl/29811 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 83
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
31433,
368,
341,
262,
2060,
10297,
7067,
445,
16,
1890,
16193,
16,
20,
57,
48,
55,
23563,
52,
70,
22715,
80,
41,
17,
72,
22,
57,
17,
35,
6325,
17,
41,
21,
71,
54,
21,
17,
73,
1827,
15454... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_pay_for_txn_real() {
init!("ledger");
let (_, schema_json) = ::utils::libindy::anoncreds::tests::create_schema(::utils::constants::DEFAULT_SCHEMA_ATTRS);
let create_schema_req = ::utils::libindy::anoncreds::tests::create_schema_req(&schema_json);
let start_wallet = get_wallet_token_info().unwrap();
let (payment, response) = pay_for_txn(&create_schema_req, "101").unwrap();
let end_wallet = get_wallet_token_info().unwrap();
let payment = payment.unwrap();
assert_eq!(payment.amount, 2);
assert_eq!(payment.outputs.len(), 1);
assert_eq!(start_wallet.balance - 2, end_wallet.balance);
} | rust_cleaned_test_functions.jsonl/10483 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 304
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
28925,
5478,
92299,
15266,
368,
341,
286,
2930,
17223,
50704,
797,
286,
1077,
39464,
10802,
9455,
8,
284,
3504,
6031,
486,
2740,
48990,
486,
58910,
85734,
486,
23841,
486,
3182,
25371,
38732,
6031,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_list_response_encode_decoding() {
use dataplane::api::Request;
fluvio_future::subscriber::init_logger();
let list = ListResponse::<CustomSpuSpec>::new(vec![Metadata {
name: "test".to_string(),
spec: CustomSpuSpec::default(),
status: SpuStatus::default(),
}]);
let resp: ObjectApiListResponse = list.into();
let mut header = RequestHeader::new(ObjectApiListRequest::API_KEY);
header.set_client_id("test");
header.set_correlation_id(11);
let res_msg = ResponseMessage::from_header(&header, resp);
let mut src = vec![];
res_msg.encode(&mut src, 0).expect("encoding");
println!("output: {:#?}", src);
let dec_msg: ResponseMessage<ObjectApiListResponse> = ResponseMessage::decode_from(
&mut Cursor::new(&src),
ObjectApiListRequest::API_KEY as i16,
)
.expect("decode");
assert!(matches!(
dec_msg.response,
ObjectApiListResponse::CustomSpu(_)
));
let list_res: ListResponse<CustomSpuSpec> = dec_msg.response.try_into().expect("extract");
assert_eq!(list_res.inner().len(), 1);
} | rust_cleaned_test_functions.jsonl/72296 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 568
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2019,
9655,
11224,
13783,
3700,
368,
341,
286,
990,
61723,
37847,
486,
2068,
486,
1900,
401,
286,
1320,
12058,
815,
59740,
486,
59205,
486,
2327,
27413,
1428,
286,
1077,
1140,
284,
1759,
2582,
276... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_non_empty_split() {
type ReadChunk = HashMap<String, i32>;
#[derive(Serialize, Deserialize, MartianStruct)]
pub struct SI {
chunks: Vec<ReadChunk>,
reads_per_file: i64,
}
#[derive(Serialize, Deserialize, MartianStruct)]
pub struct SO {
out_chunks: Vec<ReadChunk>,
}
#[derive(Serialize, Deserialize, MartianStruct)]
pub struct CI {
read_chunk: ReadChunk,
}
pub struct ChunkerStage;
#[make_mro(mem_gb = 2, stage_name = CHUNK_READS)]
impl MartianStage for ChunkerStage {
type StageInputs = SI;
type StageOutputs = SO;
type ChunkInputs = CI;
type ChunkOutputs = MartianVoid;
fn split(&self, _: SI, _: MartianRover) -> Result<StageDef<CI>, Error> {
unimplemented!()
}
fn main(&self, _: SI, _: CI, _: MartianRover) -> Result<MartianVoid, Error> {
unimplemented!()
}
fn join(
&self,
_: SI,
_: Vec<CI>,
_: Vec<MartianVoid>,
_: MartianRover,
) -> Result<SO, Error> {
unimplemented!()
}
}
let expected = include_str!("mro/test_non_empty_split.mro");
assert_eq!(
make_mro_string(HEADER, &[ChunkerStage::stage_mro("my_adapter", "chunker")]),
expected
)
} | rust_cleaned_test_functions.jsonl/104052 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 679
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21637,
15124,
17052,
368,
341,
262,
943,
4457,
28304,
284,
10528,
3464,
11,
600,
18,
17,
10133,
262,
11506,
27098,
3759,
9050,
11,
48440,
11,
81028,
9422,
5563,
262,
6675,
2036,
30548,
341,
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_basic() {
let mut column = VectorValue::with_capacity(0, EvalType::Bytes);
assert_eq!(column.eval_type(), EvalType::Bytes);
assert_eq!(column.len(), 0);
assert_eq!(column.capacity(), 0);
assert!(column.is_empty());
assert_eq!(column.as_bytes_slice(), &[]);
column.push_bytes(None);
assert_eq!(column.len(), 1);
assert!(column.capacity() > 0);
assert!(!column.is_empty());
assert_eq!(column.as_bytes_slice(), &[None]);
column.push_bytes(Some(vec![1, 2, 3]));
assert_eq!(column.len(), 2);
assert!(column.capacity() > 0);
assert!(!column.is_empty());
assert_eq!(column.as_bytes_slice(), &[None, Some(vec![1, 2, 3])]);
let mut column = VectorValue::with_capacity(3, EvalType::Real);
assert_eq!(column.eval_type(), EvalType::Real);
assert_eq!(column.len(), 0);
assert_eq!(column.capacity(), 3);
assert!(column.is_empty());
assert_eq!(column.as_real_slice(), &[]);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(column.clone().as_real_slice(), column.as_real_slice());
column.push_real(Real::new(1.0).ok());
assert_eq!(column.len(), 1);
assert_eq!(column.capacity(), 3);
assert!(!column.is_empty());
assert_eq!(column.as_real_slice(), &[Real::new(1.0).ok()]);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(column.clone().as_real_slice(), column.as_real_slice());
column.push_real(None);
assert_eq!(column.len(), 2);
assert_eq!(column.capacity(), 3);
assert!(!column.is_empty());
assert_eq!(column.as_real_slice(), &[Real::new(1.0).ok(), None]);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(column.clone().as_real_slice(), column.as_real_slice());
column.push_real(Real::new(4.5).ok());
assert_eq!(column.len(), 3);
assert_eq!(column.capacity(), 3);
assert!(!column.is_empty());
assert_eq!(
column.as_real_slice(),
&[Real::new(1.0).ok(), None, Real::new(4.5).ok()]
);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(column.clone().as_real_slice(), column.as_real_slice());
column.push_real(None);
assert_eq!(column.len(), 4);
assert!(column.capacity() > 3);
assert!(!column.is_empty());
assert_eq!(
column.as_real_slice(),
&[Real::new(1.0).ok(), None, Real::new(4.5).ok(), None]
);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(column.clone().as_real_slice(), column.as_real_slice());
column.truncate(2);
assert_eq!(column.len(), 2);
assert!(column.capacity() > 3);
assert!(!column.is_empty());
assert_eq!(column.as_real_slice(), &[Real::new(1.0).ok(), None]);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(column.clone().as_real_slice(), column.as_real_slice());
let column = VectorValue::with_capacity(10, EvalType::DateTime);
assert_eq!(column.eval_type(), EvalType::DateTime);
assert_eq!(column.len(), 0);
assert_eq!(column.capacity(), 10);
assert!(column.is_empty());
assert_eq!(column.as_date_time_slice(), &[]);
assert_eq!(column.clone().capacity(), column.capacity());
assert_eq!(
column.clone().as_date_time_slice(),
column.as_date_time_slice()
);
} | rust_cleaned_test_functions.jsonl/88507 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1678
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
34729,
368,
341,
286,
1077,
5206,
3250,
284,
4196,
1130,
486,
4197,
35603,
7,
15,
11,
58239,
929,
486,
7078,
317,
286,
2060,
10714,
10297,
6229,
31710,
1819,
1507,
58239,
929,
486,
7078,
317,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_dequeue_all() {
let mut state = PlaybackState::default();
state.queue(song("3"));
state.play("3");
assert!(state.is_playing());
state.dequeue("3");
assert_eq!(state.song_id(), None);
} | rust_cleaned_test_functions.jsonl/20832 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 127
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2259,
4584,
5705,
368,
341,
286,
1077,
5206,
1584,
284,
95301,
1397,
486,
2258,
543,
286,
1584,
29598,
60873,
445,
18,
14929,
286,
1584,
12972,
445,
18,
797,
286,
2060,
10297,
2454,
2079,
83857,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_stale_learner() {
let mut cluster = new_server_cluster(0, 4);
let pd_client = Arc::clone(&cluster.pd_client);
// Disable default max peer number check.
pd_client.disable_default_operator();
let r1 = cluster.run_conf_change();
pd_client.must_add_peer(r1, new_peer(2, 2));
pd_client.must_add_peer(r1, new_learner_peer(3, 3));
cluster.must_put(b"k1", b"v1");
let engine3 = cluster.get_engine(3);
must_get_equal(&engine3, b"k1", b"v1");
// And then isolate peer on store 3 from leader.
cluster.add_send_filter(IsolationFilterFactory::new(3));
// Add a new peer to increase the conf version.
pd_client.must_add_peer(r1, new_peer(4, 4));
// It should not be deleted.
thread::sleep(Duration::from_secs(3));
must_get_equal(&engine3, b"k1", b"v1");
// Promote the learner
pd_client.must_add_peer(r1, new_peer(3, 3));
// It should not be deleted.
thread::sleep(Duration::from_secs(3));
must_get_equal(&engine3, b"k1", b"v1");
// Delete the learner
pd_client.must_remove_peer(r1, new_peer(3, 3));
must_get_none(&engine3, b"k1");
let state_key = keys::region_state_key(r1);
let state: RegionLocalState = engine3.get_msg_cf(CF_RAFT, &state_key).unwrap().unwrap();
assert_eq!(state.get_state(), PeerState::Tombstone);
} | rust_cleaned_test_functions.jsonl/26896 | {
"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,
1261,
1574,
62,
93595,
368,
341,
262,
1077,
5206,
10652,
284,
501,
12015,
28441,
7,
15,
11,
220,
19,
317,
262,
1077,
7744,
8179,
284,
19689,
486,
19982,
2099,
18855,
556,
67,
8179,
317,
262,
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_saturating_sub_int() {
use int::{MIN,MAX};
assert_eq!(3i.saturating_sub(5i), -2i);
assert_eq!(MIN.saturating_sub(1i), MIN);
assert_eq!((-2i).saturating_sub(MAX), MIN);
assert_eq!(3i.saturating_sub(-5i), 8i);
assert_eq!(3i.saturating_sub(-(MAX-1)), MAX);
assert_eq!(MAX.saturating_sub(-MAX), MAX);
assert_eq!((MAX-2).saturating_sub(-1), MAX-1);
} | rust_cleaned_test_functions.jsonl/23666 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 237
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
643,
2628,
1095,
5228,
4042,
368,
341,
286,
990,
526,
22964,
16413,
11,
10586,
2440,
286,
2060,
10714,
10297,
18,
72,
514,
2628,
1095,
5228,
7,
20,
72,
701,
481,
17,
72,
317,
286,
2060,
10714,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_dfa_constructor() {
let config = RegExpConfig::new();
let dfa = DFA::from(
vec![
GraphemeCluster::from("abcd", &RegExpConfig::new()),
GraphemeCluster::from("abxd", &RegExpConfig::new()),
],
&config,
);
assert_eq!(dfa.graph.node_count(), 5);
assert_eq!(dfa.graph.edge_count(), 5);
} | rust_cleaned_test_functions.jsonl/29706 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 232
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
814,
3632,
66210,
368,
341,
286,
1077,
2193,
284,
28487,
2648,
486,
931,
543,
286,
1077,
294,
3632,
284,
93631,
486,
1499,
1006,
310,
7486,
90515,
394,
12165,
3894,
28678,
486,
1499,
445,
68644,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_immediate_blocking() {
let system = KompactConfig::default().build().expect("System");
let comp = system.create(BlockingComponent::new);
system
.start_notify(&comp)
.wait_timeout(TIMEOUT)
.expect("Component didn't start");
comp.actor_ref().tell(BlockMe::Now);
thread::sleep(TIMEOUT);
system
.kill_notify(comp.clone())
.wait_timeout(TIMEOUT)
.expect("Component didn't die");
comp.on_definition(|cd| {
assert_eq!(cd.test_string, "done");
});
system.shutdown().expect("shutdown");
} | rust_cleaned_test_functions.jsonl/107758 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 321
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
17895,
14636,
91449,
368,
341,
286,
1077,
1849,
284,
730,
14435,
531,
2648,
486,
2258,
1005,
5834,
1005,
17119,
445,
2320,
797,
286,
1077,
1367,
284,
1849,
2520,
7,
48266,
2189,
486,
931,
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_python() {
let static_method = Name::built_in("staticmethod");
let exit = Name::imported("sys", "exit");
let mut file = FileSpec::new();
let mut hello = MethodSpec::new("hello");
hello.push_decorator(static_method);
hello.push(stmt!["return 12"]);
let mut bye = MethodSpec::new("bye");
bye.push(stmt![exit, "(1)"]);
let mut foo = ClassSpec::new("Foo");
foo.push(hello);
foo.push(bye);
file.push(foo);
let reference = ::std::str::from_utf8(include_bytes!("tests/test.py")).unwrap();
assert_eq!(reference, file.to_string());
} | rust_cleaned_test_functions.jsonl/4459 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 302
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
55869,
368,
341,
286,
1077,
1099,
9032,
284,
3988,
486,
46239,
1243,
445,
22215,
797,
286,
1077,
4869,
284,
3988,
486,
474,
291,
445,
7791,
497,
330,
13652,
3071,
286,
1077,
5206,
1034,
284,
288... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_get_registry() {
let registry = get_registry().unwrap();
let expected = r#"---
CStyleEnum:
ENUM:
0:
A: UNIT
1:
B: UNIT
2:
C: UNIT
3:
D: UNIT
4:
E: UNIT
List:
ENUM:
0:
Empty: UNIT
1:
Node:
TUPLE:
- TYPENAME: SerdeData
- TYPENAME: List
NewTypeStruct:
NEWTYPESTRUCT: U64
OtherTypes:
STRUCT:
- f_string: STR
- f_bytes: BYTES
- f_option:
OPTION:
TYPENAME: Struct
- f_unit: UNIT
- f_seq:
SEQ:
TYPENAME: Struct
- f_tuple:
TUPLE:
- U8
- U16
- f_stringmap:
MAP:
KEY: STR
VALUE: U32
- f_intset:
MAP:
KEY: U64
VALUE: UNIT
- f_nested_seq:
SEQ:
SEQ:
TYPENAME: Struct
PrimitiveTypes:
STRUCT:
- f_bool: BOOL
- f_u8: U8
- f_u16: U16
- f_u32: U32
- f_u64: U64
- f_u128: U128
- f_i8: I8
- f_i16: I16
- f_i32: I32
- f_i64: I64
- f_i128: I128
- f_f32:
OPTION: F32
- f_f64:
OPTION: F64
- f_char:
OPTION: CHAR
SerdeData:
ENUM:
0:
PrimitiveTypes:
NEWTYPE:
TYPENAME: PrimitiveTypes
1:
OtherTypes:
NEWTYPE:
TYPENAME: OtherTypes
2:
UnitVariant: UNIT
3:
NewTypeVariant:
NEWTYPE: STR
4:
TupleVariant:
TUPLE:
- U32
- U64
5:
StructVariant:
STRUCT:
- f0:
TYPENAME: UnitStruct
- f1:
TYPENAME: NewTypeStruct
- f2:
TYPENAME: TupleStruct
- f3:
TYPENAME: Struct
6:
ListWithMutualRecursion:
NEWTYPE:
TYPENAME: List
7:
TreeWithMutualRecursion:
NEWTYPE:
TYPENAME: Tree
8:
TupleArray:
NEWTYPE:
TUPLEARRAY:
CONTENT: U32
SIZE: 3
9:
UnitVector:
NEWTYPE:
SEQ: UNIT
10:
SimpleList:
NEWTYPE:
TYPENAME: SimpleList
11:
CStyleEnum:
NEWTYPE:
TYPENAME: CStyleEnum
12:
ComplexMap:
NEWTYPE:
MAP:
KEY:
TUPLE:
- TUPLEARRAY:
CONTENT: U32
SIZE: 2
- TUPLEARRAY:
CONTENT: U8
SIZE: 4
VALUE: UNIT
SimpleList:
NEWTYPESTRUCT:
OPTION:
TYPENAME: SimpleList
Struct:
STRUCT:
- x: U32
- y: U64
Tree:
STRUCT:
- value:
TYPENAME: SerdeData
- children:
SEQ:
TYPENAME: Tree
TupleStruct:
TUPLESTRUCT:
- U32
- U64
UnitStruct: UNITSTRUCT
"#
.lines()
.collect::<Vec<_>>();
assert_eq!(
serde_yaml::to_string(®istry)
.unwrap()
.lines()
.collect::<Vec<_>>(),
expected
);
} | rust_cleaned_test_functions.jsonl/46322 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1943
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
3062,
50650,
368,
341,
262,
1077,
19424,
284,
633,
50650,
1005,
15454,
543,
262,
1077,
3601,
284,
435,
55543,
10952,
34,
2323,
10766,
510,
220,
68404,
510,
262,
220,
15,
510,
414,
362,
25,
38202... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_remove_comments_single_escapes_string() {
let example: Vec<char> = "test//\"tes\"\n\"t".to_string().chars().collect();
let result = remove_comments(&example);
let without_comments = chars_to_string(&result.without_comments);
assert_eq!("test \n\"t", without_comments);
assert_eq!(1, result.comments.len());
assert_eq!(4, result.comments[0].position);
assert_eq!("\"tes\"", chars_to_string(&result.comments[0].text));
} | rust_cleaned_test_functions.jsonl/126902 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 207
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18193,
30359,
19487,
92196,
9337,
3904,
368,
341,
286,
1077,
3110,
25,
11312,
21919,
29,
284,
330,
1944,
322,
2105,
2338,
22245,
77,
2105,
83,
3263,
983,
3904,
1005,
19255,
1005,
17384,
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_equality() {
let lowercase_d_with_shift = KeyEvent::new(KeyCode::Char('d'), KeyModifiers::SHIFT);
let uppercase_d_with_shift = KeyEvent::new(KeyCode::Char('D'), KeyModifiers::SHIFT);
let uppercase_d = KeyEvent::new(KeyCode::Char('D'), KeyModifiers::NONE);
assert_eq!(lowercase_d_with_shift, uppercase_d_with_shift);
assert_eq!(uppercase_d, uppercase_d_with_shift);
} | rust_cleaned_test_functions.jsonl/38046 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 192
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
2204,
10473,
368,
341,
286,
1077,
42047,
814,
6615,
22230,
284,
48275,
486,
931,
41040,
486,
4768,
492,
67,
4567,
5309,
66937,
486,
45743,
317,
286,
1077,
39482,
814,
6615,
22230,
284,
48275,
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_nirmala() {
run_test(
&TEST_DATA,
"directwrite/good-nirmala.ml",
"indic/Nirmala.ttf",
&[JOINER_GLYPH_INDEX],
871,
);
} | rust_cleaned_test_functions.jsonl/91224 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 214
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1089,
2853,
6053,
368,
341,
394,
1598,
4452,
1006,
503,
609,
10033,
7896,
345,
503,
330,
19798,
4934,
4846,
1386,
5279,
2853,
6053,
57409,
756,
503,
330,
85084,
20290,
2853,
6053,
45192,
756,
503,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_unresolved_module_diagnostic() {
check_expect(
r#"mod foo;"#,
expect![[r#"
[
Diagnostic {
message: "unresolved module",
range: 0..8,
severity: Error,
fix: Some(
Assist {
id: AssistId(
"create_module",
QuickFix,
),
label: "Create module",
group: None,
target: 0..8,
source_change: Some(
SourceChange {
source_file_edits: {},
file_system_edits: [
CreateFile {
dst: AnchoredPathBuf {
anchor: FileId(
0,
),
path: "foo.rs",
},
initial_contents: "",
},
],
is_snippet: false,
},
),
},
),
unused: false,
code: Some(
DiagnosticCode(
"unresolved-module",
),
),
},
]
"#]],
);
} | rust_cleaned_test_functions.jsonl/34392 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1639
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4907,
39747,
10750,
29477,
11953,
368,
341,
286,
1779,
68918,
1006,
310,
435,
55543,
2593,
15229,
10892,
2,
345,
310,
1720,
0,
15505,
81,
2,
698,
394,
2278,
503,
49988,
341,
664,
1943,
25,
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_iterator_size_hint() {
let c = count(0, 1);
let v = &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
let v2 = &[10, 11, 12];
let vi = v.iter();
assert_eq!(c.size_hint(), (uint::max_value, None));
assert_eq!(vi.size_hint(), (10, Some(10)));
assert_eq!(c.take(5).size_hint(), (5, Some(5)));
assert_eq!(c.skip(5).size_hint().second(), None);
assert_eq!(c.take_while(|_| false).size_hint(), (0, None));
assert_eq!(c.skip_while(|_| false).size_hint(), (0, None));
assert_eq!(c.enumerate().size_hint(), (uint::max_value, None));
assert_eq!(c.chain(vi.map(|&i| i)).size_hint(), (uint::max_value, None));
assert_eq!(c.zip(vi).size_hint(), (10, Some(10)));
assert_eq!(c.scan(0, |_,_| Some(0)).size_hint(), (0, None));
assert_eq!(c.filter(|_| false).size_hint(), (0, None));
assert_eq!(c.map(|_| 0).size_hint(), (uint::max_value, None));
assert_eq!(c.filter_map(|_| Some(0)).size_hint(), (0, None));
assert_eq!(vi.take(5).size_hint(), (5, Some(5)));
assert_eq!(vi.take(12).size_hint(), (10, Some(10)));
assert_eq!(vi.skip(3).size_hint(), (7, Some(7)));
assert_eq!(vi.skip(12).size_hint(), (0, Some(0)));
assert_eq!(vi.take_while(|_| false).size_hint(), (0, Some(10)));
assert_eq!(vi.skip_while(|_| false).size_hint(), (0, Some(10)));
assert_eq!(vi.enumerate().size_hint(), (10, Some(10)));
assert_eq!(vi.chain(v2.iter()).size_hint(), (13, Some(13)));
assert_eq!(vi.zip(v2.iter()).size_hint(), (3, Some(3)));
assert_eq!(vi.scan(0, |_,_| Some(0)).size_hint(), (0, Some(10)));
assert_eq!(vi.filter(|_| false).size_hint(), (0, Some(10)));
assert_eq!(vi.map(|i| i+1).size_hint(), (10, Some(10)));
assert_eq!(vi.filter_map(|_| Some(0)).size_hint(), (0, Some(10)));
} | rust_cleaned_test_functions.jsonl/1014 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1003
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13491,
2368,
45825,
368,
341,
286,
1077,
272,
284,
1760,
7,
15,
11,
220,
16,
317,
286,
1077,
348,
284,
44590,
15,
11,
220,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
220,
20,
11,
220... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_ellipse_max_thickness() {
let ellipse = Ellipse::new(10, 20, (10, 10), Color::Black);
assert_eq!(ellipse.max_thickness(), 10);
let ellipse = Ellipse::new(123, 100, (10, 10), Color::Black);
assert_eq!(ellipse.max_thickness(), 100);
} | rust_cleaned_test_functions.jsonl/18436 | {
"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,
62,
68004,
6345,
91231,
368,
341,
286,
1077,
57397,
284,
13542,
27332,
486,
931,
7,
16,
15,
11,
220,
17,
15,
11,
320,
16,
15,
11,
220,
16,
15,
701,
3478,
486,
14417,
626,
286,
2060,
10714,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_net_ipaddr() {
assert_de_tokens(
"1.2.3.4".parse::<net::IpAddr>().unwrap(),
&[Token::Str("1.2.3.4")],
);
} | rust_cleaned_test_functions.jsonl/112729 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 93
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
19722,
10385,
6214,
368,
341,
262,
2060,
2259,
28838,
1006,
286,
330,
16,
13,
17,
13,
18,
13,
19,
3263,
6400,
27638,
4711,
486,
23378,
13986,
10483,
15454,
3148,
286,
44590,
3323,
486,
2580,
445... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_parse_libtickit_ascii() {
let csi_sequences = vec![b'\x1b', b'\x9b'];
let mod_map = HashMap::<_, _>::from_iter(IntoIter::new([
("6", KeyMod::CtrlShift),
("8", KeyMod::AltCtrlShift),
]));
let mut upper_letters = HashMap::new();
for n in 65..91 {
upper_letters.insert(format!("{}", n), KeyCode::Char((n as u8) as char));
}
for csi in csi_sequences.iter() {
let item = csi;
let mut map = HashMap::new();
for (mod_str, mods) in mod_map.iter() {
for (letter_str, code) in upper_letters.iter() {
let start_seq = if *csi == b'\x9b' { "" } else { "[" };
let str = format!("{}{};{}u", start_seq, letter_str, mod_str);
map.insert(str, Event::Key(Key::new_mod(*code, *mods)));
}
}
test_parse_event_dynamic(*item, &mut map);
}
} | rust_cleaned_test_functions.jsonl/122261 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 548
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21039,
16142,
34155,
275,
50238,
368,
341,
286,
1077,
272,
6321,
58732,
284,
7486,
20703,
65,
15777,
87,
16,
65,
516,
293,
15777,
87,
24,
65,
3860,
286,
1077,
1463,
5376,
284,
10528,
27638,
6878... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_binop() {
let mut bindin = "(A&B)->C";
let r = binop(&mut bindin);
let aandb = Term::And(
Box::new(Term::Var("A".to_string())),
Box::new(Term::Var("B".to_string())),
);
let expected = Box::new(Term::Imply(
Box::new(aandb),
Box::new(Term::Var("C".to_string())),
));
assert_eq!(r, Ok((expected, Consumed(()))));
} | rust_cleaned_test_functions.jsonl/15160 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 196
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21816,
453,
368,
341,
262,
1077,
5206,
10719,
258,
284,
11993,
32,
48239,
3997,
34,
876,
262,
1077,
435,
284,
9544,
453,
2099,
6984,
10719,
258,
317,
262,
1077,
264,
437,
65,
284,
17519,
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_func_procmacro() {
let mut s = FileStorage::new("file_test").unwrap();
s.flush().unwrap();
#[persistent_cache]
#[params(FileStorage, "file_test")]
fn add_two(n: u64) -> u64 {
n + 2
}
assert_eq!(12, add_two(10));
s.flush().unwrap();
} | rust_cleaned_test_functions.jsonl/123182 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 184
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9596,
2540,
6226,
49507,
368,
341,
286,
1077,
5206,
274,
284,
2887,
5793,
486,
931,
445,
1192,
4452,
1827,
15454,
543,
286,
274,
23038,
1005,
15454,
1428,
286,
11506,
69389,
11529,
921,
286,
11506... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_latex_escapes() {
let escapes = [
("&", "\\&"),
("%", "\\%"),
("$", "\\$"),
("#", "\\#"),
("_", "\\_"),
("{Hello}", "\\{Hello\\}"),
("[Hello]", "{[}Hello{]}"),
("~", "\\textasciitilde{}"),
("^", "\\textasciicircum{}"),
("\\", "\\textbackslash{}"),
];
for (input, expected) in escapes.iter() {
let s = input.to_string();
let out = escape_to_latex(&s);
assert_eq!(out.to_string(), *expected);
}
} | rust_cleaned_test_functions.jsonl/6488 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 430
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
26174,
327,
92196,
9337,
368,
341,
286,
1077,
65109,
284,
2278,
310,
3489,
5,
497,
26468,
5,
4461,
310,
3489,
40192,
26468,
80741,
310,
3489,
73315,
26468,
3,
4461,
310,
3489,
75915,
26468,
2,
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_part2() {
assert_eq!(super::part2(INPUT_SMALL), 8);
assert_eq!(super::part2(INPUT_MED), 19208);
} | rust_cleaned_test_functions.jsonl/86117 | {
"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,
10495,
17,
368,
341,
286,
2060,
10714,
10297,
9522,
486,
4480,
17,
57911,
56207,
701,
220,
23,
317,
286,
2060,
10714,
10297,
9522,
486,
4480,
17,
57911,
97550,
701,
220,
16,
24,
17,
15,
23,
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_find_shiny_gold_self() {
assert_eq!(
find_shiny_gold(hashmap!("shiny gold".to_string() => vec![])),
hashset!()
)
} | rust_cleaned_test_functions.jsonl/42316 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 104
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21814,
3712,
6441,
54696,
25637,
368,
341,
286,
2060,
10714,
33673,
310,
1477,
3712,
6441,
54696,
27580,
2186,
17223,
927,
6441,
6623,
3263,
983,
3904,
368,
589,
7486,
0,
1294,
6965,
310,
5175,
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 |
#[test]
fn test_find_msg_range_err() {
let data: [u8; 32] = [
0, 45, 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,
];
let range = find_msg_range(&data);
assert!(range.is_err());
} | rust_cleaned_test_functions.jsonl/119627 | {
"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,
21814,
6483,
9698,
9266,
368,
341,
286,
1077,
821,
25,
508,
84,
23,
26,
220,
18,
17,
60,
284,
2278,
310,
220,
15,
11,
220,
19,
20,
11,
220,
15,
11,
220,
15,
11,
220,
15,
11,
220,
15,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_delete_range_prefix_bloom_case_4() {
let path = tempdir_with_prefix("_rust_rocksdb_test_delete_range_prefix_bloom_case_4");
let path_str = path.path().to_str().unwrap();
let mut opts = DBOptions::new();
opts.create_if_missing(true);
let mut cf_opts = ColumnFamilyOptions::new();
cf_opts
.set_prefix_extractor::<&str, FixedSuffixSliceTransform>(
"FixedSuffixSliceTransform",
FixedSuffixSliceTransform::new(3),
)
.unwrap_or_else(|err| panic!(format!("{:?}", err)));
// Create prefix bloom filter for memtable.
cf_opts.set_memtable_prefix_bloom_size_ratio(0.1 as f64);
let cf = "default";
let db = DB::open_cf(opts, path_str, vec![(cf, cf_opts)]).unwrap();
let handle = get_cf_handle(&db, cf).unwrap();
let samples_a = vec![
(b"keya11111", b"value1"),
(b"keyb22222", b"value2"),
(b"keyc33333", b"value3"),
(b"keyd44444", b"value4"),
(b"keye55555", b"value5"),
];
for (k, v) in samples_a {
db.put_cf(handle, k, v).unwrap();
assert_eq!(v, &*db.get(k).unwrap().unwrap());
}
let before = gen_crc32_from_db(&db);
db.delete_range_cf(handle, b"keyd44444", b"keyf66666")
.unwrap();
check_kv(
&db,
db.cf_handle(cf),
&[
(b"keya11111", Some(b"value1")),
(b"keyb22222", Some(b"value2")),
(b"keyc33333", Some(b"value3")),
(b"keyd44444", None),
(b"keye55555", None),
],
);
let path = tempdir_with_prefix("_rust_rocksdb_test_delete_range_prefix_bloom_case_4_2");
let path_str = path.path().to_str().unwrap();
let mut opts = DBOptions::new();
opts.create_if_missing(true);
let mut cf_opts = ColumnFamilyOptions::new();
cf_opts
.set_prefix_extractor::<&str, FixedSuffixSliceTransform>(
"FixedSuffixSliceTransform",
FixedSuffixSliceTransform::new(3),
)
.unwrap_or_else(|err| panic!(format!("{:?}", err)));
// Create prefix bloom filter for memtable.
cf_opts.set_memtable_prefix_bloom_size_ratio(0.1 as f64);
let cf = "default";
let db2 = DB::open_cf(opts, path_str, vec![(cf, cf_opts)]).unwrap();
let handle2 = get_cf_handle(&db2, cf).unwrap();
let samples_b = vec![(b"keyd44444", b"value4"), (b"keye55555", b"value5")];
for (k, v) in samples_b {
db2.put_cf(handle2, k, v).unwrap();
assert_eq!(v, &*db2.get(k).unwrap().unwrap());
}
let gen_path = tempdir_with_prefix("_rust_rocksdb_case_prefix_bloom_4_ingest_sst_gen");
let test_sstfile = gen_path.path().join("test_sst_file");
let test_sstfile_str = test_sstfile.to_str().unwrap();
let ingest_opt = IngestExternalFileOptions::new();
let default_options = db2.get_options();
gen_sst_from_db(default_options, db2.cf_handle(cf), test_sstfile_str, &db2);
db.ingest_external_file_cf(handle, &ingest_opt, &[test_sstfile_str])
.unwrap();
check_kv(
&db,
db.cf_handle(cf),
&[
(b"keya11111", Some(b"value1")),
(b"keyb22222", Some(b"value2")),
(b"keyc33333", Some(b"value3")),
(b"keyd44444", Some(b"value4")),
(b"keye55555", Some(b"value5")),
],
);
let after = gen_crc32_from_db(&db);
assert_eq!(before, after);
} | rust_cleaned_test_functions.jsonl/57050 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1706
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11353,
9698,
13974,
880,
18474,
19096,
62,
19,
368,
341,
262,
1077,
1815,
284,
2730,
3741,
6615,
13974,
16975,
35788,
26608,
14553,
1999,
4452,
11353,
9698,
13974,
880,
18474,
19096,
62,
19,
797,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_sort_thiel_radixsort_f32_inf() {
let mut a = helper_random_array_uniform_f32(2000);
a[1999] = std::f32::NEG_INFINITY;
a[0] = std::f32::INFINITY;
let mut check = a.to_vec();
thiel_radixsort(&mut a, 8);
check.par_sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
assert_eq!(a, check);
} | rust_cleaned_test_functions.jsonl/43422 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 166
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18435,
5854,
13029,
39764,
941,
6860,
761,
18,
17,
26051,
368,
341,
262,
1077,
5206,
264,
284,
13137,
22644,
3858,
45066,
761,
18,
17,
7,
17,
15,
15,
15,
317,
262,
264,
58,
16,
24,
24,
24,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_uint32_addmany() {
let mut rng = XorShiftRng::from_seed([
0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06,
0xbc, 0xe5,
]);
for _ in 0..1000 {
let mut cs = TestConstraintSystem::<Bls12>::new();
let a = rng.next_u32();
let b = rng.next_u32();
let c = rng.next_u32();
let d = rng.next_u32();
let mut expected = (a ^ b).wrapping_add(c).wrapping_add(d);
let a_bit = UInt32::alloc(cs.namespace(|| "a_bit"), Some(a)).unwrap();
let b_bit = UInt32::constant(b);
let c_bit = UInt32::constant(c);
let d_bit = UInt32::alloc(cs.namespace(|| "d_bit"), Some(d)).unwrap();
let r = a_bit.xor(cs.namespace(|| "xor"), &b_bit).unwrap();
let r = {
let mut cs = MultiEq::new(&mut cs);
UInt32::addmany(cs.namespace(|| "addition"), &[r, c_bit, d_bit]).unwrap()
};
assert!(cs.is_satisfied());
assert!(r.value == Some(expected));
for b in r.bits.iter() {
match *b {
Boolean::Is(ref b) => {
assert!(b.get_value().unwrap() == (expected & 1 == 1));
}
Boolean::Not(ref b) => {
assert!(!b.get_value().unwrap() == (expected & 1 == 1));
}
Boolean::Constant(_) => unreachable!(),
}
expected >>= 1;
}
// Flip a bit and see if the addition constraint still works
if cs.get("addition/result bit 0/boolean").is_zero() {
cs.set("addition/result bit 0/boolean", Field::one());
} else {
cs.set("addition/result bit 0/boolean", Field::zero());
}
assert!(!cs.is_satisfied());
}
} | rust_cleaned_test_functions.jsonl/20440 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1146
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15807,
18,
17,
2891,
34576,
368,
341,
286,
1077,
5206,
28422,
284,
1599,
269,
24841,
49,
968,
486,
1499,
33809,
8956,
310,
220,
15,
87,
20,
24,
11,
220,
15,
87,
21,
17,
11,
220,
15,
42459,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_filter_fixed_size_list_arrays() {
let value_data = ArrayData::builder(DataType::Int32)
.len(9)
.add_buffer(Buffer::from_slice_ref(&[0, 1, 2, 3, 4, 5, 6, 7, 8]))
.build()
.unwrap();
let list_data_type = DataType::FixedSizeList(
Box::new(Field::new("item", DataType::Int32, false)),
3,
);
let list_data = ArrayData::builder(list_data_type)
.len(3)
.add_child_data(value_data)
.build()
.unwrap();
let array = FixedSizeListArray::from(list_data);
let filter_array = BooleanArray::from(vec![true, false, false]);
let c = filter(&array, &filter_array).unwrap();
let filtered = c.as_any().downcast_ref::<FixedSizeListArray>().unwrap();
assert_eq!(filtered.len(), 1);
let list = filtered.value(0);
assert_eq!(
&[0, 1, 2],
list.as_any().downcast_ref::<Int32Array>().unwrap().values()
);
let filter_array = BooleanArray::from(vec![true, false, true]);
let c = filter(&array, &filter_array).unwrap();
let filtered = c.as_any().downcast_ref::<FixedSizeListArray>().unwrap();
assert_eq!(filtered.len(), 2);
let list = filtered.value(0);
assert_eq!(
&[0, 1, 2],
list.as_any().downcast_ref::<Int32Array>().unwrap().values()
);
let list = filtered.value(1);
assert_eq!(
&[6, 7, 8],
list.as_any().downcast_ref::<Int32Array>().unwrap().values()
);
} | rust_cleaned_test_functions.jsonl/75313 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 823
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8727,
37839,
2368,
2019,
68983,
368,
341,
286,
1077,
897,
1769,
284,
2910,
1043,
486,
17850,
63941,
486,
1072,
18,
17,
340,
310,
659,
2892,
7,
24,
340,
310,
659,
718,
7776,
55574,
486,
1499,
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_clause_construction() {
let a = VarRef::from(0usize);
let b = VarRef::from(1usize);
fn check(input: Vec<Bound>, mut output: Vec<Bound>) {
let clause = Disjunction::new(input);
let simplified = Vec::from(clause);
output.sort_unstable();
assert_eq!(simplified, output);
}
check(vec![geq(a, 0), geq(a, 1)], vec![geq(a, 0)]);
check(vec![leq(a, 0), leq(a, 1)], vec![leq(a, 1)]);
check(vec![leq(a, 1), leq(a, 0)], vec![leq(a, 1)]);
check(vec![leq(a, 0), leq(a, 0)], vec![leq(a, 0)]);
check(vec![leq(a, 0), leq(a, 1), leq(a, 1), leq(a, 0)], vec![leq(a, 1)]);
check(vec![leq(a, 0), !leq(a, 0)], vec![leq(a, 0), !leq(a, 0)]);
check(
vec![leq(a, 0), leq(b, 1), leq(a, 1), leq(b, 0)],
vec![leq(a, 1), leq(b, 1)],
);
check(
vec![geq(a, 0), geq(b, 1), geq(a, 1), geq(b, 0)],
vec![geq(a, 0), geq(b, 0)],
);
check(
vec![
leq(a, 0),
leq(b, 1),
leq(a, 1),
leq(b, 0),
geq(a, 0),
geq(b, 1),
geq(a, 1),
geq(b, 0),
],
vec![leq(a, 1), geq(a, 0), leq(b, 1), geq(b, 0)],
);
} | rust_cleaned_test_functions.jsonl/81397 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 923
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
57530,
3382,
3024,
368,
341,
286,
1077,
264,
284,
8735,
3945,
486,
1499,
7,
15,
51878,
317,
286,
1077,
293,
284,
8735,
3945,
486,
1499,
7,
16,
51878,
626,
286,
5168,
1779,
5384,
25,
11312,
27,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_write_builder_empty_query() {
let query = Timestamp::Hours(5)
.into_query("marina_3".to_string())
.build();
assert!(query.is_err(), "Query was not empty");
} | rust_cleaned_test_functions.jsonl/40003 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 110
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9165,
28532,
15124,
5738,
368,
341,
286,
1077,
3239,
284,
32758,
486,
23235,
7,
20,
340,
310,
659,
18122,
5738,
445,
5612,
2210,
62,
18,
3263,
983,
3904,
2398,
310,
659,
5834,
1428,
286,
2060,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_mapping_range_edge() {
let mut map = MemoryMap::new();
map.push_range(0x1000.into(), 0x2000.into(), 0.into());
map.push_range(0x3000.into(), 0x4000.into(), 0x2000.into());
let mut void_panic = |x| panic!("Should not have mapped {:?}", x);
let mut void = |_| true;
assert_eq!(
(map.map::<umem, _>(0x3000.into(), 1, Some(&mut void_panic))
.next()
.unwrap()
.0)
.0,
Address::from(0x2000)
);
assert_eq!(
(map.map::<umem, _>(0x3fff.into(), 1, Some(&mut void_panic))
.next()
.unwrap()
.0)
.0,
Address::from(0x2fff)
);
assert_eq!(
map.map::<umem, _>(0x2fff.into(), 1, Some(&mut void)).next(),
None
);
assert_eq!(
map.map::<umem, _>(0x4000.into(), 1, Some(&mut void)).next(),
None
);
} | rust_cleaned_test_functions.jsonl/70008 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 614
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
26930,
9698,
17932,
368,
341,
286,
1077,
5206,
2415,
284,
13850,
2227,
486,
931,
543,
286,
2415,
2552,
9698,
7,
15,
87,
16,
15,
15,
15,
39860,
1507,
220,
15,
87,
17,
15,
15,
15,
39860,
1507,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_command_latches() {
let mut temp_map = HashMap::default();
temp_map.insert(10, 20);
let readonly_cmds = vec![
Command::ScanLock {
ctx: Context::default(),
max_ts: 5,
start_key: None,
limit: 0,
},
Command::ResolveLock {
ctx: Context::default(),
txn_status: temp_map.clone(),
scan_key: None,
key_locks: vec![],
},
Command::MvccByKey {
ctx: Context::default(),
key: Key::from_raw(b"k"),
},
Command::MvccByStartTs {
ctx: Context::default(),
start_ts: 25,
},
];
let write_cmds = vec![
Command::Prewrite {
ctx: Context::default(),
mutations: vec![Mutation::Put((Key::from_raw(b"k"), b"v".to_vec()))],
primary: b"k".to_vec(),
start_ts: 10,
options: Options::default(),
},
Command::AcquirePessimisticLock {
ctx: Context::default(),
keys: vec![(Key::from_raw(b"k"), false)],
primary: b"k".to_vec(),
start_ts: 10,
options: Options::default(),
},
Command::Commit {
ctx: Context::default(),
keys: vec![Key::from_raw(b"k")],
lock_ts: 10,
commit_ts: 20,
},
Command::Cleanup {
ctx: Context::default(),
key: Key::from_raw(b"k"),
start_ts: 10,
current_ts: 20,
},
Command::Rollback {
ctx: Context::default(),
keys: vec![Key::from_raw(b"k")],
start_ts: 10,
},
Command::PessimisticRollback {
ctx: Context::default(),
keys: vec![Key::from_raw(b"k")],
start_ts: 10,
for_update_ts: 20,
},
Command::ResolveLock {
ctx: Context::default(),
txn_status: temp_map.clone(),
scan_key: None,
key_locks: vec![(
Key::from_raw(b"k"),
mvcc::Lock::new(mvcc::LockType::Put, b"k".to_vec(), 10, 20, None, 0, 0, 0),
)],
},
Command::ResolveLockLite {
ctx: Context::default(),
start_ts: 10,
commit_ts: 0,
resolve_keys: vec![Key::from_raw(b"k")],
},
Command::TxnHeartBeat {
ctx: Context::default(),
primary_key: Key::from_raw(b"k"),
start_ts: 10,
advise_ttl: 100,
},
];
let latches = Latches::new(1024);
let write_locks: Vec<Lock> = write_cmds
.into_iter()
.enumerate()
.map(|(id, cmd)| {
let mut lock = gen_command_lock(&latches, &cmd);
assert_eq!(latches.acquire(&mut lock, id as u64), id == 0);
lock
})
.collect();
for (id, cmd) in readonly_cmds.iter().enumerate() {
let mut lock = gen_command_lock(&latches, cmd);
assert!(latches.acquire(&mut lock, id as u64));
}
// acquire/release locks one by one.
let max_id = write_locks.len() as u64 - 1;
for (id, mut lock) in write_locks.into_iter().enumerate() {
let id = id as u64;
if id != 0 {
assert!(latches.acquire(&mut lock, id));
}
let unlocked = latches.release(&lock, id);
if id as u64 == max_id {
assert!(unlocked.is_empty());
} else {
assert_eq!(unlocked, vec![id + 1]);
}
}
} | rust_cleaned_test_functions.jsonl/10637 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2442
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
10811,
907,
9118,
368,
341,
286,
1077,
5206,
2730,
5376,
284,
10528,
486,
2258,
543,
286,
2730,
5376,
7030,
7,
16,
15,
11,
220,
17,
15,
317,
286,
1077,
5762,
89472,
284,
7486,
90515,
310,
7348... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_temporary_error_values() {
assert_eq!(
format!("{}", ErrorCode::T00_INTERNAL_ERROR),
String::from("T00")
);
assert_eq!(
format!("{}", ErrorCode::T01_PEER_UNREACHABLE),
String::from("T01")
);
assert_eq!(format!("{}", ErrorCode::T02_PEER_BUSY), String::from("T02"));
assert_eq!(
format!("{}", ErrorCode::T03_CONNECTOR_BUSY),
String::from("T03")
);
assert_eq!(
format!("{}", ErrorCode::T04_INSUFFICIENT_LIQUIDITY),
String::from("T04")
);
assert_eq!(
format!("{}", ErrorCode::T05_RATE_LIMITED),
String::from("T05")
);
assert_eq!(
format!("{}", ErrorCode::T99_APPLICATION_ERROR),
String::from("T99")
);
} | rust_cleaned_test_functions.jsonl/3929 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 501
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11771,
7592,
4096,
9146,
368,
341,
286,
2060,
10714,
33673,
310,
3561,
79878,
60084,
486,
51,
15,
15,
31752,
5414,
1326,
310,
923,
486,
1499,
445,
51,
15,
15,
1138,
286,
1439,
286,
2060,
10714,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_encrypt_1() {
assert_eq!(encrypt(&b"17535 walk 20 26 1 11".to_vec(), 53836, false),
b"\xFA\xCF\x0B\x05\x78\xFC\x12\x07\x08\xFF\x8A\xB5\xDE\x89\x89\xC4\x73".to_vec());
} | rust_cleaned_test_functions.jsonl/74792 | {
"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,
66593,
62,
16,
368,
341,
286,
2060,
10714,
10297,
32826,
2099,
65,
1,
16,
22,
20,
18,
20,
4227,
220,
17,
15,
220,
17,
21,
220,
16,
220,
16,
16,
3263,
983,
13251,
1507,
220,
20,
18,
23,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_attach_rc() {
let str_pool : Pool<String> = Pool::with_size(1);
{
assert_eq!(1, str_pool.size());
let string: String = str_pool.new_rc().detach();
assert_eq!(0, str_pool.size());
let _rstring: RcRecycled<String> = str_pool.attach_rc(string);
}
assert_eq!(1, str_pool.size());
} | rust_cleaned_test_functions.jsonl/121199 | {
"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,
40719,
30299,
368,
341,
414,
1077,
607,
15709,
549,
22728,
3464,
29,
284,
22728,
486,
4197,
2368,
7,
16,
317,
414,
341,
286,
2060,
10714,
10297,
16,
11,
607,
15709,
2486,
1423,
286,
1077,
914,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_observe_omaha_server_response() {
block_on(async {
let response = json!({"response":{
"server": "prod",
"protocol": "3.0",
"app": [{
"appid": "{00000000-0000-0000-0000-000000000001}",
"status": "ok",
"cohort": "1",
"cohortname": "stable-channel",
"updatecheck": {
"status": "noupdate"
}
}]
}});
let response = serde_json::to_vec(&response).unwrap();
let expected_omaha_response = response::parse_json_response(&response).unwrap();
let http = MockHttpRequest::new(HttpResponse::new(response));
let actual_omaha_response = StateMachineBuilder::new_stub()
.http(http)
.oneshot_check()
.await
.filter_map(|event| {
future::ready(match event {
StateMachineEvent::OmahaServerResponse(response) => Some(response),
_ => None,
})
})
.collect::<Vec<response::Response>>()
.await;
assert_eq!(actual_omaha_response, vec![expected_omaha_response]);
});
} | rust_cleaned_test_functions.jsonl/59680 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 762
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
36322,
13267,
62,
316,
13546,
12015,
9655,
368,
341,
286,
2504,
4470,
18285,
341,
310,
1077,
2033,
284,
2951,
0,
16864,
2322,
12602,
1060,
330,
4030,
788,
330,
19748,
756,
1060,
330,
17014,
788,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_tags_cancellation() {
use std::sync::atomic::{AtomicUsize, Ordering};
allocations::record(|| {
// Large javascript document
let source = (0..500)
.map(|_| "/* hi */ class A { /* ok */ b() {} }\n")
.collect::<String>();
let cancellation_flag = AtomicUsize::new(0);
let language = get_language("javascript");
let tags_config = TagsConfiguration::new(language, JS_TAG_QUERY, "").unwrap();
let mut tag_context = TagsContext::new();
let tags = tag_context
.generate_tags(&tags_config, source.as_bytes(), Some(&cancellation_flag))
.unwrap();
for (i, tag) in tags.0.enumerate() {
if i == 150 {
cancellation_flag.store(1, Ordering::SeqCst);
}
if let Err(e) = tag {
assert_eq!(e, Error::Cancelled);
return;
}
}
panic!("Expected to halt tagging with an error");
});
} | rust_cleaned_test_functions.jsonl/66039 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 493
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16333,
666,
49222,
368,
341,
262,
990,
1460,
486,
12996,
486,
6618,
22964,
65857,
52,
2141,
11,
68621,
2315,
262,
69642,
486,
8548,
79453,
341,
286,
442,
20286,
35710,
2197,
198,
286,
1077,
2530,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_property_sheet_with_text_attribute() {
let sheet = generate_property_sheet(
"foo.css",
"
f1 {
color: red;
&[text='^[A-Z]'] {
color: green;
}
&[text='^[A-Z_]+$'] {
color: blue;
}
}
f2[text='^[A-Z_]+$'] {
color: purple;
}
",
)
.unwrap();
assert_eq!(
*query(&sheet, vec![("f1", None, true, 0)], "abc"),
props(&[("color", string("red"))])
);
assert_eq!(
*query(&sheet, vec![("f1", None, true, 0)], "Abc"),
props(&[("color", string("green"))])
);
assert_eq!(
*query(&sheet, vec![("f1", None, true, 0)], "AB_CD"),
props(&[("color", string("blue"))])
);
assert_eq!(
*query(&sheet, vec![("f2", None, true, 0)], "Abc"),
props(&[])
);
assert_eq!(
*query(&sheet, vec![("f2", None, true, 0)], "ABC"),
props(&[("color", string("purple"))])
);
} | rust_cleaned_test_functions.jsonl/45084 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 780
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
16638,
43112,
6615,
4326,
16791,
368,
341,
286,
1077,
10834,
284,
6923,
16638,
43112,
1006,
310,
330,
7975,
4327,
756,
310,
6228,
394,
282,
16,
341,
1698,
1894,
25,
2518,
401,
1698,
44590,
1318,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_lda_from_memory() {
let bus = Bus::new();
let mut cpu = CPU::new(bus);
cpu.mem_write(0x10, 0x55);
cpu.load(vec![0xa5, 0x10, 0x00]);
cpu.reset();
cpu.program_counter = 0x0600;
cpu.run();
assert_eq!(cpu.register_a, 0x55);
} | rust_cleaned_test_functions.jsonl/56544 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 174
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
50573,
64,
5673,
19195,
368,
341,
286,
1077,
5828,
284,
18598,
486,
931,
543,
286,
1077,
5206,
17319,
284,
13940,
486,
931,
60872,
317,
286,
17319,
41493,
9165,
7,
15,
87,
16,
15,
11,
220,
15,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_nonnull_array_with_offset_is_not_null() {
let a = Int32Array::from(vec![1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1]);
let a = a.slice(8, 4);
let res = is_not_null(a.as_ref()).unwrap();
let expected = BooleanArray::from(vec![true, true, true, true]);
assert_eq!(expected, res);
assert_eq!(&None, res.data_ref().null_bitmap());
} | rust_cleaned_test_functions.jsonl/45025 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 201
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21637,
2921,
3858,
6615,
6917,
6892,
7913,
15162,
368,
341,
286,
1077,
264,
284,
1333,
18,
17,
1857,
486,
1499,
25592,
20703,
16,
11,
220,
17,
11,
220,
18,
11,
220,
19,
11,
220,
20,
11,
220,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_problem_info_aggregator() {
use diesel::connection::SimpleConnection;
fn setup_contests() -> PgConnection {
let conn = utils::initialize_and_connect_to_test_sql();
conn.batch_execute(
r#"
INSERT INTO contests (id, start_epoch_second, duration_second, title, rate_change) VALUES
('contest1', 1, 0, '', ''), ('contest2', 1, 0, '', '');
"#,
)
.unwrap();
conn
}
let ignored_submission = vec![Submission {
id: 0,
problem_id: "problem1".to_owned(),
contest_id: "contest1".to_owned(),
epoch_second: 0,
length: 1,
execution_time: Some(1),
result: "AC".to_owned(),
..Default::default()
}];
let submissions1 = vec![Submission {
id: 1,
problem_id: "problem1".to_owned(),
contest_id: "contest1".to_owned(),
epoch_second: 10,
length: 20,
execution_time: Some(10),
result: "AC".to_owned(),
..Default::default()
}];
let submissions2 = vec![Submission {
id: 2,
problem_id: "problem1".to_owned(),
contest_id: "contest2".to_owned(),
epoch_second: 10,
length: 10,
execution_time: Some(10),
result: "AC".to_owned(),
..Default::default()
}];
{
let conn = setup_contests();
insert_submissions(&conn, &ignored_submission);
conn.update_submissions_of_problems().unwrap();
let first = get_first(&conn);
assert_eq!(first.len(), 0);
insert_submissions(&conn, &submissions1);
conn.update_submissions_of_problems().unwrap();
let first = get_first(&conn);
assert_eq!(first.len(), 1);
assert_eq!(first[0].0, submissions1[0].contest_id);
assert_eq!(first[0].1, submissions1[0].problem_id);
assert_eq!(first[0].2, submissions1[0].id);
insert_submissions(&conn, &submissions2);
conn.update_submissions_of_problems().unwrap();
let first = get_first(&conn);
assert_eq!(first.len(), 1);
assert_eq!(first[0].0, submissions1[0].contest_id);
assert_eq!(first[0].1, submissions1[0].problem_id);
assert_eq!(first[0].2, submissions1[0].id);
}
{
let conn = setup_contests();
insert_submissions(&conn, &submissions2);
conn.update_submissions_of_problems().unwrap();
let first = get_first(&conn);
assert_eq!(first.len(), 1);
assert_eq!(first[0].0, submissions2[0].contest_id);
assert_eq!(first[0].1, submissions2[0].problem_id);
assert_eq!(first[0].2, submissions2[0].id);
insert_submissions(&conn, &submissions1);
conn.update_submissions_of_problems().unwrap();
let first = get_first(&conn);
assert_eq!(first.len(), 1);
assert_eq!(first[0].0, submissions1[0].contest_id);
assert_eq!(first[0].1, submissions1[0].problem_id);
assert_eq!(first[0].2, submissions1[0].id);
}
{
let conn = setup_contests();
insert_submissions(&conn, &submissions1);
conn.update_submissions_of_problems().unwrap();
let shortest = get_shortest(&conn);
assert_eq!(shortest.len(), 1);
assert_eq!(shortest[0].0, submissions1[0].contest_id);
assert_eq!(shortest[0].1, submissions1[0].problem_id);
assert_eq!(shortest[0].2, submissions1[0].id);
insert_submissions(&conn, &submissions2);
conn.update_submissions_of_problems().unwrap();
let shortest = get_shortest(&conn);
assert_eq!(shortest.len(), 1);
assert_eq!(shortest[0].0, submissions2[0].contest_id);
assert_eq!(shortest[0].1, submissions2[0].problem_id);
assert_eq!(shortest[0].2, submissions2[0].id);
}
{
let conn = setup_contests();
insert_submissions(&conn, &submissions2);
conn.update_submissions_of_problems().unwrap();
let fastest = get_fastest(&conn);
assert_eq!(fastest.len(), 1);
assert_eq!(fastest[0].0, submissions2[0].contest_id);
assert_eq!(fastest[0].1, submissions2[0].problem_id);
assert_eq!(fastest[0].2, submissions2[0].id);
insert_submissions(&conn, &submissions1);
conn.update_submissions_of_problems().unwrap();
let fastest = get_fastest(&conn);
assert_eq!(fastest.len(), 1);
assert_eq!(fastest[0].0, submissions1[0].contest_id);
assert_eq!(fastest[0].1, submissions1[0].problem_id);
assert_eq!(fastest[0].2, submissions1[0].id);
}
} | rust_cleaned_test_functions.jsonl/76694 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 2179
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
60139,
3109,
20587,
58131,
368,
341,
262,
990,
32780,
486,
7742,
486,
16374,
4526,
401,
262,
5168,
6505,
10260,
17966,
368,
1464,
97265,
4526,
341,
286,
1077,
4534,
284,
12439,
486,
21641,
8378,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_args_lr() {
let mut args = Args::new();
assert_eq!(0.05, args.lr());
args.set_lr(0.1);
assert_eq!(0.1, args.lr());
} | rust_cleaned_test_functions.jsonl/118611 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 101
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8384,
46086,
368,
341,
286,
1077,
5206,
2827,
284,
17693,
486,
931,
543,
286,
2060,
10714,
10297,
15,
13,
15,
20,
11,
2827,
63349,
5231,
286,
2827,
980,
46086,
7,
15,
13,
16,
317,
286,
2060,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_iterator_peekable_remember_peek_none_3() {
let data = [0];
let mut iter = cycle(&data).peekable();
iter.peek();
assert_eq!(iter.nth(0), Some(&0));
let mut iter = cycle(&data).peekable();
iter.next();
assert_eq!(iter.peek(), None);
assert_eq!(iter.nth(0), None);
} | rust_cleaned_test_functions.jsonl/25904 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 145
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13491,
62,
29107,
480,
1288,
9597,
62,
29107,
31488,
62,
18,
368,
341,
262,
1077,
821,
284,
508,
15,
935,
262,
1077,
5206,
5367,
284,
10775,
2099,
691,
568,
29107,
480,
543,
262,
5367,
41249,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_unmodified_blob_into_modified_blob() -> BitResult<()> {
BitRepo::with_minimal_repo(|repo| {
let ours = commit! {
foo < "modified foo contents"
};
let theirs = commit! {
foo < "default foo contents"
};
repo.three_way_merge(ours, theirs)?;
assert_eq!(cat!(repo: "foo"), "modified foo contents");
Ok(())
})
} | rust_cleaned_test_functions.jsonl/94163 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 209
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
20888,
4907,
27162,
45908,
45514,
37749,
45908,
368,
1464,
6495,
2077,
71698,
341,
262,
6495,
25243,
486,
4197,
7260,
2861,
37784,
22428,
23476,
91,
341,
286,
1077,
11350,
284,
5266,
0,
341,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 2 |
#[test]
fn test_one_incomplete_boundary() {
let _ = ::env_logger::try_init();
let finder = BoundaryFinder::new(mock_stream(&[b"--bound"]), BOUNDARY);
pin_mut!(finder);
ready_assert_eq!(
|cx| finder.as_mut().consume_boundary(cx),
Err(Error::Parsing(
"unable to verify multipart boundary; expected: \"--boundary\" found: \"--bound\""
.into()
))
);
} | rust_cleaned_test_functions.jsonl/25793 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 250
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
11667,
1243,
14737,
54004,
368,
341,
286,
1077,
716,
284,
3504,
3160,
27413,
486,
1539,
6137,
543,
286,
1077,
43730,
284,
76416,
42300,
486,
931,
30389,
12673,
2099,
58,
65,
74757,
10891,
63624,
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_compaction() {
let l = default_logger();
let tests = vec![
// out of upper bound
(1000, vec![1001u64], vec![0usize], true),
(
1000,
vec![300, 500, 800, 900],
vec![700, 500, 200, 100],
false,
),
// out of lower bound
(1000, vec![300, 299], vec![700, 700], false),
];
for (i, &(index, ref compact, ref wleft, should_panic)) in tests.iter().enumerate() {
let store = MemStorage::new();
for i in 1u64..index {
store.wl().append(&[new_entry(i, 0)]).expect("");
}
let mut raft_log = RaftLog::new(store, l.clone());
raft_log.maybe_commit(index - 1, 0);
let committed = raft_log.committed;
#[allow(deprecated)]
raft_log.applied_to(committed);
for (j, idx) in compact.iter().enumerate() {
let res =
panic::catch_unwind(AssertUnwindSafe(|| raft_log.store.wl().compact(*idx)));
if !(should_panic ^ res.is_ok()) {
panic!("#{}: should_panic: {}, but got: {:?}", i, should_panic, res);
}
if !should_panic {
let l = raft_log.all_entries().len();
if l != wleft[j] {
panic!("#{}.{} len = {}, want {}", i, j, l, wleft[j]);
}
}
}
}
} | rust_cleaned_test_functions.jsonl/48420 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 908
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18177,
1311,
368,
341,
286,
1077,
326,
284,
1638,
27413,
543,
286,
1077,
7032,
284,
7486,
90515,
310,
442,
700,
315,
8416,
6822,
198,
310,
320,
16,
15,
15,
15,
11,
7486,
20703,
16,
15,
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... | 8 |
#[test]
fn test_create_credential_def_fails_when_already_created() {
let wallet_name = "a_test_wallet";
::utils::devsetup::tests::setup_ledger_env(wallet_name);
let wallet_handle = get_wallet_handle();
let (schema_id, _) = ::utils::libindy::anoncreds::tests::create_and_write_test_schema();
let my_did = settings::get_config_value(settings::CONFIG_INSTITUTION_DID).unwrap();
let handle = create_new_credentialdef("1".to_string(),
"name".to_string(),
my_did.clone(),
schema_id.clone(),
"tag_1".to_string(),
r#"{"support_revocation":false}"#.to_string()).unwrap();
let rc = create_new_credentialdef("1".to_string(),
"name".to_string(),
my_did,
schema_id,
"tag_1".to_string(),
r#"{"support_revocation":false}"#.to_string());
::utils::devsetup::tests::cleanup_dev_env(wallet_name);
assert_eq!(rc.err(), Some(CredDefError::CredDefAlreadyCreatedError()));
} | rust_cleaned_test_functions.jsonl/67966 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 824
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
8657,
666,
30320,
7844,
761,
6209,
47636,
80772,
27288,
368,
341,
286,
1077,
15085,
1269,
284,
330,
64,
4452,
62308,
876,
286,
3504,
6031,
486,
3583,
15188,
486,
23841,
486,
15188,
38367,
1389,
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_has_no_ident_token() {
let input = "{ field: u8 }";
assert!(!has_no_ident_token(input));
let input = "(u8, String);";
assert!(!has_no_ident_token(input));
let input = " {
// test = 5
}
";
assert!(has_no_ident_token(input));
let input = " ();";
assert!(has_no_ident_token(input));
} | rust_cleaned_test_functions.jsonl/29327 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 216
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21778,
6536,
38399,
6458,
368,
341,
286,
1077,
1946,
284,
13868,
2070,
25,
575,
23,
335,
876,
286,
2060,
0,
3471,
4648,
6536,
38399,
6458,
5384,
3237,
286,
1077,
1946,
284,
11993,
84,
23,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_sort() {
let mut arena = Arena::<usize, &str, small_unsigned!(CAPACITY), CAPACITY>::new();
// Simple 3-node tree:
arena.add(3, "n/a");
let n_2_idx = arena.add(2, "n/a");
arena.add(1, "n/a");
let n_2 = &mut arena[n_2_idx];
n_2.set_left_idx(Some(2));
n_2.set_right_idx(Some(0));
assert_eq!(arena.vec[0].as_ref().unwrap().key(), &3);
assert_eq!(arena.vec[1].as_ref().unwrap().key(), &2);
assert_eq!(arena.vec[2].as_ref().unwrap().key(), &1);
// Would be supplied for the above tree
let sort_metadata = array_vec! { [NodeGetHelper<usize>; CAPACITY] =>
NodeGetHelper::new(Some(2), Some(1), false),
NodeGetHelper::new(Some(1), None, false),
NodeGetHelper::new(Some(0), Some(1), false),
};
arena.sort(1, sort_metadata);
assert_eq!(arena.vec[0].as_ref().unwrap().key(), &1);
assert_eq!(arena.vec[1].as_ref().unwrap().key(), &2);
assert_eq!(arena.vec[2].as_ref().unwrap().key(), &3);
} | rust_cleaned_test_functions.jsonl/120524 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 639
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
18435,
368,
341,
286,
1077,
5206,
24902,
284,
27047,
27638,
51878,
11,
609,
495,
11,
2613,
67830,
10297,
31400,
62985,
701,
26101,
62985,
6831,
931,
1428,
286,
442,
8993,
220,
18,
39054,
4916,
510... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_accounts_locks_with_results() {
let keypair0 = Keypair::new();
let keypair1 = Keypair::new();
let keypair2 = Keypair::new();
let keypair3 = Keypair::new();
let account0 = AccountSharedData::new(1, 0, &Pubkey::default());
let account1 = AccountSharedData::new(2, 0, &Pubkey::default());
let account2 = AccountSharedData::new(3, 0, &Pubkey::default());
let account3 = AccountSharedData::new(4, 0, &Pubkey::default());
let accounts = Accounts::new_with_config_for_tests(
Vec::new(),
&ClusterType::Development,
AccountSecondaryIndexes::default(),
false,
AccountShrinkThreshold::default(),
);
accounts.store_slow_uncached(0, &keypair0.pubkey(), &account0);
accounts.store_slow_uncached(0, &keypair1.pubkey(), &account1);
accounts.store_slow_uncached(0, &keypair2.pubkey(), &account2);
accounts.store_slow_uncached(0, &keypair3.pubkey(), &account3);
let instructions = vec![CompiledInstruction::new(2, &(), vec![0, 1])];
let message = Message::new_with_compiled_instructions(
1,
0,
2,
vec![keypair1.pubkey(), keypair0.pubkey(), native_loader::id()],
Hash::default(),
instructions,
);
let tx0 = new_sanitized_tx(&[&keypair1], message, Hash::default());
let instructions = vec![CompiledInstruction::new(2, &(), vec![0, 1])];
let message = Message::new_with_compiled_instructions(
1,
0,
2,
vec![keypair2.pubkey(), keypair0.pubkey(), native_loader::id()],
Hash::default(),
instructions,
);
let tx1 = new_sanitized_tx(&[&keypair2], message, Hash::default());
let instructions = vec![CompiledInstruction::new(2, &(), vec![0, 1])];
let message = Message::new_with_compiled_instructions(
1,
0,
2,
vec![keypair3.pubkey(), keypair0.pubkey(), native_loader::id()],
Hash::default(),
instructions,
);
let tx2 = new_sanitized_tx(&[&keypair3], message, Hash::default());
let txs = vec![tx0, tx1, tx2];
let qos_results = vec![
Ok(()),
Err(TransactionError::WouldExceedMaxBlockCostLimit),
Ok(()),
];
let results = accounts.lock_accounts_with_results(
txs.iter(),
qos_results.into_iter(),
&FeatureSet::all_enabled(),
);
assert!(results[0].is_ok());
assert!(results[1].is_err());
assert!(results[2].is_ok());
assert_eq!(
*accounts
.account_locks
.lock()
.unwrap()
.readonly_locks
.get(&keypair0.pubkey())
.unwrap(),
2
);
assert!(accounts
.account_locks
.lock()
.unwrap()
.write_locks
.get(&keypair2.pubkey())
.is_none());
accounts.unlock_accounts(txs.iter(), &results);
// check all locks to be removed
assert!(accounts
.account_locks
.lock()
.unwrap()
.readonly_locks
.is_empty());
assert!(accounts
.account_locks
.lock()
.unwrap()
.write_locks
.is_empty());
} | rust_cleaned_test_functions.jsonl/13222 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1869
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
55665,
9818,
82,
6615,
13576,
368,
341,
286,
1077,
1376,
12670,
15,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
1376,
12670,
16,
284,
6569,
1082,
1310,
486,
931,
543,
286,
1077,
1376,
12670... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_matrix_inverse_inverse_equals_matrix() {
let matrix: Matrix2x2<f64> = Matrix2x2::new(
80.0, 426.1,
23.43, 23.5724
);
let result = matrix.inverse().unwrap().inverse().unwrap();
let expected = matrix;
let epsilon = 1e-7;
assert!(relative_eq!(result, expected, epsilon = epsilon));
} | rust_cleaned_test_functions.jsonl/128982 | {
"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,
10193,
63333,
63333,
61664,
10193,
368,
341,
286,
1077,
6172,
25,
11631,
17,
87,
17,
63895,
21,
19,
29,
284,
11631,
17,
87,
17,
486,
931,
1006,
310,
220,
23,
15,
13,
15,
11,
256,
220,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_json_length() {
let mut test_cases = vec![
("null", None, Some(1)),
("false", None, Some(1)),
("true", None, Some(1)),
("1", None, Some(1)),
("-1", None, Some(1)),
("1.1", None, Some(1)),
// Tests with path expression
(r#"[1,2,[1,[5,[3]]]]"#, Some("$[2]"), Some(2)),
(r#"[{"a":1}]"#, Some("$"), Some(1)),
(r#"[{"a":1,"b":2}]"#, Some("$[0].a"), Some(1)),
(r#"{"a":{"a":1},"b":2}"#, Some("$"), Some(2)),
(r#"{"a":{"a":1},"b":2}"#, Some("$.a"), Some(1)),
(r#"{"a":{"a":1},"b":2}"#, Some("$.a.a"), Some(1)),
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$.a[2].aa"), Some(1)),
// Tests without path expression
(r#"{}"#, None, Some(0)),
(r#"{"a":1}"#, None, Some(1)),
(r#"{"a":[1]}"#, None, Some(1)),
(r#"{"b":2, "c":3}"#, None, Some(2)),
(r#"[1]"#, None, Some(1)),
(r#"[1,2]"#, None, Some(2)),
(r#"[1,2,[1,3]]"#, None, Some(3)),
(r#"[1,2,[1,[5,[3]]]]"#, None, Some(3)),
(r#"[1,2,[1,[5,{"a":[2,3]}]]]"#, None, Some(3)),
(r#"[{"a":1}]"#, None, Some(1)),
(r#"[{"a":1,"b":2}]"#, None, Some(1)),
(r#"[{"a":{"a":1},"b":2}]"#, None, Some(1)),
// Tests path expression contains any asterisk
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$.*"), None),
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$[*]"), None),
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$**.a"), None),
// Tests path expression does not identify a section of the target document
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$.c"), None),
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$.a[3]"), None),
(r#"{"a": [1, 2, {"aa": "xx"}]}"#, Some("$.a[2].b"), None),
];
for (i, (js, param, expected)) in test_cases.drain(..).enumerate() {
let j = js.parse();
assert!(j.is_ok(), "#{} expect parse ok but got {:?}", i, j);
let j: Json = j.unwrap();
let exprs = match param {
Some(p) => vec![parse_json_path_expr(p).unwrap()],
None => vec![],
};
let got = j.as_ref().json_length(&exprs[..]).unwrap();
assert_eq!(
got, expected,
"#{} expect {:?}, but got {:?}",
i, expected, got
);
}
} | rust_cleaned_test_functions.jsonl/16243 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1520
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
9455,
5118,
368,
341,
286,
1077,
5206,
1273,
41427,
284,
7486,
90515,
310,
3489,
2921,
497,
2240,
11,
4329,
7,
16,
6965,
310,
3489,
3849,
497,
2240,
11,
4329,
7,
16,
6965,
310,
3489,
1866,
497... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 3 |
#[test]
fn test_non_blank_overrides_number() {
for same_param in vec!["-b", "--number-nonblank"] {
new_ucmd!()
.args(&[same_param, "-"])
.pipe_in("\na\nb\n\n\nc")
.succeeds()
.stdout_only("\n 1\ta\n 2\tb\n\n\n 3\tc");
}
} | rust_cleaned_test_functions.jsonl/90940 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 189
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
21637,
56103,
15431,
18245,
5500,
368,
341,
262,
369,
1852,
4090,
304,
7486,
0,
1183,
12,
65,
497,
14482,
4082,
98700,
10189,
1341,
341,
286,
501,
68887,
2277,
0,
741,
310,
659,
2116,
2099,
58,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_request() {
let mut perms: Permissions = Default::default();
#[rustfmt::skip]
{
let _guard = PERMISSION_PROMPT_GUARD.lock();
set_prompt_result(true);
assert_eq!(perms.read.request(Some(Path::new("/foo"))), PermissionState::Granted);
assert_eq!(perms.read.query(None), PermissionState::Prompt);
set_prompt_result(false);
assert_eq!(perms.read.request(Some(Path::new("/foo/bar"))), PermissionState::Granted);
set_prompt_result(false);
assert_eq!(perms.write.request(Some(Path::new("/foo"))), PermissionState::Denied);
assert_eq!(perms.write.query(Some(Path::new("/foo/bar"))), PermissionState::Prompt);
set_prompt_result(true);
assert_eq!(perms.write.request(None), PermissionState::Denied);
set_prompt_result(true);
assert_eq!(perms.net.request(Some(&("127.0.0.1", None))), PermissionState::Granted);
set_prompt_result(false);
assert_eq!(perms.net.request(Some(&("127.0.0.1", Some(8000)))), PermissionState::Granted);
set_prompt_result(true);
assert_eq!(perms.env.request(Some(&"HOME".to_string())), PermissionState::Granted);
assert_eq!(perms.env.query(None), PermissionState::Prompt);
set_prompt_result(false);
assert_eq!(perms.env.request(Some(&"HOME".to_string())), PermissionState::Granted);
set_prompt_result(true);
assert_eq!(perms.run.request(Some(&"deno".to_string())), PermissionState::Granted);
assert_eq!(perms.run.query(None), PermissionState::Prompt);
set_prompt_result(false);
assert_eq!(perms.run.request(Some(&"deno".to_string())), PermissionState::Granted);
set_prompt_result(true);
assert_eq!(perms.ffi.request(Some(&"deno".to_string())), PermissionState::Granted);
assert_eq!(perms.ffi.query(None), PermissionState::Prompt);
set_prompt_result(false);
assert_eq!(perms.ffi.request(Some(&"deno".to_string())), PermissionState::Granted);
set_prompt_result(false);
assert_eq!(perms.hrtime.request(), PermissionState::Denied);
set_prompt_result(true);
assert_eq!(perms.hrtime.request(), PermissionState::Denied);
};
} | rust_cleaned_test_functions.jsonl/24815 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 919
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
7893,
368,
341,
262,
1077,
5206,
82282,
25,
53357,
284,
7899,
486,
2258,
543,
262,
11506,
35788,
12501,
486,
20599,
921,
262,
341,
414,
1077,
716,
26098,
284,
96540,
71346,
2828,
84513,
7376,
2100... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_bsearch_elem() {
assert_eq!([1,2,3,4,5].bsearch_elem(&5), Some(4));
assert_eq!([1,2,3,4,5].bsearch_elem(&4), Some(3));
assert_eq!([1,2,3,4,5].bsearch_elem(&3), Some(2));
assert_eq!([1,2,3,4,5].bsearch_elem(&2), Some(1));
assert_eq!([1,2,3,4,5].bsearch_elem(&1), Some(0));
assert_eq!([2,4,6,8,10].bsearch_elem(&1), None);
assert_eq!([2,4,6,8,10].bsearch_elem(&5), None);
assert_eq!([2,4,6,8,10].bsearch_elem(&4), Some(1));
assert_eq!([2,4,6,8,10].bsearch_elem(&10), Some(4));
assert_eq!([2,4,6,8].bsearch_elem(&1), None);
assert_eq!([2,4,6,8].bsearch_elem(&5), None);
assert_eq!([2,4,6,8].bsearch_elem(&4), Some(1));
assert_eq!([2,4,6,8].bsearch_elem(&8), Some(3));
assert_eq!([2,4,6].bsearch_elem(&1), None);
assert_eq!([2,4,6].bsearch_elem(&5), None);
assert_eq!([2,4,6].bsearch_elem(&4), Some(1));
assert_eq!([2,4,6].bsearch_elem(&6), Some(2));
assert_eq!([2,4].bsearch_elem(&1), None);
assert_eq!([2,4].bsearch_elem(&5), None);
assert_eq!([2,4].bsearch_elem(&2), Some(0));
assert_eq!([2,4].bsearch_elem(&4), Some(1));
assert_eq!([2].bsearch_elem(&1), None);
assert_eq!([2].bsearch_elem(&5), None);
assert_eq!([2].bsearch_elem(&2), Some(0));
assert_eq!([].bsearch_elem(&1), None);
assert_eq!([].bsearch_elem(&5), None);
assert!([1,1,1,1,1].bsearch_elem(&1) != None);
assert!([1,1,1,1,2].bsearch_elem(&1) != None);
assert!([1,1,1,2,2].bsearch_elem(&1) != None);
assert!([1,1,2,2,2].bsearch_elem(&1) != None);
assert_eq!([1,2,2,2,2].bsearch_elem(&1), Some(0));
assert_eq!([1,2,3,4,5].bsearch_elem(&6), None);
assert_eq!([1,2,3,4,5].bsearch_elem(&0), None);
} | rust_cleaned_test_functions.jsonl/75610 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 1051
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
880,
1836,
28179,
368,
341,
286,
2060,
10714,
0,
2561,
16,
11,
17,
11,
18,
11,
19,
11,
20,
936,
65,
1836,
28179,
2099,
20,
701,
4329,
7,
19,
1106,
286,
2060,
10714,
0,
2561,
16,
11,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_FX18() {
// 0xEXA1 - Set the sound timer to the value of register VX
let opcode = 0xF018;
let mut vm = get_vm();
vm.sound_timer = 0x22;
vm.v[0x0] = 0x33;
vm.execute_instruction(decode_opcode(opcode), opcode);
assert_eq!(vm.sound_timer, vm.v[0x0]);
assert_eq!(vm.sound_timer, 0x33);
} | rust_cleaned_test_functions.jsonl/267 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 163
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1400,
55,
16,
23,
368,
341,
262,
442,
220,
15,
87,
3257,
32,
16,
481,
2573,
279,
5112,
9021,
311,
279,
897,
315,
4161,
78177,
271,
262,
1077,
30028,
284,
220,
15,
9770,
15,
16,
23,
280,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_utf_16le_decode_bom_prefixed_split_byte_pair() {
let mut output = [0u16; 20];
let mut decoder = UTF_16LE.new_decoder();
{
let needed = decoder.max_utf16_buffer_length(1).unwrap();
let (result, read, written, had_errors) =
decoder.decode_to_utf16(b"\xFF", &mut output[..needed], false);
assert_eq!(result, CoderResult::InputEmpty);
assert_eq!(read, 1);
assert_eq!(written, 0);
assert!(!had_errors);
}
{
let needed = decoder.max_utf16_buffer_length(1).unwrap();
let (result, read, written, had_errors) =
decoder.decode_to_utf16(b"\xFD", &mut output[..needed], true);
assert_eq!(result, CoderResult::InputEmpty);
assert_eq!(read, 1);
assert_eq!(written, 1);
assert!(!had_errors);
assert_eq!(output[0], 0xFDFF);
}
} | rust_cleaned_test_functions.jsonl/86898 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 518
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
39453,
62,
16,
21,
273,
15227,
880,
316,
43331,
3286,
17052,
19737,
14445,
368,
341,
286,
1077,
5206,
2550,
284,
508,
15,
84,
16,
21,
26,
220,
17,
15,
935,
286,
1077,
5206,
24551,
284,
20076,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_pipeline_with_minmax() {
let mut pipe = Pipeline::new(vec![Box::new(MinMaxScaler::new())]);
// Fit to some data
let x = vec![1, 2, 3, 4];
pipe.fit(x);
let x = vec![0, 1, 5];
let out = pipe.transform(x);
assert_eq!(out[0], 1);
assert_eq!(out[1], 1);
assert_eq!(out[2], 4);
} | rust_cleaned_test_functions.jsonl/106987 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 170
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
45187,
6615,
7260,
2810,
368,
341,
262,
1077,
5206,
13647,
284,
40907,
486,
931,
25592,
20703,
1611,
486,
931,
3189,
258,
5974,
59553,
486,
931,
2140,
10149,
262,
442,
29890,
311,
1045,
821,
198,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_text_raw_latex() {
let source = "#-\\TeX and \\LaTeX-##-foo 3.14-#";
let expected_toktype = vec![TokenType::RawLatex, TokenType::RawLatex];
let expected_literal = "\\TeX and \\LaTeXfoo 3.14";
let lex = Lexer::new(source);
let lexed_token = lex
.clone()
.map(|lextok| lextok.token.toktype)
.collect::<Vec<TokenType>>();
let lexed_literal = lex
.map(|lextok| lextok.token.literal)
.collect::<Vec<String>>()
.concat();
assert_eq!(lexed_token, expected_toktype);
assert_eq!(lexed_literal, expected_literal);
} | rust_cleaned_test_functions.jsonl/108896 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 287
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4326,
16067,
26174,
327,
368,
341,
262,
1077,
2530,
284,
5869,
12,
3422,
54963,
323,
24984,
8747,
54963,
12,
565,
12,
7975,
220,
18,
13,
16,
19,
12,
2,
876,
262,
1077,
3601,
76162,
1313,
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_read_unencrypted_keystore() {
let keystore_location = PathBuf::from("/tmp/forest-db");
let ks = KeyStore::new(KeyStoreConfig::Persistent(keystore_location)).unwrap();
ks.flush().unwrap();
assert!(true);
} | rust_cleaned_test_functions.jsonl/37722 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 116
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
6443,
4907,
36444,
45476,
63373,
368,
341,
286,
1077,
1962,
63373,
13126,
284,
7933,
15064,
486,
1499,
4283,
5173,
14,
50655,
60399,
797,
286,
1077,
41282,
284,
5309,
6093,
486,
931,
21358,
6093,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_kafka_default_success() {
let kafka: Kafka = Kafka::default();
if let Ok(configurations) = kafka.configuration {
assert_eq!(configurations.topic, "logs");
}
} | rust_cleaned_test_functions.jsonl/81758 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 105
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
4698,
21883,
9993,
18632,
368,
341,
286,
1077,
67852,
25,
57025,
284,
57025,
486,
2258,
543,
286,
421,
1077,
7622,
8754,
21449,
8,
284,
67852,
31453,
341,
310,
2060,
10714,
10297,
1676,
21449,
469... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 2 |
#[test]
fn test_extend_from_slice() {
let mut vec: ArrayVec<[usize; 10]> = ArrayVec::new();
vec.try_extend_from_slice(&[1, 2, 3]).unwrap();
assert_eq!(vec.len(), 3);
assert_eq!(&vec[..], &[1, 2, 3]);
assert_eq!(vec.pop(), Some(3));
assert_eq!(&vec[..], &[1, 2]);
} | rust_cleaned_test_functions.jsonl/36760 | {
"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,
70265,
5673,
26488,
368,
341,
262,
1077,
5206,
7486,
25,
2910,
10050,
66746,
51878,
26,
220,
16,
15,
25669,
284,
2910,
10050,
486,
931,
1428,
262,
7486,
48779,
70265,
5673,
26488,
2099,
58,
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_std_resync_find() {
use prelude::*;
::init().unwrap();
let bin = ::Bin::new(None);
let id1 = ::ElementFactory::make("identity", None).unwrap();
let id2 = ::ElementFactory::make("identity", None).unwrap();
bin.add(&id1).unwrap();
let mut it = bin.iterate_elements().into_iter();
assert_eq!(it.next().unwrap().unwrap(), id1);
bin.add(&id2).unwrap();
let res = it.find(|x| x.as_ref() == Ok(&id1));
assert_eq!(res.unwrap().unwrap(), id1);
} | rust_cleaned_test_functions.jsonl/50301 | {
"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,
15656,
4918,
1721,
21814,
368,
341,
286,
990,
855,
52538,
79304,
286,
3504,
2327,
1005,
15454,
1428,
286,
1077,
9544,
284,
3504,
28794,
486,
931,
26717,
317,
286,
1077,
877,
16,
284,
3504,
1691,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_subtraction_point_vector() {
let p = Point1::new(-23.43);
let v = Vector1::new(426.1);
let expected = Point1::new(p.x - v.x);
let result = p - v;
assert_eq!(result, expected);
} | rust_cleaned_test_functions.jsonl/4522 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 124
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
5228,
26425,
6085,
12247,
368,
341,
286,
1077,
281,
284,
5126,
16,
486,
931,
4080,
17,
18,
13,
19,
18,
317,
286,
1077,
348,
284,
4196,
16,
486,
931,
7,
19,
17,
21,
13,
16,
317,
286,
1077,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_writable_struct_pointer() {
use test_capnp::test_big_struct;
let mut message = message::Builder::new_default();
let mut big_struct = message.init_root::<test_big_struct::Builder>();
let neg_seven : u64 = (-7i64) as u64;
{
let mut struct_field = big_struct.reborrow().init_struct_field();
assert_eq!(struct_field.reborrow().get_uint64_field(), 0);
struct_field.set_uint64_field(neg_seven);
assert_eq!(struct_field.get_uint64_field(), neg_seven);
}
assert_eq!(big_struct.reborrow().get_struct_field().unwrap().get_uint64_field(), neg_seven);
{
let mut struct_field = big_struct.reborrow().init_struct_field();
assert_eq!(struct_field.reborrow().get_uint64_field(), 0);
assert_eq!(struct_field.get_uint32_field(), 0);
}
{
// getting before init is the same as init
assert_eq!(big_struct.reborrow().get_another_struct_field().unwrap().get_uint64_field(), 0);
big_struct.reborrow().get_another_struct_field().unwrap().set_uint32_field(4294967265);
let mut other_message = message::Builder::new_default();
other_message.set_root(big_struct.reborrow().get_another_struct_field().unwrap().into_reader()).unwrap();
big_struct.set_struct_field(
other_message.get_root::<test_big_struct::inner::Builder>().unwrap().into_reader()).unwrap();
}
assert_eq!(big_struct.reborrow().get_struct_field().unwrap().get_uint32_field(), 4294967265);
{
let mut other_struct_field = big_struct.reborrow().get_another_struct_field().unwrap();
assert_eq!(other_struct_field.reborrow().get_uint32_field(), 4294967265);
other_struct_field.set_uint32_field(42);
assert_eq!(other_struct_field.get_uint32_field(), 42);
}
assert_eq!(big_struct.reborrow().get_struct_field().unwrap().get_uint32_field(), 4294967265);
assert_eq!(big_struct.get_another_struct_field().unwrap().get_uint32_field(), 42);
} | rust_cleaned_test_functions.jsonl/55852 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 979
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
1670,
22533,
15126,
21425,
368,
341,
286,
990,
1273,
16388,
6199,
486,
1944,
36386,
15126,
401,
286,
1077,
5206,
1943,
284,
1943,
486,
3297,
486,
931,
9993,
543,
286,
1077,
5206,
2409,
15126,
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_decrypt() {
let expected_tx = consensus::deserialize(&Vec::from_hex(HEX_TX).unwrap()).unwrap();
let encrypted_blob = Vec::from_hex(ENC_BLOB).unwrap();
let txid = Txid::from_hex(HEX_TXID).unwrap();
assert_eq!(decrypt(&encrypted_blob, &txid).unwrap(), expected_tx);
} | rust_cleaned_test_functions.jsonl/61599 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 150
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
80764,
368,
341,
286,
1077,
3601,
17805,
284,
23869,
486,
66777,
2099,
10050,
486,
1499,
32655,
7,
1799,
55,
18819,
568,
15454,
6011,
15454,
1428,
286,
1077,
24455,
45908,
284,
11312,
486,
1499,
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_word() {
assert_eq!(
apply(
r#"
a_b$1B
"#
.trim()
),
Ok(vec![Token::Identifier(span(1, 1, "a_b$1B"))])
)
} | rust_cleaned_test_functions.jsonl/27575 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 161
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
13533,
368,
341,
286,
2060,
10714,
33673,
310,
3796,
1006,
394,
435,
2,
698,
64,
880,
3,
16,
33,
198,
1,
4956,
503,
659,
10666,
741,
310,
2837,
310,
7622,
25592,
20703,
3323,
486,
8714,
66092,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] | 1 |
#[test]
fn test_optimization_trim_repeated_tail_values() {
// See https://github.com/influxdata/influxdb-pb-data-protocol#optimization-2-trim-repeated-tail-values
let table_batch = TableBatch {
table_name: "table".to_string(),
columns: vec![
with_strings(
column("f_s", SemanticType::Field),
vec!["s1", "s2", "s3"],
vec![0b11000001],
),
with_interned_strings(
column("f_i", SemanticType::Field),
InternedStrings {
dictionary: Some(PackedStrings {
values: "s1s2".to_string(),
offsets: vec![0, 2, 4],
}),
values: vec![0, 1, 0],
},
vec![0b11000001],
),
with_packed_strings(
column("f_p", SemanticType::Field),
PackedStrings {
values: "s1s2s3".to_string(),
offsets: vec![0, 2, 4, 6],
},
vec![0b11000001],
),
with_strings(
column("t_s", SemanticType::Tag),
vec!["s1", "s2", "s3"],
vec![0b11000001],
),
with_interned_strings(
column("t_i", SemanticType::Tag),
InternedStrings {
dictionary: Some(PackedStrings {
values: "s1s2".to_string(),
offsets: vec![0, 2, 4],
}),
values: vec![0, 1, 0],
},
vec![0b11000001],
),
with_packed_strings(
column("t_p", SemanticType::Tag),
PackedStrings {
values: "s1s2s3".to_string(),
offsets: vec![0, 2, 4, 6],
},
vec![0b11000001],
),
with_bool(
column("bool", SemanticType::Field),
vec![false, false, true],
vec![0b11000001],
),
with_f64(
column("f64", SemanticType::Field),
vec![1.1, 2.2, 3.3],
vec![0b11000001],
),
with_i64(
column("i64", SemanticType::Field),
vec![1, 2, 3],
vec![0b11000001],
),
with_u64(
column("u64", SemanticType::Field),
vec![1, 2, 3],
vec![0b11000001],
),
with_i64(column("time", SemanticType::Time), vec![1, 2, 3], vec![]),
],
row_count: 9,
};
let mut batch = MutableBatch::new();
write_table_batch(&mut batch, &table_batch).unwrap();
let expected = &[
"+-------+-----+-----+-----+-----+-----+-----+-----+-----+--------------------------------+-----+",
"| bool | f64 | f_i | f_p | f_s | i64 | t_i | t_p | t_s | time | u64 |",
"+-------+-----+-----+-----+-----+-----+-----+-----+-----+--------------------------------+-----+",
"| | | | | | | | | | 1970-01-01T00:00:00.000000001Z | |",
"| false | 1.1 | s1 | s1 | s1 | 1 | s1 | s1 | s1 | 1970-01-01T00:00:00.000000002Z | 1 |",
"| false | 2.2 | s2 | s2 | s2 | 2 | s2 | s2 | s2 | 1970-01-01T00:00:00.000000003Z | 2 |",
"| true | 3.3 | s1 | s3 | s3 | 3 | s1 | s3 | s3 | 1970-01-01T00:00:00.000000003Z | 3 |",
"| true | 3.3 | s1 | s3 | s3 | 3 | s1 | s3 | s3 | 1970-01-01T00:00:00.000000003Z | 3 |",
"| true | 3.3 | s1 | s3 | s3 | 3 | s1 | s3 | s3 | 1970-01-01T00:00:00.000000003Z | 3 |",
"| | | | | | | | | | 1970-01-01T00:00:00.000000003Z | |",
"| | | | | | | | | | 1970-01-01T00:00:00.000000003Z | |",
"| true | 3.3 | s1 | s3 | s3 | 3 | s1 | s3 | s3 | 1970-01-01T00:00:00.000000003Z | 3 |",
"+-------+-----+-----+-----+-----+-----+-----+-----+-----+--------------------------------+-----+",
];
assert_batches_eq!(expected, &[batch.to_arrow(Selection::All).unwrap()]);
// we need at least one value though
let table_batch = TableBatch {
table_name: "table".to_string(),
columns: vec![with_i64(column("time", SemanticType::Time), vec![], vec![])],
row_count: 9,
};
let mut batch = MutableBatch::new();
let err = write_table_batch(&mut batch, &table_batch)
.unwrap_err()
.to_string();
assert_eq!(err, "column with no values: time");
} | rust_cleaned_test_functions.jsonl/36413 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 3258
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
15032,
65964,
70025,
1288,
41954,
35471,
9146,
368,
341,
286,
442,
3496,
3703,
1110,
5204,
905,
17996,
36706,
691,
17996,
36706,
1999,
2268,
65,
13945,
12,
17014,
2,
19133,
2022,
12,
17,
10188,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
#[test]
fn test_macro_expand_will_stop() {
do_resolve(
r#"
macro_rules! foo {
($($ty:ty)*) => { foo!($($ty)*, $($ty)*); }
}
foo!(KABOOM);
"#,
);
} | rust_cleaned_test_functions.jsonl/57033 | {
"file_path": "/home/dung/Code/Cross_test_gen (Copy)/clean_data_rust/data/rust_cleaned_test_functions.jsonl",
"token_count": 143
} | [
262,
11506,
1944,
921,
262,
5168,
1273,
58810,
67875,
1670,
483,
19039,
368,
341,
286,
653,
77291,
1006,
310,
435,
2,
698,
286,
18072,
21407,
0,
15229,
341,
310,
1711,
699,
1881,
25,
1881,
8,
3764,
589,
314,
15229,
0,
699,
699,
1881... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.