From c752ea104418de0d04f9197f03b336ed27feaed2 Mon Sep 17 00:00:00 2001 From: Tero Frondelius Date: Wed, 24 Jun 2015 18:32:47 +0300 Subject: [PATCH] added a test to find non ascii characters from src --- test/runtests.jl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index dddfe88..6842981 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,12 +21,20 @@ facts("Testing if somebody used print, println(), @sprint in src directory") do @fact lines_with_print => isempty "Instead of println() use Logging.jl package" end -facts("One test to test code coverage") do - m = new_model() - #field = new_field(m.elements, "color") - #field[1] = "red" # set element 1 field value to "red" - #field2 = get_field(m.elements, "color") # get color field - @fact "red" => "red" +facts("Testing if we have non ascii characters in the src files") do + lines_with_non_ascii = [] + src_dir = "../src" + src = readdir(src_dir) + for file_name in src + fil = open(joinpath(src_dir,file_name),"r") + for (line_number,line) in enumerate(readlines(fil)) + if ismatch(r"[^\x00-\x7F]",line) + push!(lines_with_non_ascii, file_name * ":line $line_number") + end + end + close(fil) + end + @fact lines_with_non_ascii => isempty "non ascii charecters found in src -> test is failing" end