Sha256: db29b2330c268bad65929afa25782adbde6b206146c8a3ee10c12174f7cf49cf

Contents?: true

Size: 948 Bytes

Versions: 87

Compression:

Stored size: 948 Bytes

Contents

use "ponytest"

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

  fun tag tests(test: PonyTest) =>
    test(_TestRomanNumerals)

class iso _TestRomanNumerals is UnitTest
  fun name(): String => "roman-numerals/RomanNumerals"

  fun apply(h: TestHelper) =>
    let tests: Array[(USize, String)] = [
      (0, ""),
      (1, "I"),
      (2, "II"),
      (3, "III"),
      (4, "IV"),
      (5, "V"),
      (6, "VI"),
      (9, "IX"),
      (27, "XXVII"),
      (48, "XLVIII"),
      (59, "LIX"),
      (93, "XCIII"),
      (141, "CXLI"),
      (163, "CLXIII"),
      (402, "CDII"),
      (575, "DLXXV"),
      (911, "CMXI"),
      (1024, "MXXIV"),
      (3000, "MMM")
    ]

    for test in tests.values() do
      try
        h.assert_eq[String](RomanNumerals(test._1), test._2)
      else
        h.fail()
      end
    end

    h.assert_error({() ? => RomanNumerals(-1)})
    h.assert_error({() ? => RomanNumerals(4000)})

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
trackler-2.0.8.13 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.12 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.11 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.10 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.9 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.8 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.7 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.6 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.5 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.4 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.3 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.2 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.8.1 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.7.0 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.6.44 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.6.43 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.6.42 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.6.41 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.6.40 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.0.6.39 tracks/pony/exercises/roman-numerals/test.pony