Improve alpha/opacity function tests
This commit is contained in:
parent
44d257494a
commit
bf98382b0b
@ -44,6 +44,10 @@ impl Display for Number {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if frac != BigRational::from_integer(BigInt::from(0)) {
|
||||
write!(f, "{}", (frac * BigRational::from_integer(BigInt::from(10))).round().to_integer())?;
|
||||
}
|
||||
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -49,5 +49,10 @@ test!(
|
||||
test!(
|
||||
alpha_function_4_hex,
|
||||
"a {\n color: alpha(#0123);\n}\n",
|
||||
"a {\n color: .25;\n}\n"
|
||||
"a {\n color: 0.2;\n}\n"
|
||||
);
|
||||
test!(
|
||||
alpha_function_named_color,
|
||||
"a {\n color: alpha(red);\n}\n",
|
||||
"a {\n color: 1;\n}\n"
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user