aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-13 03:57:12 -0800
committerAustin Hellyer <[email protected]>2017-01-13 09:17:05 -0800
commita8acd6138741a6e5268141ac4ce902561931d353 (patch)
treef3cc01856d84bb34feca0695775b32208fb6ad9f /tests
parentFix build (diff)
downloadserenity-a8acd6138741a6e5268141ac4ce902561931d353.tar.xz
serenity-a8acd6138741a6e5268141ac4ce902561931d353.zip
Convert Colour to be a tuple struct
The struct only has one field (`value`) anyway.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_colour.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/test_colour.rs b/tests/test_colour.rs
index fcf7463..110097a 100644
--- a/tests/test_colour.rs
+++ b/tests/test_colour.rs
@@ -5,16 +5,16 @@ use std::u32;
#[test]
fn new() {
- assert_eq!(Colour::new(1).value, 1);
- assert_eq!(Colour::new(u32::MIN).value, u32::MIN);
- assert_eq!(Colour::new(u32::MAX).value, u32::MAX);
+ assert_eq!(Colour::new(1).0, 1);
+ assert_eq!(Colour::new(u32::MIN).0, u32::MIN);
+ assert_eq!(Colour::new(u32::MAX).0, u32::MAX);
}
#[test]
fn from_rgb() {
- assert_eq!(Colour::from_rgb(255, 0, 0).value, 0xFF0000);
- assert_eq!(Colour::from_rgb(0, 255, 0).value, 0x00FF00);
- assert_eq!(Colour::from_rgb(0, 0, 255).value, 0x0000FF);
+ assert_eq!(Colour::from_rgb(255, 0, 0).0, 0xFF0000);
+ assert_eq!(Colour::from_rgb(0, 255, 0).0, 0x00FF00);
+ assert_eq!(Colour::from_rgb(0, 0, 255).0, 0x0000FF);
}
#[test]
@@ -39,12 +39,12 @@ fn get_tuple() {
#[test]
fn default() {
- assert_eq!(Colour::default().value, 0);
+ assert_eq!(Colour::default().0, 0);
}
#[test]
fn from() {
- assert_eq!(Colour::from(7i32).value, 7);
- assert_eq!(Colour::from(7u32).value, 7);
- assert_eq!(Colour::from(7u64).value, 7);
+ assert_eq!(Colour::from(7i32).0, 7);
+ assert_eq!(Colour::from(7u32).0, 7);
+ assert_eq!(Colour::from(7u64).0, 7);
}