Software / code / prosody
Comparison
spec/util_json_spec.lua @ 9326:c9c4b8bc53b1
util.json tests: Add [luacheck] annotation to mark intentionally-empty if branch
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 17 Sep 2018 15:28:53 +0100 |
| parent | 8562:a6188f5d5bb5 |
| child | 10591:d78c5c9b0cf6 |
comparison
equal
deleted
inserted
replaced
| 9325:982f8ae61de2 | 9326:c9c4b8bc53b1 |
|---|---|
| 40 for name in lfs.dir(path) do | 40 for name in lfs.dir(path) do |
| 41 if name:match("%.json$") then | 41 if name:match("%.json$") then |
| 42 local f = assert(io.open(path.."/"..name)); | 42 local f = assert(io.open(path.."/"..name)); |
| 43 local content = assert(f:read("*a")); | 43 local content = assert(f:read("*a")); |
| 44 assert(f:close()); | 44 assert(f:close()); |
| 45 if skip:find(name) then | 45 if skip:find(name) then --luacheck: ignore 542 |
| 46 -- Skip | 46 -- Skip |
| 47 elseif name:match("^pass") then | 47 elseif name:match("^pass") then |
| 48 valid_data[name] = content; | 48 valid_data[name] = content; |
| 49 elseif name:match("^fail") then | 49 elseif name:match("^fail") then |
| 50 invalid_data[name] = content; | 50 invalid_data[name] = content; |