Skip to content

Commit

Permalink
Add test case to validate String.concat uses offset and len correctly.
Browse files Browse the repository at this point in the history
In response to #2723
  • Loading branch information
patroclos authored and SeanTAllen committed May 30, 2018
1 parent 10b5ad3 commit 2c06b0b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/builtin_test/_test.pony
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ actor Main is TestList
test(_TestStringRecalc)
test(_TestStringTruncate)
test(_TestStringChop)
test(_TestStringConcatOffsetLen)
test(_TestSpecialValuesF32)
test(_TestSpecialValuesF64)
test(_TestArrayAppend)
Expand Down Expand Up @@ -1092,6 +1093,15 @@ class iso _TestStringChop is UnitTest
h.assert_eq[String box](expected_left, consume left)
h.assert_eq[String box](expected_right, consume right)

class iso _TestStringConcatOffsetLen is UnitTest
"""
Test String.concat working correctly for non-default offset and len arguments
"""
fun name(): String => "builtin/String.concat"

fun apply(h: TestHelper) =>
h.assert_eq[String](recover String .> concat("ABCD".values(), 1, 2) end, "BC")

class iso _TestArrayAppend is UnitTest
fun name(): String => "builtin/Array.append"

Expand Down

0 comments on commit 2c06b0b

Please sign in to comment.