Skip to content

Commit e9d3ff7

Browse files
committed
add coverage for BuildStamp::with_prefix
Signed-off-by: onur-ozkan <[email protected]>
1 parent 2cee8c0 commit e9d3ff7

File tree

1 file changed

+16
-0
lines changed
  • src/bootstrap/src/utils/build_stamp

1 file changed

+16
-0
lines changed

src/bootstrap/src/utils/build_stamp/tests.rs

+16
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@ fn test_is_up_to_date() {
4242

4343
build_stamp.remove().unwrap();
4444
}
45+
46+
#[test]
47+
fn test_with_prefix() {
48+
let dir = temp_dir();
49+
50+
let stamp = BuildStamp::new(&dir).with_stamp("v1.0.0");
51+
assert_eq!(stamp.path.file_name().unwrap(), ".stamp");
52+
53+
let stamp = stamp.with_prefix("test");
54+
let expected_filename = ".test-stamp";
55+
assert_eq!(stamp.path.file_name().unwrap(), expected_filename);
56+
57+
let stamp = stamp.with_prefix("extra-prefix");
58+
let expected_filename = ".extra-prefix-test-stamp";
59+
assert_eq!(stamp.path.file_name().unwrap(), expected_filename);
60+
}

0 commit comments

Comments
 (0)