Sha256: 7fbe4acd4b7c3b827b0d095a58e1404200b445220510a5b4bfd9a70b92f0b695

Contents?: true

Size: 930 Bytes

Versions: 70

Compression:

Stored size: 930 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

70 entries across 70 versions & 1 rubygems

Version Path
trackler-2.2.1.6 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.5 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.4 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.3 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.2 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.1 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.0 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.6 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.5 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.4 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.3 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.2 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.1 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.0.0 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.1.0.55 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.1.0.54 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.1.0.53 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.1.0.52 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.1.0.51 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.1.0.50 tracks/pony/exercises/roman-numerals/test.pony