[vala/0.48] tests: Add "integer/float literal" tests to increase coverage



commit 7565177f5ec944361dcd41abb31fa667b8857709
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Sep 28 17:36:50 2021 +0200

    tests: Add "integer/float literal" tests to increase coverage

 tests/Makefile.am                       |  2 ++
 tests/basic-types/float-literals.vala   | 14 ++++++++++++++
 tests/basic-types/integer-literals.vala | 26 ++++++++++++++++++++++++++
 3 files changed, 42 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d8b353fed..541fb6554 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -38,9 +38,11 @@ AM_TESTS_ENVIRONMENT = \
        export CC='$(CC)';
 
 TESTS = \
+       basic-types/integer-literals.vala \
        basic-types/integers.vala \
        basic-types/integers-boxed-cast.vala \
        basic-types/escape-chars.vala \
+       basic-types/float-literals.vala \
        basic-types/floats.vala \
        basic-types/floats-boxed-cast.vala \
        basic-types/boolean.vala \
diff --git a/tests/basic-types/float-literals.vala b/tests/basic-types/float-literals.vala
new file mode 100644
index 000000000..b4bba83a4
--- /dev/null
+++ b/tests/basic-types/float-literals.vala
@@ -0,0 +1,14 @@
+void main () {
+       {
+               float foo = 23.42F;
+               float bar = 47.11f;
+       }
+       {
+               double foo = 23.42D;
+               double bar = 47.11d;
+       }
+       {
+               double foo = 23.42;
+               double bar = 47.11;
+       }
+}
diff --git a/tests/basic-types/integer-literals.vala b/tests/basic-types/integer-literals.vala
new file mode 100644
index 000000000..60deedbd8
--- /dev/null
+++ b/tests/basic-types/integer-literals.vala
@@ -0,0 +1,26 @@
+void main () {
+       {
+               uint foo = 23U;
+               uint bar = 42u;
+       }
+       {
+               int foo = 23;
+               int bar = 42;
+       }
+       {
+               ulong foo = 23UL;
+               ulong bar = 42ul;
+       }
+       {
+               long foo = 23L;
+               long bar = 42l;
+       }
+       {
+               uint64 foo = 23ULL;
+               uint64 bar = 42ull;
+       }
+       {
+               int64 foo = 23LL;
+               int64 bar = 42ll;
+       }
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]