aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2016-03-19 17:11:28 +0000
committerTim-Philipp Müller <tim@centricular.com>2016-03-19 17:11:53 +0000
commitfcbd60c29117129ab8dd78c7f2af78a2e3d007e6 (patch)
tree7abcba54ce55440193a47ad33fee6291279dba1d /test cases
parentdc049660e7d5e7c4b4a9ded4acb02fe90860adfb (diff)
downloadmeson-fcbd60c29117129ab8dd78c7f2af78a2e3d007e6.zip
meson-fcbd60c29117129ab8dd78c7f2af78a2e3d007e6.tar.gz
meson-fcbd60c29117129ab8dd78c7f2af78a2e3d007e6.tar.bz2
Add += support for strings and integers
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/91 plusassign/meson.build25
1 files changed, 25 insertions, 0 deletions
diff --git a/test cases/common/91 plusassign/meson.build b/test cases/common/91 plusassign/meson.build
index c1e47e0..ac477e7 100644
--- a/test cases/common/91 plusassign/meson.build
+++ b/test cases/common/91 plusassign/meson.build
@@ -43,3 +43,28 @@ x += x
if x.length() != 4
error('Incorrect selfappend.')
endif
+
+# += on strings
+
+bra = 'bra'
+foo = 'A'
+foo += bra
+foo += 'cada'
+foo += bra
+assert (foo == 'Abracadabra', 'string += failure [@0@]'.format(foo))
+assert (bra == 'bra', 'string += modified right argument!')
+foo += ' ' + foo
+assert (foo == 'Abracadabra Abracadabra', 'string += failure [@0@]'.format(foo))
+
+# += on ints
+
+foo = 5
+foo += 6
+assert (foo == 11, 'int += failure [@0@]'.format(foo))
+bar = 99
+foo += bar
+assert (foo == 110, 'int += failure [@0@]'.format(foo))
+assert (bar == 99, 'int += modified right argument"')
+bar += foo + 1
+assert (bar == 210, 'int += failure [@0@]'.format(bar))
+assert (foo == 110, 'int += modified right argument"')