-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* static_assert * static_assert * fmt * wi * static_assert
- Loading branch information
1 parent
4cc619d
commit 1904a47
Showing
4 changed files
with
95 additions
and
50 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[alias] | ||
t = "test --release" | ||
c = "tarpaulin --out html --release --lib --fail-under 100" | ||
n = "nextest run --release" |
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
mod io; | ||
mod sha224; | ||
|
||
#[cfg(test)] | ||
mod static_assert; | ||
|
||
// | ||
pub use sha224::compress; |
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pub const fn static_assert(v: bool) -> () { | ||
[0][!v as usize]; | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use std::panic; | ||
|
||
use super::static_assert; | ||
|
||
#[test] | ||
fn test() { | ||
static_assert(true); | ||
} | ||
|
||
#[test] | ||
fn test_panic() { | ||
panic::catch_unwind(|| static_assert(false)).unwrap_err(); | ||
} | ||
} |