-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
53 additions
and
43 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
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,21 @@ | ||
use fixnum::{fixnum_const, FixedPoint}; | ||
|
||
#[test] | ||
fn valid() { | ||
type F64p9 = FixedPoint<i64, typenum::U9>; | ||
|
||
const SAMPLE0: F64p9 = fixnum_const!(42.42, 9); | ||
assert_eq!(SAMPLE0, F64p9::from_decimal(4242, -2).unwrap()); | ||
|
||
const SAMPLE1: F64p9 = fixnum_const!(42, 9); | ||
assert_eq!(SAMPLE1, F64p9::from_decimal(42, 0).unwrap()); | ||
|
||
const SAMPLE2: F64p9 = fixnum_const!(42., 9); | ||
assert_eq!(SAMPLE2, F64p9::from_decimal(42, 0).unwrap()); | ||
} | ||
|
||
#[test] | ||
fn too_long_fractional() { | ||
let test_cases = trybuild::TestCases::new(); | ||
test_cases.compile_fail("tests/it/const_ctor/too_long_fractional.rs"); | ||
} |
File renamed without changes.
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
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
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 |
---|---|---|
|
@@ -7,8 +7,6 @@ use fixnum::{ | |
*, | ||
}; | ||
|
||
mod macros; | ||
|
||
#[test] | ||
fn cmul_overflow() -> Result<()> { | ||
test_fixed_point! { | ||
|
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 was deleted.
Oops, something went wrong.