sernatur/test/percentage.vala

17 lines
453 B
Vala
Raw Normal View History

2019-01-15 16:45:41 -03:00
using LibSernatur.Misc;
2019-01-15 16:39:41 -03:00
2019-01-15 16:54:00 -03:00
void add_percentage_tests () {
Test.add_func ("/sernatur/test/percentage", () => {
assert (Percentage.format_float ((float) 0.43) == "43%");
assert (Percentage.format_float ((float) 1) == "100%");
assert (Percentage.format_double (0.43) == "43%");
assert (Percentage.format_double (1) == "100%");
});
}
int main (string[] args) {
Test.init (ref args);
add_percentage_tests ();
return Test.run ();
2019-01-15 16:39:41 -03:00
}