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:
Gerhard Sittig 2018-07-16 21:19:36 +02:00 committed by Uwe Hermann
parent d875496366
commit 74d915331a
1 changed files with 7 additions and 0 deletions

View File

@ -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