diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/examples/x.lua | 6 | ||||
-rw-r--r-- | test/examples/x.lua.styled | 6 | ||||
-rw-r--r-- | test/lexTests.py | 10 |
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", |