[vala/0.40] test: Add some invalid "non-null" tests
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.40] test: Add some invalid "non-null" tests
- Date: Sun, 28 Oct 2018 09:30:05 +0000 (UTC)
commit 02accca3af4397303e0c730efccdda29c7d499cb
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 f36214c7f..3ce4ca2cd 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -602,6 +602,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]