Skip to content

Property1UnitTest[T: T]

[Source]

Provides plumbing for integration of PonyCheck Properties into PonyTest.

Wrap your properties into this class and use it in a TestList:

use "pony_test"
use "pony_check"

class MyProperty is Property1[String]
  fun name(): String => "my_property"

  fun gen(): Generator[String] =>
    Generators.ascii_printable()

  fun property(arg1: String, h: PropertyHelper) =>
    h.assert_true(arg1.size() > 0)

actor Main is TestList
  new create(env: Env) => PonyTest(env, this)

  fun tag tests(test: PonyTest) =>
    test(Property1UnitTest[String](MyProperty))
class iso Property1UnitTest[T: T] is
  UnitTest ref

Implements


Constructors

create

[Source]

Wrap a Property1 to make it mimic the PonyTest UnitTest.

If name' is given, use this as the test name. If not, use the property's name().

new iso create(
  p1: Property1[T] iso,
  name': (String val | None val) = reference)
: Property1UnitTest[T] iso^

Parameters

Returns


Public Functions

name

[Source]

fun box name()
: String val

Returns


apply

[Source]

fun ref apply(
  h: TestHelper val)
: None val ?

Parameters

Returns


exclusion_group

fun box exclusion_group()
: String val

Returns


timed_out

fun ref timed_out(
  h: TestHelper val)
: None val

Parameters

Returns


set_up

fun ref set_up(
  h: TestHelper val)
: None val ?

Parameters

Returns


tear_down

fun ref tear_down(
  h: TestHelper val)
: None val

Parameters

Returns


label

fun box label()
: String val

Returns