@import tags.coffee @for((t, i) <- List("42", "4", "5", "64", "[\"b\",\"c\"]", "125", "Five cubed is 125.", "success").zipWithIndex) { }
Expected valueActual valueResult
@t

Tests running @coffee.inline() { window.checkAnswers = -> # See if the test passed. num_tests = $('#test-table tr').length - 1 $('#num-tests').text num_tests + ' tests found.' passed = true for i in [1..num_tests] r = $('#expected-' + i).text() == $('#actual-' + i).text() result_string = if r then 'Passed' else 'Failed' $('#result-' + i).text result_string console.log 'Test ' + i + ' ' + result_string passed &= r $('#result').text (if passed then 'All tests passed' else 'Failure') }