]> 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>
Sat, 13 Mar 2021 20:36:20 +0000 (21:36 +0100)
tests/Makefile.am
tests/posix/string-concat.vala [new file with mode: 0644]

index 8e2e49b3bb922eb598475b9babda3c099a393198..763977f59e7a94c3058ff153535965c5a0eb7e14 100644 (file)
@@ -1197,6 +1197,7 @@ LINUX_TESTS += \
        linux/file-commandpipe.vala \
        posix/arrays.vala \
        posix/empty-length-0.vala \
+       posix/string-concat.vala \
        posix/struct_only.vala \
        posix/delegate_only.vala \
        posix/enum_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!");
+}