Skip to content

Commit 463e277

Browse files
committed
Add unit test for RTRIM-bug
1 parent d24529f commit 463e277

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

samples/distro-examples/tests/strings.bas

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,4 +209,9 @@ for t in number_test
209209
if (t[1] != bin(t[0])) then throw "err: bin(" + str(t[0]) + ") <> " + t[1]
210210
if (t[2] != oct(t[0])) then throw "err: oct(" + str(t[0]) + ") <> " + t[2]
211211
if (t[3] != hex(t[0])) then throw "err: hex(" + str(t[0]) + ") <> " + t[3]
212-
next
212+
next
213+
214+
REM Bug: RTRIM trimed input string on the right side
215+
s1 = " test "
216+
s2 = rtrim(s1)
217+
if(s1 != " test ") then throw "err: RTRIM changed input string"

0 commit comments

Comments
 (0)