Skip to content

Commit 25c3bf9

Browse files
lilithkornelski
authored andcommitted
fix: correct test_fmt expectations in v08.rs
- Add u8 suffix to prevent i32 inference (wrong hex width) - Fix expected hex format to match actual UpperHex impl (#RRGGBB, no type name wrapper) - BGR hex output matches RGB order, consistent with passing internal test
1 parent 794f431 commit 25c3bf9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/v08.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,13 @@ mod rgb_test {
400400
#[test]
401401
#[allow(deprecated)]
402402
fn test_fmt() {
403-
let red_rgb = RGB::new(255, 0, 0);
404-
let red_bgr = BGR::new(255, 0, 0);
405-
assert_eq!("RGB { #FF0000 }", &format!("{red_rgb:X}"));
406-
assert_eq!("BGR { #0000FF }", &format!("{red_bgr:X}"));
403+
let red_rgb = RGB::new(255u8, 0, 0);
404+
let red_bgr = BGR::new(255u8, 0, 0);
405+
assert_eq!("#FF0000", &format!("{red_rgb:X}"));
406+
assert_eq!("#FF0000", &format!("{red_bgr:X}"));
407407

408-
assert_eq!("RGB { #ff0000 }", &format!("{red_rgb:x}"));
409-
assert_eq!("BGR { #0000ff }", &format!("{red_bgr:x}"));
408+
assert_eq!("#ff0000", &format!("{red_rgb:x}"));
409+
assert_eq!("#ff0000", &format!("{red_bgr:x}"));
410410

411411
assert_eq!("rgb(255,0,0)", &format!("{red_rgb}"));
412412
assert_eq!("bgr(0,0,255)", &format!("{red_bgr}"));

0 commit comments

Comments
 (0)