Sha256: 67677322e345389541e0f27875052a95136719952ca2feae60dbd4a0dda8d6d5

Contents?: true

Size: 935 Bytes

Versions: 165

Compression:

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

165 entries across 165 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.179 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.178 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.177 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.176 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.175 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.174 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.173 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.172 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.171 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.170 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.169 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.167 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.166 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.165 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.164 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.163 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.162 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.161 tracks/pony/exercises/roman-numerals/test.pony
trackler-2.2.1.160 tracks/pony/exercises/roman-numerals/test.pony