Skip to content

Commit 6bdf067

Browse files
committed
run tests with and without std feature
1 parent 34ab7d5 commit 6bdf067

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ jobs:
3939
- uses: actions-rs/cargo@v1
4040
with:
4141
command: test
42+
- uses: actions-rs/cargo@v1
43+
with:
44+
command: test
45+
args: --no-default-features
4246

4347
fmt:
4448
name: Rustfmt

src/fmt.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,18 @@ mod tests {
111111

112112
#[test]
113113
fn test_expand() {
114-
assert("error {var}", "error {}", ", ( & var ) . get_display ( )");
115114
assert("fn main() {{ }}", "fn main() {{ }}", "");
115+
}
116+
117+
#[test]
118+
#[cfg_attr(not(feature = "std"), ignore)]
119+
fn test_std_expand() {
116120
assert(
117121
"{v} {v:?} {0} {0:?}",
118122
"{} {:?} {} {:?}",
119123
", ( & v ) . get_display ( ) , v , ( & _0 ) . get_display ( ) , _0",
120124
);
125+
assert("error {var}", "error {}", ", ( & var ) . get_display ( )");
121126

122127
// assert("The path {0.display()}", "The path {}", "0.display()");
123128
// assert("The path {0.display():?}", "The path {:?}", "0.display()");

tests/compile_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
#[allow(unused_attributes)]
12
#[rustversion::attr(not(nightly), ignore)]
3+
#[cfg_attr(feature = "std", ignore)]
24
#[test]
35
fn no_std() {
46
let t = trybuild::TestCases::new();

0 commit comments

Comments
 (0)