]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "string concat" test for POSIX to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 9 Mar 2021 14:52:30 +0000 (15:52 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 9 Mar 2021 14:52:30 +0000 (15:52 +0100)
tests/Makefile.am
tests/posix/string-concat.vala [new file with mode: 0644]

index 7718adef4f26393eb2d7d47d90e4d1bfd45f1e32..b22e19768fa045a20d4b3ea464df06170d35e9b8 100644 (file)
@@ -1216,6 +1216,7 @@ LINUX_TESTS += \
        linux/file-commandpipe.vala \
        posix/arrays.vala \
        posix/empty-length-0.vala \
+       posix/string-concat.vala \
        posix/string-printf.vala \
        posix/struct_only.vala \
        posix/delegate_only.vala \
diff --git a/tests/posix/string-concat.vala b/tests/posix/string-concat.vala
new file mode 100644 (file)
index 0000000..ead6abe
--- /dev/null
@@ -0,0 +1,8 @@
+unowned string get_foo () {
+       return "foo";
+}
+
+void main () {
+       string s = get_foo () + "bar" + "!";
+       assert (s == "foobar!");
+}