[vala/0.42] test: Add some invalid "non-null" tests
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.42] test: Add some invalid "non-null" tests
- Date: Mon, 22 Oct 2018 19:59:16 +0000 (UTC)
commit aafe983424ce30a855b7c5cd2f0c8d5e4a59f4b1
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 268d2b8d4..0e393d5fd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -615,6 +615,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]