Skip to content

Commit d56360d

Browse files
authored
Rollup merge of #81428 - phansch:compiletest-tests, r=Mark-Simulacrum
compiletest: Add two more unit tests This adds two more unit tests and fixes spelling in `compiletest`.
2 parents f183e5f + a7625f8 commit d56360d

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Diff for: src/tools/compiletest/src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl fmt::Display for Debugger {
174174
/// Configuration for compiletest
175175
#[derive(Debug, Clone)]
176176
pub struct Config {
177-
/// `true` to to overwrite stderr/stdout files instead of complaining about changes in output.
177+
/// `true` to overwrite stderr/stdout files instead of complaining about changes in output.
178178
pub bless: bool,
179179

180180
/// The library paths required for running the compiler.

Diff for: src/tools/compiletest/src/util/tests.rs

+19
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,22 @@ fn test_matches_os() {
3030
assert!(matches_os("nvptx64-nvidia-cuda", "cuda"));
3131
assert!(matches_os("x86_64-fortanix-unknown-sgx", "sgx"));
3232
}
33+
34+
#[test]
35+
fn is_big_endian_test() {
36+
assert!(!is_big_endian("no"));
37+
assert!(is_big_endian("sparc-unknown-unknown"));
38+
}
39+
40+
#[test]
41+
fn path_buf_with_extra_extension_test() {
42+
assert_eq!(
43+
PathBuf::from("foo.rs.stderr"),
44+
PathBuf::from("foo.rs").with_extra_extension("stderr")
45+
);
46+
assert_eq!(
47+
PathBuf::from("foo.rs.stderr"),
48+
PathBuf::from("foo.rs").with_extra_extension(".stderr")
49+
);
50+
assert_eq!(PathBuf::from("foo.rs"), PathBuf::from("foo.rs").with_extra_extension(""));
51+
}

0 commit comments

Comments
 (0)