]> sigrok.org Git - libsigrok.git/blobdiff - tests/strutil.c
tests: add more cases for text to rational number conversion
[libsigrok.git] / tests / strutil.c
index 14240f049f1f4c181d74cbe820803cb7d2f00072..82856f1dd4a4d8e719bc0c5b5b9326fa6334a2a7 100644 (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