aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2013-04-05 16:35:00 +1100
committernyamatongwe <unknown>2013-04-05 16:35:00 +1100
commit8d4bcadddaf9d32d0bd1987c62e5c01ab557e38e (patch)
tree9c26b18d1f9a81c763e62327008458341b80a1eb
parentba55d1ef8eb99d5ff2499ce38b4f8f7118d7eb57 (diff)
downloadscintilla-mirror-8d4bcadddaf9d32d0bd1987c62e5c01ab557e38e.tar.gz
Added test for Lua lexer.
-rw-r--r--test/examples/x.lua6
-rw-r--r--test/examples/x.lua.styled6
-rw-r--r--test/lexTests.py10
3 files changed, 20 insertions, 2 deletions
diff --git a/test/examples/x.lua b/test/examples/x.lua
new file mode 100644
index 000000000..7172c85d2
--- /dev/null
+++ b/test/examples/x.lua
@@ -0,0 +1,6 @@
+--[[ Block
+comment ]]
+function first()
+ -- Comment
+ func(SCI_ANNOTATIONSETTEXT, 'a', 0, "LINE1")
+end
diff --git a/test/examples/x.lua.styled b/test/examples/x.lua.styled
new file mode 100644
index 000000000..d693279ff
--- /dev/null
+++ b/test/examples/x.lua.styled
@@ -0,0 +1,6 @@
+{1}--[[ Block
+comment ]]{0}
+{5}function{0} {11}first{10}(){0}
+ {2}-- Comment
+{0} {11}func{10}({11}SCI_ANNOTATIONSETTEXT{10},{0} {7}'a'{10},{0} {4}0{10},{0} {6}"LINE1"{10}){0}
+{5}end{0}
diff --git a/test/lexTests.py b/test/lexTests.py
index f6b67d8aa..2a245649c 100644
--- a/test/lexTests.py
+++ b/test/lexTests.py
@@ -58,8 +58,11 @@ class TestLexers(unittest.TestCase):
self.ed.AddText(lenDocument, prog)
self.ed.Colourise(0, lenDocument)
self.assertEquals(self.ed.EndStyled, lenDocument)
- with open(namePrevious, "rb") as f:
- prevStyled = f.read()
+ try:
+ with open(namePrevious, "rb") as f:
+ prevStyled = f.read()
+ except FileNotFoundError:
+ prevStyled = ""
progStyled = self.AsStyled()
if progStyled != prevStyled:
with open(nameNew, "wb") as f:
@@ -104,6 +107,9 @@ class TestLexers(unittest.TestCase):
def testVB(self):
self.LexExample("x.vb", b"vb", [b"as dim or string"])
+ def testLua(self):
+ self.LexExample("x.lua", b"lua", [b"function end"])
+
def testD(self):
self.LexExample("x.d", b"d",
[b"keyword1", b"keyword2", b"", b"keyword4", b"keyword5",