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



commit 6618759a7b0b9b9a6c02fce66fd9e684bacc3ba8
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 9ff938cf6..a943ce161 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -368,6 +368,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)
 
 check-TESTS: $(TESTS) $(NON_NULL_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]