aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-03-20 18:53:01 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-03-20 18:53:01 +0200
commit4bb665a577a90e3bc0d2e832d6950f0323a72492 (patch)
tree9e4409866bd8bec973de92e9667646c51f651310 /test cases
parenta3d49ca1ce5e6844387e8daedd2fc0713f36e540 (diff)
parent3eea1703ffb7559cc7d7454ced119aa45c167c9f (diff)
downloadmeson-4bb665a577a90e3bc0d2e832d6950f0323a72492.zip
meson-4bb665a577a90e3bc0d2e832d6950f0323a72492.tar.gz
meson-4bb665a577a90e3bc0d2e832d6950f0323a72492.tar.bz2
Merge pull request #464 from tp-m/bool-to-string-and-to-int
Add bool to_string() and to_int() methods.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/42 string formatting/meson.build6
-rw-r--r--test cases/common/68 number arithmetic/meson.build3
2 files changed, 9 insertions, 0 deletions
diff --git a/test cases/common/42 string formatting/meson.build b/test cases/common/42 string formatting/meson.build
index 99855b3..c2ee151 100644
--- a/test cases/common/42 string formatting/meson.build
+++ b/test cases/common/42 string formatting/meson.build
@@ -45,3 +45,9 @@ assert('#include <foo/bar.h>'.underscorify() == '_include__foo_bar_h_', 'Broken
assert('Do SomeThing 09'.underscorify() == 'Do_SomeThing_09', 'Broken underscorify')
assert('3'.to_int() == 3, 'String int conversion does not work.')
+
+assert(true.to_string() == 'true', 'bool string conversion failed')
+assert(false.to_string() == 'false', 'bool string conversion failed')
+assert(true.to_string('yes', 'no') == 'yes', 'bool string conversion with args failed')
+assert(false.to_string('yes', 'no') == 'no', 'bool string conversion with args failed')
+assert('@0@'.format(true) == 'true', 'bool string formatting failed')
diff --git a/test cases/common/68 number arithmetic/meson.build b/test cases/common/68 number arithmetic/meson.build
index 3872a11..4b98d73 100644
--- a/test cases/common/68 number arithmetic/meson.build
+++ b/test cases/common/68 number arithmetic/meson.build
@@ -32,3 +32,6 @@ assert(not(3 > 4), 'Gt broken')
assert(4 >= 3, 'Gte broken')
assert(not(3 >= 4), 'Gte broken')
assert(3 >= 3, 'Gte broken')
+
+assert(true.to_int() == 1,'bool to_int() broken')
+assert(false.to_int() == 0,'bool to_int() broken')