From: Siraaj Khandkar Date: Thu, 13 Sep 2018 12:58:19 +0000 (-0400) Subject: Indicate "OK" for expected errors X-Git-Url: https://git.xandkar.net/?p=tiger.ml.git;a=commitdiff_plain;h=df6377392ff2959a614242615a1dda51f5b97176 Indicate "OK" for expected errors --- diff --git a/compiler/src/lib/tiger/tiger_test.ml b/compiler/src/lib/tiger/tiger_test.ml index 6a9ca10..83e9890 100644 --- a/compiler/src/lib/tiger/tiger_test.ml +++ b/compiler/src/lib/tiger/tiger_test.ml @@ -120,19 +120,19 @@ let run tests = let output_value = None in match f input with | exception e -> - let c, e = + let status_text, error_text = (match e with | Tiger_error.T e when is_error_expected e -> - (Green, Tiger_error.to_string e) + ((color Green "OK"), Tiger_error.to_string e) | Tiger_error.T e -> incr error_count; - (Red, Tiger_error.to_string e) + ((color Red "ERROR"), Tiger_error.to_string e) | e -> incr error_count; - (Red, Printexc.to_string e) + ((color Red "ERROR"), Printexc.to_string e) ) in - ( s "%s: %s" (color c "ERROR") e + ( s "%s: %s" status_text error_text , output_status , output_value )