-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test for clang::is_minversion
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,36 @@ mod test { | |
} | ||
} | ||
|
||
#[test] | ||
fn test_is_minversion() { | ||
assert_eq!(Clang { | ||
clangplusplus: false, | ||
is_appleclang: false, | ||
version: Some("\"Ubuntu Clang 14.0.0\"".to_string()), | ||
}.is_minversion(14), true); | ||
assert_eq!(Clang { | ||
clangplusplus: false, | ||
is_appleclang: false, | ||
version: Some("\"Ubuntu Clang 13.0.0\"".to_string()), | ||
}.is_minversion(14), false); | ||
assert_eq!(Clang { | ||
clangplusplus: false, | ||
is_appleclang: false, | ||
version: Some("\"FreeBSD Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)\"".to_string()), | ||
}.is_minversion(14), true); | ||
assert_eq!(Clang { | ||
clangplusplus: false, | ||
is_appleclang: false, | ||
version: Some("\"FreeBSD Clang 13.0.0 ([email protected]:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)\"".to_string()), | ||
}.is_minversion(14), false); | ||
|
||
assert_eq!(Clang { | ||
clangplusplus: false, | ||
is_appleclang: true, | ||
version: Some("\"FreeBSD Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)\"".to_string()), | ||
}.is_minversion(14), false); // is_appleclang wins | ||
} | ||
|
||
#[test] | ||
fn test_parse_arguments_simple() { | ||
let a = parses!("-c", "foo.c", "-o", "foo.o"); | ||
|