Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hello, Ponytest!
class HelloWorld
let hello: String = "Hello, "
new create() =>
hello
fun say_hello(who: String = "World"): String =>
hello.add(who)
use "ponytest"
actor Main
new create(env: Env) =>
var test = PonyTest(env)
test(recover _TestHelloWorld end)
test.complete()
class _TestHelloWorld iso is UnitTest
"""
Test Hello World
"""
fun name(): String => "helloworld/HelloWorld"
fun apply(h: TestHelper): TestResult =>
let hello: HelloWorld = HelloWorld.create()
h.expect_eq[String]("Hello, World", hello.say_hello())
h.expect_eq[String]("Hello, George", hello.say_hello("George"))
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.