Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rudimentary docs and tests for int constants (#54)
* Add rudimentary docs and tests for int constants * Bump version * Muck with travis
- Loading branch information
Showing
5 changed files
with
66 additions
and
4 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
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,39 @@ | ||
extern crate dimensioned as dim; | ||
|
||
use dim::si; | ||
|
||
// Just a couple simple tests to ensure that we're creating int consts. | ||
|
||
#[test] | ||
fn int_consts() { | ||
use si::Meter; | ||
|
||
assert_eq!(Meter::new(1), si::i8consts::M); | ||
assert_eq!(Meter::new(1), si::i16consts::M); | ||
assert_eq!(Meter::new(1), si::i32consts::M); | ||
assert_eq!(Meter::new(1), si::i64consts::M); | ||
assert_eq!(Meter::new(1), si::isize_consts::M); | ||
|
||
assert_eq!(Meter::new(1), si::u8consts::M); | ||
assert_eq!(Meter::new(1), si::u16consts::M); | ||
assert_eq!(Meter::new(1), si::u32consts::M); | ||
assert_eq!(Meter::new(1), si::u64consts::M); | ||
assert_eq!(Meter::new(1), si::usize_consts::M); | ||
} | ||
|
||
#[test] | ||
fn derived_int_consts() { | ||
use si::Newton; | ||
|
||
assert_eq!(Newton::new(1), si::i8consts::N); | ||
assert_eq!(Newton::new(1), si::i16consts::N); | ||
assert_eq!(Newton::new(1), si::i32consts::N); | ||
assert_eq!(Newton::new(1), si::i64consts::N); | ||
assert_eq!(Newton::new(1), si::isize_consts::N); | ||
|
||
assert_eq!(Newton::new(1), si::u8consts::N); | ||
assert_eq!(Newton::new(1), si::u16consts::N); | ||
assert_eq!(Newton::new(1), si::u32consts::N); | ||
assert_eq!(Newton::new(1), si::u64consts::N); | ||
assert_eq!(Newton::new(1), si::usize_consts::N); | ||
} |