examples/rosettacode: update ab to not crash on tests
authorJean Privat <jean@pryen.org>
Wed, 19 Nov 2014 02:05:21 +0000 (21:05 -0500)
committerJean Privat <jean@pryen.org>
Wed, 19 Nov 2014 02:05:21 +0000 (21:05 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

examples/rosettacode/ab.nit
tests/sav/ab.res

index 9138c0c..ce18fc0 100644 (file)
@@ -10,4 +10,8 @@
 module ab
 
 var words = gets.split(" ")
+if words.length != 2 then
+       print "Expected two numbers"
+       return
+end
 print words[0].to_i + words[1].to_i
index a9dbe22..a5dab0a 100644 (file)
@@ -1 +1 @@
-Runtime error: Assert 'index' failed (../lib/standard/collection/array.nit:258)
+Expected two numbers