diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-04-01 14:02:55 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2020-04-01 14:05:27 +0200 |
commit | 792e9672a07fec8cbe4152789ad38c4304c8e266 (patch) | |
tree | 5fec9fd6beb642dc29ba8bde8d5c29f378ecc768 /tests | |
parent | c69b4866c342116c8cf7b3d5a839929acc50b065 (diff) | |
download | vala-792e9672a07fec8cbe4152789ad38c4304c8e266.tar.gz |
vala: Consider boolean types are compatible with each other
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/basic-types/boolean.vala | 20 | ||||
-rw-r--r-- | tests/basic-types/custom-types.vala | 3 |
3 files changed, 23 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index a77e4dbae..9f956d793 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,6 +24,7 @@ TESTS = \ basic-types/integers.vala \ basic-types/escape-chars.vala \ basic-types/floats.vala \ + basic-types/boolean.vala \ basic-types/custom-types.vala \ basic-types/default-gtype.vala \ basic-types/strings.vala \ diff --git a/tests/basic-types/boolean.vala b/tests/basic-types/boolean.vala new file mode 100644 index 000000000..1e6c04fb3 --- /dev/null +++ b/tests/basic-types/boolean.vala @@ -0,0 +1,20 @@ +[SimpleType] +[BooleanType] +public struct Foo { + public void check () { + if (this) { + return; + } + assert (true); + } +} + +void main () { + Foo foo = true; + + foo.check (); + + if (!foo) { + assert (true); + } +} diff --git a/tests/basic-types/custom-types.vala b/tests/basic-types/custom-types.vala index d979a9beb..e8aa5d727 100644 --- a/tests/basic-types/custom-types.vala +++ b/tests/basic-types/custom-types.vala @@ -46,6 +46,7 @@ void main () { assert (baz == double.MAX); } { - manam_t manam; + manam_t manam = true; + assert (manam); } } |