-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Added runtests to run all tests at once
- Loading branch information
1 parent
50b0891
commit 2a74d41
Showing
5 changed files
with
44 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
cd tests/ | ||
lua test_basic_functions.lua -v | ||
lua test_netjson_monitoring.lua -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
local lu = require('luaunit') | ||
package.path = package.path .. ";../?.lua" | ||
|
||
local basic_functions = require('basic_functions') | ||
local luaunit = require('luaunit') | ||
|
||
local basic_functions = require('../basic_functions') | ||
|
||
function testSplitFunction() | ||
-- When pattern is present | ||
lu.assertEquals(basic_functions.split("OpenWISP","n"), {"Ope", "WISP"}) | ||
lu.assertEquals(basic_functions.split("OpenWISP","WISP"), {"Open"}) | ||
luaunit.assertEquals(basic_functions.split("OpenWISP","n"), {"Ope", "WISP"}) | ||
luaunit.assertEquals(basic_functions.split("OpenWISP","WISP"), {"Open"}) | ||
|
||
-- When pattern is not available | ||
lu.assertEquals(basic_functions.split("OpenWISP","a"), {"OpenWISP"}) | ||
luaunit.assertEquals(basic_functions.split("OpenWISP","a"), {"OpenWISP"}) | ||
end | ||
|
||
function testHasValue() | ||
-- When value is present | ||
lu.assertEquals(basic_functions.has_value({2,4,5},4), true) | ||
lu.assertEquals(basic_functions.has_value({1,2,3,7,9},9), true) | ||
luaunit.assertEquals(basic_functions.has_value({2,4,5},4), true) | ||
luaunit.assertEquals(basic_functions.has_value({1,2,3,7,9},9), true) | ||
|
||
-- When value is not present | ||
lu.assertEquals(basic_functions.has_value({2,4,5},3), false) | ||
lu.assertEquals(basic_functions.has_value({1,2,3,7,9},8), false) | ||
-- When valuaunite is not present | ||
luaunit.assertEquals(basic_functions.has_value({2,4,5},3), false) | ||
luaunit.assertEquals(basic_functions.has_value({1,2,3,7,9},8), false) | ||
|
||
end | ||
|
||
function testRandom() | ||
-- When value is present | ||
-- lu.assertEquals(netjson_monitoring.) | ||
function testStartsWith() | ||
-- When valuaunite is present | ||
-- luaunit.assertEquals(netjson_monitoring.) | ||
|
||
end | ||
|
||
os.exit( lu.LuaUnit.run() ) | ||
os.exit(luaunit.LuaUnit.run()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters