Aprende a testar os teus exercícios de OpenEuphoria no Exercism
A partir do diretório do exercício, executa exercism test ou eutest.
O Euphoria vai então executar t_<exercise>.e contra a tua solução.
No início de um exercício, o teu ficheiro de solução não devolve nenhum valor e rebenta quando é executado.
C:\path\to\leap.ex:3
<0120>:: no value returned from function
end function
^
FAILURE: t_leap.e EUPHORIA error with status 1
Test results summary:
FAIL: t_leap.e
Files (run: 1) (failed: 1) (0% success)
Isto é normal. Implementa a função e volta a executar para veres que testes passam e quais falham.
interpreting t_leap.e:
passed: year not divisible by 4 in common year
failed: year divisible by 2, not divisible by 4 in common year, expected: FALSE but got: TRUE
failed: year divisible by 4, not divisible by 100 in leap year, expected: TRUE but got: FALSE
...
9 tests run, 6 passed, 3 failed, 67% success
FAILURE: t_leap.e program died with status 1
Test results summary:
FAIL: t_leap.e
Files (run: 1) (failed: 1) (0% success)
Uma boa forma de começar é comentar todos os testes exceto o primeiro em t_<exercise>.e.
test_false("year not divisible by 4 in common year", leap(1800))
-- test_false("year divisible by 100 but not by 3 is still not a leap year", leap(1900))
-- test_false("year divisible by 2, not divisible by 4 in common year", leap(1970))
Trabalha-os um a um, descomentando o teste seguinte assim que o atual passar. Quando todos os testes passarem, concluíste o exercício.