Skip to content

Instantly share code, notes, and snippets.

@malthe
Created October 13, 2016 19:28
Show Gist options
  • Save malthe/d75e9fff12b7744e320fb51103c7086d to your computer and use it in GitHub Desktop.
Save malthe/d75e9fff12b7744e320fb51103c7086d to your computer and use it in GitHub Desktop.
use "ponytest"
actor Main is TestList
new create(env: Env) => PonyTest(env, this)
new make() => None
fun tag tests(test: PonyTest) =>
test(_TestString)
class iso _TestString is UnitTest
fun name(): String => "builtin/String"
fun apply(h: TestHelper) =>
_test_cstring(h)
fun _test_cstring(h: TestHelper) =>
let s: String iso = "Hello world".clone()
s.trim_in_place(where to=s.size() - 1)
h.assert_eq[String](s, "Hello world")
h.assert_false(s.is_null_terminated())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment