tests: add more cases for text to rational number conversion
Test the ".1" and "1." cases which are assumed to be problematic on MacOS (or may not have been supported before a recent update). Add more tests with leading signs as well as whitespace instead of a sign.
This commit is contained in:
parent
d875496366
commit
74d915331a
|
@ -388,6 +388,13 @@ START_TEST(test_fractional)
|
|||
test_rational("+.1", (struct sr_rational){1, 10});
|
||||
test_rational("-0.1", (struct sr_rational){-1, 10});
|
||||
test_rational("-.1", (struct sr_rational){-1, 10});
|
||||
test_rational(".1", (struct sr_rational){1, 10});
|
||||
test_rational(".123", (struct sr_rational){123, 1000});
|
||||
test_rational("1.", (struct sr_rational){1, 1});
|
||||
test_rational("123.", (struct sr_rational){123, 1});
|
||||
test_rational("-.1", (struct sr_rational){-1, 10});
|
||||
test_rational(" .1", (struct sr_rational){1, 10});
|
||||
test_rational("+.1", (struct sr_rational){1, 10});
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
|
Loading…
Reference in New Issue