[OpenWrt-Devel] [PATCH uci 3/5] tests: cram: Lua: add test case for uci_get_errorstr

Petr Štetiar ynezz at true.cz
Sat Dec 7 17:52:55 EST 2019


In order to extend test coverage and help testing refactoring.

Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 tests/cram/config/broken | 1 +
 tests/cram/lua/basic.lua | 2 ++
 tests/cram/test_ucilua.t | 1 +
 3 files changed, 4 insertions(+)
 create mode 100644 tests/cram/config/broken

diff --git a/tests/cram/config/broken b/tests/cram/config/broken
new file mode 100644
index 000000000000..d2ecc0158e68
--- /dev/null
+++ b/tests/cram/config/broken
@@ -0,0 +1 @@
+config alias' 'a'
diff --git a/tests/cram/lua/basic.lua b/tests/cram/lua/basic.lua
index ceb706f6973e..f0052644c00e 100644
--- a/tests/cram/lua/basic.lua
+++ b/tests/cram/lua/basic.lua
@@ -42,3 +42,5 @@ local t = c:get("network", "lan", "dns")
 A(#t == 2)
 A(t[1] == "ns1.king.banik.cz")
 A(t[2] == "ns2.openwrt.org")
+
+print(c:get_all("broken"))
diff --git a/tests/cram/test_ucilua.t b/tests/cram/test_ucilua.t
index 1544e23c1bf4..cfe1f2e0e360 100644
--- a/tests/cram/test_ucilua.t
+++ b/tests/cram/test_ucilua.t
@@ -56,3 +56,4 @@ run basic Lua tests:
   proto: dhcp
   .anonymous: false
   aliases: c d
+  nil\tuci: Parse error (EOF with unterminated ') at line 1, byte 18 (esc)

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list