-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #366 from Enet4/bug/core/dicom_value_smallvec
Fix using dicom_value! without smallvec import
- Loading branch information
Showing
7 changed files
with
33 additions
and
24 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,27 @@ | ||
//! Separate test suite for using `dicom_value!` in an isolated context, | ||
//! without direct access to dependency `smallvec` | ||
// empty module makes `smallvec` dependency unreachable, | ||
// as would be typical in dependents of `dicom_core` | ||
// unless they include it themselves | ||
mod smallvec {} | ||
|
||
#[test] | ||
fn use_dicom_value() { | ||
use dicom_core::dicom_value; | ||
|
||
// multiple string literals with variant, no trailing comma | ||
let value = dicom_value!(Strs, ["BASE", "LIGHT", "DARK"]); | ||
assert_eq!( | ||
value.to_multi_str().as_ref(), | ||
&["BASE".to_owned(), "LIGHT".to_owned(), "DARK".to_owned(),], | ||
); | ||
|
||
// single string with variant | ||
let value = dicom_value!(Str, "PALETTE COLOR "); | ||
assert_eq!(value.to_string(), "PALETTE COLOR",); | ||
|
||
// numeric values | ||
let value = dicom_value!(U16, [1, 2, 5]); | ||
assert_eq!(value.to_multi_int::<u16>().unwrap(), &[1, 2, 5],); | ||
} |
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