[vala: 2/2] test: Add some invalid "non-null" tests



commit ee795f45df16592e1cc9715beb295d3d22d7ad77
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Oct 16 21:19:45 2018 +0200

    test: Add some invalid "non-null" tests

 tests/Makefile.am                                       | 3 +++
 tests/nullability/local-variable-invalid-convert.test   | 5 +++++
 tests/nullability/method-parameter-invalid-convert.test | 9 +++++++++
 tests/nullability/method-return-invalid-convert.test    | 8 ++++++++
 4 files changed, 25 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 89020c012..d18208a13 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -616,6 +616,9 @@ TESTS = \
 
 NON_NULL_TESTS = \
        nullability/bug611223.vala \
+       nullability/local-variable-invalid-convert.test \
+       nullability/method-parameter-invalid-convert.test \
+       nullability/method-return-invalid-convert.test \
        $(NULL)
 
 LINUX_TESTS = \
diff --git a/tests/nullability/local-variable-invalid-convert.test 
b/tests/nullability/local-variable-invalid-convert.test
new file mode 100644
index 000000000..4abd180a0
--- /dev/null
+++ b/tests/nullability/local-variable-invalid-convert.test
@@ -0,0 +1,5 @@
+Invalid Code
+
+void main () {
+       string s = null;
+}
diff --git a/tests/nullability/method-parameter-invalid-convert.test 
b/tests/nullability/method-parameter-invalid-convert.test
new file mode 100644
index 000000000..823ef788a
--- /dev/null
+++ b/tests/nullability/method-parameter-invalid-convert.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+void foo (string s) {
+}
+
+void main () {
+       string? s = null;
+       foo (s);
+}
diff --git a/tests/nullability/method-return-invalid-convert.test 
b/tests/nullability/method-return-invalid-convert.test
new file mode 100644
index 000000000..461a8bc4b
--- /dev/null
+++ b/tests/nullability/method-return-invalid-convert.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+string foo () {
+       return null;
+}
+
+void main () {
+}


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