Skip to content

Commit a3cec87

Browse files
authored
chore: update tests after new forge-std (#7374)
1 parent d75219c commit a3cec87

8 files changed

+17
-21
lines changed

crates/forge/tests/cli/cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ forgetest!(can_init_vscode, |prj, cmd| {
393393
let remappings = prj.root().join("remappings.txt");
394394
assert!(remappings.is_file());
395395
let content = std::fs::read_to_string(remappings).unwrap();
396-
assert_eq!(content, "ds-test/=lib/forge-std/lib/ds-test/src/\nforge-std/=lib/forge-std/src/",);
396+
assert_eq!(content, "forge-std/=lib/forge-std/src/",);
397397
});
398398

399399
// checks that forge can init with template

crates/forge/tests/cli/config.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ forgetest_init!(can_override_config, |prj, cmd| {
150150

151151
let profile = Config::load_with_root(prj.root());
152152
// ensure that the auto-generated internal remapping for forge-std's ds-test exists
153-
assert_eq!(profile.remappings.len(), 2);
154-
assert_eq!("ds-test/=lib/forge-std/lib/ds-test/src/", profile.remappings[0].to_string());
153+
assert_eq!(profile.remappings.len(), 1);
154+
assert_eq!("forge-std/=lib/forge-std/src/", profile.remappings[0].to_string());
155155

156156
// ensure remappings contain test
157-
assert_eq!("ds-test/=lib/forge-std/lib/ds-test/src/", profile.remappings[0].to_string());
157+
assert_eq!("forge-std/=lib/forge-std/src/", profile.remappings[0].to_string());
158158
// the loaded config has resolved, absolute paths
159159
assert_eq!(
160-
"ds-test/=lib/forge-std/lib/ds-test/src/",
160+
"forge-std/=lib/forge-std/src/",
161161
Remapping::from(profile.remappings[0].clone()).to_string()
162162
);
163163

@@ -221,12 +221,12 @@ forgetest_init!(can_parse_remappings_correctly, |prj, cmd| {
221221

222222
let profile = Config::load_with_root(prj.root());
223223
// ensure that the auto-generated internal remapping for forge-std's ds-test exists
224-
assert_eq!(profile.remappings.len(), 2);
225-
let [r, _] = &profile.remappings[..] else { unreachable!() };
226-
assert_eq!("ds-test/=lib/forge-std/lib/ds-test/src/", r.to_string());
224+
assert_eq!(profile.remappings.len(), 1);
225+
let r = &profile.remappings[0];
226+
assert_eq!("forge-std/=lib/forge-std/src/", r.to_string());
227227

228228
// the loaded config has resolved, absolute paths
229-
assert_eq!("ds-test/=lib/forge-std/lib/ds-test/src/", Remapping::from(r.clone()).to_string());
229+
assert_eq!("forge-std/=lib/forge-std/src/", Remapping::from(r.clone()).to_string());
230230

231231
cmd.arg("config");
232232
let expected = profile.to_string_pretty().unwrap();
@@ -432,11 +432,11 @@ forgetest!(can_set_gas_price, |prj, cmd| {
432432
forgetest_init!(can_detect_lib_foundry_toml, |prj, cmd| {
433433
let config = cmd.config();
434434
let remappings = config.remappings.iter().cloned().map(Remapping::from).collect::<Vec<_>>();
435+
dbg!(&remappings);
435436
pretty_assertions::assert_eq!(
436437
remappings,
437438
vec![
438439
// global
439-
"ds-test/=lib/forge-std/lib/ds-test/src/".parse().unwrap(),
440440
"forge-std/=lib/forge-std/src/".parse().unwrap(),
441441
]
442442
);
@@ -455,7 +455,6 @@ forgetest_init!(can_detect_lib_foundry_toml, |prj, cmd| {
455455
remappings,
456456
vec![
457457
// default
458-
"ds-test/=lib/forge-std/lib/ds-test/src/".parse().unwrap(),
459458
"forge-std/=lib/forge-std/src/".parse().unwrap(),
460459
// remapping is local to the lib
461460
"nested-lib/=lib/nested-lib/src/".parse().unwrap(),
@@ -481,7 +480,6 @@ forgetest_init!(can_detect_lib_foundry_toml, |prj, cmd| {
481480
// local to the lib
482481
"another-lib/=lib/nested-lib/lib/another-lib/src/".parse().unwrap(),
483482
// global
484-
"ds-test/=lib/forge-std/lib/ds-test/src/".parse().unwrap(),
485483
"forge-std/=lib/forge-std/src/".parse().unwrap(),
486484
"nested-lib/=lib/nested-lib/src/".parse().unwrap(),
487485
// remappings local to the lib
@@ -500,7 +498,6 @@ forgetest_init!(can_detect_lib_foundry_toml, |prj, cmd| {
500498
// local to the lib
501499
"another-lib/=lib/nested-lib/lib/another-lib/custom-source-dir/".parse().unwrap(),
502500
// global
503-
"ds-test/=lib/forge-std/lib/ds-test/src/".parse().unwrap(),
504501
"forge-std/=lib/forge-std/src/".parse().unwrap(),
505502
"nested-lib/=lib/nested-lib/src/".parse().unwrap(),
506503
// remappings local to the lib
@@ -529,7 +526,6 @@ forgetest_init!(can_prioritise_closer_lib_remappings, |prj, cmd| {
529526
remappings,
530527
vec![
531528
"dep1/=lib/dep1/src/".parse().unwrap(),
532-
"ds-test/=lib/forge-std/lib/ds-test/src/".parse().unwrap(),
533529
"forge-std/=lib/forge-std/src/".parse().unwrap()
534530
]
535531
);

crates/forge/tests/fixtures/can_create_template_contract.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Compiling 24 files with 0.8.23
1+
Compiling 27 files with 0.8.23
22
Solc 0.8.23 finished in 2.27s
33
Compiler run successful!
44
Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

crates/forge/tests/fixtures/can_create_using_unlocked.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Compiling 24 files with 0.8.23
1+
Compiling 27 files with 0.8.23
22
Solc 0.8.23 finished in 1.95s
33
Compiler run successful!
44
Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

crates/forge/tests/fixtures/can_create_with_constructor_args.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Compiling 25 files with 0.8.23
1+
Compiling 28 files with 0.8.23
22
Solc 0.8.23 finished in 2.82s
33
Compiler run successful!
44
Deployer: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266

crates/forge/tests/fixtures/can_test_repeatedly.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ No files changed, compilation skipped
22

33
Ran 2 tests for test/Counter.t.sol:CounterTest
44
[PASS] testFuzz_SetNumber(uint256) (runs: 256, μ: 26521, ~: 28387)
5-
[PASS] test_Increment() (gas: 28379)
5+
[PASS] test_Increment() (gas: 31225)
66
Suite result: ok. 2 passed; 0 failed; 0 skipped; finished in 9.42ms
77

88
Ran 1 test suite: 2 tests passed, 0 failed, 0 skipped (2 total tests)

crates/forge/tests/fixtures/can_use_libs_in_multi_fork.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Solc 0.8.23 finished in 1.95s
33
Compiler run successful!
44

55
Ran 1 test for test/Contract.t.sol:ContractTest
6-
[PASS] test() (gas: 70360)
6+
[PASS] test() (gas: 70404)
77
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 3.21s
88

99
Ran 1 test suite: 1 tests passed, 0 failed, 0 skipped (1 total tests)

crates/forge/tests/fixtures/repro_6531.stdout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Compiling 1 files with 0.8.23
33
Compiler run successful!
44

55
Ran 1 test for test/Contract.t.sol:USDCCallingTest
6-
[PASS] test() (gas: 16799)
6+
[PASS] test() (gas: 16821)
77
Traces:
8-
[16799] USDCCallingTest::test()
8+
[16821] USDCCallingTest::test()
99
├─ [0] VM::createSelectFork("<url>")
1010
│ └─ ← 0
1111
├─ [10350] 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48::name() [staticcall]

0 commit comments

Comments
 (0)