Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jun 8, 2024
1 parent 9b9449e commit e5a74ac
Show file tree
Hide file tree
Showing 29 changed files with 58 additions and 44 deletions.
8 changes: 4 additions & 4 deletions necessist/tests/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn necessist_db_can_be_moved() {
.args(["--root", &tempdir.path().to_string_lossy(), "--resume"])
.assert()
.success()
.stdout(predicate::eq("4 candidates in 1 test file\n"));
.stdout(predicate::eq("4 candidates in 4 tests in 1 test file\n"));
}

#[test]
Expand All @@ -65,7 +65,7 @@ fn resume_following_dry_run_failure() {
assert!(
stdout_normalized.starts_with(
"\
2 candidates in 2 test files
2 candidates in 2 tests in 3 test files
fixtures/dry_run_failure/tests/a.rs: dry running
fixtures/dry_run_failure/tests/a.rs: Warning: dry run failed: code=101
"
Expand All @@ -83,7 +83,7 @@ fixtures/dry_run_failure/tests/a.rs: Warning: dry run failed: code=101
.args(["--root", ROOT, "--resume"])
.assert()
.success()
.stdout(predicate::eq("2 candidates in 2 test files\n"));
.stdout(predicate::eq("2 candidates in 2 tests in 3 test files\n"));
}

// smoelius: Apparently, sending a ctrl-c on Windows is non-trivial:
Expand Down Expand Up @@ -142,7 +142,7 @@ fn resume_following_ctrl_c() {
// smoelius: N.B. `stdout_expected` intentionally lacks the following line:
// fixtures/basic/src/lib.rs:4:5-4:12: `n += 1;` passed
let stdout_expected: &str = "\
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/basic/src/lib.rs: dry running
fixtures/basic/src/lib.rs: mutilating
fixtures/basic/src/lib.rs:14:9-14:16: `n += 1;` timed-out
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/basic/src/lib.rs: dry running
fixtures/basic/src/lib.rs: mutilating
fixtures/basic/src/lib.rs:4:5-4:12: `n += 1;` passed
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_absent/basic_timeout.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/basic/src/lib.rs: dry running
fixtures/basic/src/lib.rs: mutilating
fixtures/basic/src/lib.rs:4:5-4:12: `n += 1;` passed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/basic/src/lib.rs: dry running
fixtures/basic/src/lib.rs: mutilating
fixtures/basic/src/lib.rs:4:5-4:12: `n += 1;` passed
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_absent/cfg.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/cfg/src/lib.rs: dry running
fixtures/cfg/src/lib.rs: mutilating
fixtures/cfg/src/lib.rs:5:5-5:12: Warning: Failed to run test `passed`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/cfg/src/lib.rs: dry running
fixtures/cfg/src/lib.rs: mutilating
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_absent/dry_run_failure.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2 candidates in 2 test files
2 candidates in 2 tests in 3 test files
fixtures/dry_run_failure/tests/a.rs: dry running
fixtures/dry_run_failure/tests/a.rs: Warning: dry run failed: code=101
stdout=```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2 candidates in 2 test files
2 candidates in 2 tests in 3 test files
fixtures/dry_run_failure/tests/a.rs: mutilating
fixtures/dry_run_failure/tests/b.rs: mutilating
fixtures/dry_run_failure/tests/b.rs:4:5-4:12: `n += 1;` passed
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1 candidates in 1 test file
1 candidates in 1 test in 1 test file
fixtures/dry_run_failure/tests/b.rs: dry running
fixtures/dry_run_failure/tests/b.rs: mutilating
fixtures/dry_run_failure/tests/b.rs:4:5-4:12: `n += 1;` passed
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_absent/invalid_utf8.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3 candidates in 1 test file
3 candidates in 1 test in 1 test file
fixtures/invalid_utf8/src/lib.rs: dry running
fixtures/invalid_utf8/src/lib.rs: mutilating
fixtures/invalid_utf8/src/lib.rs:8:5-8:19: Warning: invalid utf-8 sequence of 1 bytes from index 0: "/xFE"`
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_absent/parsing_failure.stdout
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Warning: Failed to parse "src/lib.rs": expected an expression
Silence this warning with: --allow parsing-failed
0 candidates in 0 test files
0 candidates in 0 tests in 0 test files
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_absent/valid_pattern.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
20 candidates in 1 test file
20 candidates in 1 test in 1 test file
fixtures/valid_pattern/src/lib.rs: dry running
fixtures/valid_pattern/src/lib.rs: mutilating
fixtures/valid_pattern/src/lib.rs:49:5-49:20: `foo().method();` passed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
fixtures/basic/src/lib.rs: dry running
fixtures/basic/src/lib.rs: mutilating
fixtures/basic/src/lib.rs:4:5-4:12: `n += 1;` passed
2 changes: 1 addition & 1 deletion necessist/tests/necessist_db_present/basic_resume.stdout
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4 candidates in 1 test file
4 candidates in 4 tests in 1 test file
36 changes: 25 additions & 11 deletions necessist/tests/third_party_tests/0/crates_io.stdout
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"
Warning: Failed to determine module path for test `test_write_crate`: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"

This may indicate a bug in Necessist. Consider opening an issue at: https://github.com/trailofbits/necessist/issues

Silence this warning with: --allow module-path-unknown
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `test_write_crates`: Failed to determine relative path of test file "$DIR/crates_io_index/ser.rs"
Warning: Failed to determine module path for test `empty_text`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_script_tag`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_iframe_tag`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_unknown_tag`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_kbd_tag`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_inline_javascript`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_fancy_single_quotes`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `code_block_with_syntax_highlighting`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `code_block_with_mermaid_highlighting`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `code_block_with_syntax_highlighting_even_if_annot_has_no_run`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_forbidden_class_attribute`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_footnote`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_with_complex_footnotes`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `relative_links`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `absolute_links_dont_get_resolved`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `rustdoc_links`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_to_html_renders_markdown`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_to_html_renders_other_things`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `header_has_tags`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `manual_anchor_is_sanitized`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `tables_with_rowspan_and_colspan`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `text_alignment`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
Warning: Failed to determine module path for test `image_alignment`: Failed to determine relative path of test file "$DIR/crates_io_markdown/lib.rs"
$DIR/crates_io_tarball/src/lib.rs: `.add_file(
"foo-0.0.1/Cargo.toml",
b"[package]\nname = \"foo\"\nversion = \"0.0.1\"\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
106 candidates in 1 test file
106 candidates in 17 tests in 2 test files
$DIR/src/encoding/base64/base64_test.go: dry running
$DIR/src/encoding/base64/base64_test.go: mutilating
$DIR/src/encoding/base64/base64_test.go: `.enc.EncodeToString([]byte(p.decoded))` nonbuildable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
112 candidates in 2 test files
112 candidates in 30 tests in 3 test files
$DIR/src/encoding/binary/binary_test.go: dry running
$DIR/src/encoding/binary/binary_test.go: mutilating
$DIR/src/encoding/binary/binary_test.go: `.NewReader(src)` nonbuildable
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/third_party_tests/0/go_src_mime.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
337 candidates in 9 test files
337 candidates in 56 tests in 12 test files
$DIR/src/mime/encodedword_test.go: dry running
$DIR/src/mime/encodedword_test.go: mutilating
$DIR/src/mime/encodedword_test.go: `.Repeat("é", 10)` nonbuildable
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/third_party_tests/0/go_src_net_url.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
74 candidates in 1 test file
74 candidates in 25 tests in 2 test files
$DIR/src/net/url/url_test.go: dry running
$DIR/src/net/url/url_test.go: mutilating
$DIR/src/net/url/url_test.go: `.DeepEqual(u, tt.out)` nonbuildable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
466 candidates in 1 test file
466 candidates in 78 tests in 1 test file
$DIR/src/os/os_test.go: dry running
$DIR/src/os/os_test.go: mutilating
$DIR/src/os/os_test.go: Warning: Failed to run test `TestMain`
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/third_party_tests/0/proptest_https.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
30 candidates in 1 test file
30 candidates in 9 tests in 1 test file
$DIR/proptest/src/sample.rs: dry running
$DIR/proptest/src/sample.rs: mutilating
$DIR/proptest/src/sample.rs: `.new_tree(&mut runner)` nonbuildable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
62 candidates in 1 test file
62 candidates in 4 tests in 1 test file
$DIR/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol: dry running
$DIR/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol: mutilating
$DIR/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol: `.calculateSmartContractAccountAddress(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
62 candidates in 1 test file
62 candidates in 4 tests in 1 test file
$DIR/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol: dry running
$DIR/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol: mutilating
$DIR/contracts/src/v0.8/transmission/test/EIP_712_1014_4337.t.sol: `.calculateSmartContractAccountAddress(
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/third_party_tests/1/go_src_os_user.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
18 candidates in 3 test files
18 candidates in 13 tests in 5 test files
$DIR/src/os/user/listgroups_unix_test.go: dry running
$DIR/src/os/user/listgroups_unix_test.go: mutilating
$DIR/src/os/user/listgroups_unix_test.go: Warning: Failed to run test `TestListGroups`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
134 candidates in 3 test files
134 candidates in 15 tests in 4 test files
$DIR/src/testing/iotest/logger_test.go: dry running
$DIR/src/testing/iotest/logger_test.go: mutilating
$DIR/src/testing/iotest/logger_test.go: `.Writer()` nonbuildable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
38 candidates in 1 test file
38 candidates in 16 tests in 2 test files
$DIR/src/text/template/parse/parse_test.go: dry running
$DIR/src/text/template/parse/parse_test.go: mutilating
$DIR/src/text/template/parse/parse_test.go: `typ = itemCharConstant` failed
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/third_party_tests/1/proptest_ssh.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
30 candidates in 1 test file
30 candidates in 9 tests in 1 test file
$DIR/proptest/src/sample.rs: dry running
$DIR/proptest/src/sample.rs: mutilating
$DIR/proptest/src/sample.rs: `.new_tree(&mut runner)` nonbuildable
Expand Down
6 changes: 3 additions & 3 deletions necessist/tests/third_party_tests/1/v3-core_factory.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
24 candidates in 1 test file
24 candidates in 23 tests in 1 test file
$DIR/test/UniswapV3Factory.spec.ts: dry running
$DIR/test/UniswapV3Factory.spec.ts: mutilating
$DIR/test/UniswapV3Factory.spec.ts: `await factory.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], FeeAmount.MEDIUM)` failed
Expand All @@ -8,13 +8,13 @@ $DIR/test/UniswapV3Factory.spec.ts: `.createPool(TEST_ADDRESSES[0], TEST_ADDRESS
$DIR/test/UniswapV3Factory.spec.ts: `.createPool(TEST_ADDRESSES[0], TEST_ADDRESSES[1], FeeAmount.MEDIUM)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.connect(other)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.setOwner(wallet.address)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.connect(other)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.enableFeeAmount(100, 2)` failed
$DIR/test/UniswapV3Factory.spec.ts: `await factory.setOwner(other.address)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.setOwner(other.address)` failed
$DIR/test/UniswapV3Factory.spec.ts: `await factory.setOwner(other.address)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.setOwner(other.address)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.setOwner(wallet.address)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.connect(other)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.enableFeeAmount(100, 2)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.enableFeeAmount(1000000, 10)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.enableFeeAmount(500, 0)` failed
$DIR/test/UniswapV3Factory.spec.ts: `.enableFeeAmount(500, 16834)` failed
Expand Down
2 changes: 1 addition & 1 deletion necessist/tests/third_party_tests/1/xnft.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
17 candidates in 1 test file
17 candidates in 10 tests in 1 test file
$DIR/tests/collectibles.spec.ts: dry running
$DIR/tests/collectibles.spec.ts: mutilating
$DIR/tests/collectibles.spec.ts: `await client.createCollectibleXnft({
Expand Down

0 comments on commit e5a74ac

Please sign in to comment.