summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Aubry2012-07-25 10:49:24 (EDT)
committer sbernard2012-07-25 12:35:40 (EDT)
commit6ba637885bc8c75f65afdeee3c0a742d54b467f9 (patch)
treef548b76e63cd397687135ff3732d24bc66c20273
parent080361e6302027df08c4036fb0b9eb0447d9522f (diff)
downloadorg.eclipse.koneki.ldt-6ba637885bc8c75f65afdeee3c0a742d54b467f9.zip
org.eclipse.koneki.ldt-6ba637885bc8c75f65afdeee3c0a742d54b467f9.tar.gz
org.eclipse.koneki.ldt-6ba637885bc8c75f65afdeee3c0a742d54b467f9.tar.bz2
Adding test for scanners
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/comment.lua9
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/inline.lua1
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longluadoc.lua10
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longstring.lua4
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/luadoc.lua9
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/simple.lua5
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/comment.txt3
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/inline.txt5
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longluadoc.txt2
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longstring.txt3
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/luadoc.txt2
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/simple.txt5
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/keyword.lua9
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/number.lua1
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/keyword.txt14
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/number.txt6
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/firstline.lua5
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/keyword.lua11
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/longluadoc.lua11
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/module.lua9
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/firstline.txt1
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/keyword.txt7
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/longluadoc.txt4
-rw-r--r--tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/module.txt4
24 files changed, 136 insertions, 4 deletions
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/comment.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/comment.lua
new file mode 100644
index 0000000..673a709
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/comment.lua
@@ -0,0 +1,9 @@
+--- doc
+
+return 7 - -12 --[[
+"hello"
+---doc
+-- comment
+--[[ longcomment
+--[[- doc
+]] --comment
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/inline.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/inline.lua
new file mode 100644
index 0000000..5375fee
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/inline.lua
@@ -0,0 +1 @@
+--[[- doc]] --[[comment]] local var = [[string]].."string2" --comment \ No newline at end of file
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longluadoc.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longluadoc.lua
new file mode 100644
index 0000000..1d72bb1
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longluadoc.lua
@@ -0,0 +1,10 @@
+--[[-
+"hello"
+---doc
+-- comment
+--[[ longcomment
+--[[- doc
+]]
+
+--[[- @module modulename]]
+return nil \ No newline at end of file
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longstring.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longstring.lua
new file mode 100644
index 0000000..41a1a77
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/longstring.lua
@@ -0,0 +1,4 @@
+return [[--[[string
+"string2"
+]] .. "string3" .. [[--string4
+]]
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/luadoc.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/luadoc.lua
new file mode 100644
index 0000000..63ea0fd
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/luadoc.lua
@@ -0,0 +1,9 @@
+---
+--[[ doc ]]
+---
+-- --[[- doc]]
+-- "hello"
+
+---
+-- @module modulename
+return nil \ No newline at end of file
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/simple.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/simple.lua
index fcb5ae3..0db6610 100644
--- a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/simple.lua
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/input/simple.lua
@@ -2,6 +2,7 @@
--[[- @function [parent=#modulename] functionname]]
--[[print hello]]
+local var = [[hello world]]
--- return the module
-return "hello world" \ No newline at end of file
+-- return
+return "hello world"
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/comment.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/comment.txt
new file mode 100644
index 0000000..f44aff2
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/comment.txt
@@ -0,0 +1,3 @@
+{0;8;__lua_doc}
+{24;61;__lua_multi_line_comment}
+{86;10;__lua_comment}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/inline.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/inline.txt
new file mode 100644
index 0000000..5cc99ec
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/inline.txt
@@ -0,0 +1,5 @@
+{0;11;__lua_doc_multi_line}
+{12;13;__lua_multi_line_comment}
+{38;10;__lua_multi_line_string}
+{50;9;__lua_string}
+{60;9;__lua_comment}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longluadoc.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longluadoc.txt
new file mode 100644
index 0000000..7e5ed4c
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longluadoc.txt
@@ -0,0 +1,2 @@
+{0;62;__lua_doc_multi_line}
+{64;26;__lua_doc_multi_line}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longstring.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longstring.txt
new file mode 100644
index 0000000..364b84a
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/longstring.txt
@@ -0,0 +1,3 @@
+{7;25;__lua_multi_line_string}
+{36;9;__lua_string}
+{49;14;__lua_multi_line_string}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/luadoc.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/luadoc.txt
new file mode 100644
index 0000000..c021cd8
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/luadoc.txt
@@ -0,0 +1,2 @@
+{0;48;__lua_doc}
+{49;26;__lua_doc}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/simple.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/simple.txt
index 0e97ac9..431726c 100644
--- a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/simple.txt
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codepartionner/reference/simple.txt
@@ -1,5 +1,6 @@
{0;23;__lua_doc}
{24;51;__lua_doc_multi_line}
{76;17;__lua_multi_line_comment}
-{95;21;__lua_comment}
-{123;13;__lua_string}
+{106;15;__lua_multi_line_string}
+{123;10;__lua_comment}
+{140;13;__lua_string}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/keyword.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/keyword.lua
new file mode 100644
index 0000000..e149995
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/keyword.lua
@@ -0,0 +1,9 @@
+local myfunction()
+ return true;
+end
+
+for forvar in [0,1,2]
+ if myfunction() or orvar then
+ print (forvar)
+ end
+end
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/number.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/number.lua
new file mode 100644
index 0000000..9030c86
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/input/number.lua
@@ -0,0 +1 @@
+local v1,v0xE,v1e5,v4 = 1- -7, 4.2, 7e9, 0xA \ No newline at end of file
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/keyword.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/keyword.txt
new file mode 100644
index 0000000..79ebd46
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/keyword.txt
@@ -0,0 +1,14 @@
+{0;5;DLTK_keyword}
+{20;6;DLTK_keyword}
+{27;4;DLTK_keyword}
+{33;3;DLTK_keyword}
+{38;3;DLTK_keyword}
+{49;2;DLTK_keyword}
+{53;1;DLTK_number}
+{55;1;DLTK_number}
+{57;1;DLTK_number}
+{61;2;DLTK_keyword}
+{77;2;DLTK_keyword}
+{86;4;DLTK_keyword}
+{109;3;DLTK_keyword}
+{113;3;DLTK_keyword}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/number.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/number.txt
new file mode 100644
index 0000000..da0e631
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/codescanner/reference/number.txt
@@ -0,0 +1,6 @@
+{0;5;DLTK_keyword}
+{24;1;DLTK_number}
+{28;1;DLTK_number}
+{31;3;DLTK_number}
+{36;3;DLTK_number}
+{41;3;DLTK_number}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/firstline.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/firstline.lua
new file mode 100644
index 0000000..03cbe37
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/firstline.lua
@@ -0,0 +1,5 @@
+---@module modulename
+
+---@rabbit
+
+---not a @module
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/keyword.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/keyword.lua
new file mode 100644
index 0000000..f070620
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/keyword.lua
@@ -0,0 +1,11 @@
+--[[-
+@module modulename
+@return return
+
+@type typename
+@field [parent=#modulename] fieldname
+
+@function [parent=#modulename] name
+@param #type paramname
+@usage usage here
+]]
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/longluadoc.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/longluadoc.lua
new file mode 100644
index 0000000..dd0a39f
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/longluadoc.lua
@@ -0,0 +1,11 @@
+--[[-
+ ShortDesc.
+ LongDesc of the @module
+ @rabbit
+ @module modulename
+]]
+
+--[[- @function [parent=#modulename] functionname
+ @param name param
+ @field fieldname
+]]
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/module.lua b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/module.lua
new file mode 100644
index 0000000..571e4df
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/input/module.lua
@@ -0,0 +1,9 @@
+---
+-- ShortDesc.
+-- LongDesc of the @module
+-- @rabbit
+-- @module modulename
+
+--- @function [parent=#modulename] functionname
+-- @param name param
+-- @field fieldname
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/firstline.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/firstline.txt
new file mode 100644
index 0000000..16ee831
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/firstline.txt
@@ -0,0 +1 @@
+{3;7;luadoc.tags}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/keyword.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/keyword.txt
new file mode 100644
index 0000000..4cb1649
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/keyword.txt
@@ -0,0 +1,7 @@
+{6;7;luadoc.tags}
+{25;7;luadoc.tags}
+{41;5;luadoc.tags}
+{56;6;luadoc.tags}
+{95;9;luadoc.tags}
+{131;6;luadoc.tags}
+{154;6;luadoc.tags}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/longluadoc.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/longluadoc.txt
new file mode 100644
index 0000000..7a3fb44
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/longluadoc.txt
@@ -0,0 +1,4 @@
+{53;7;luadoc.tags}
+{82;9;luadoc.tags}
+{127;6;luadoc.tags}
+{146;6;luadoc.tags}
diff --git a/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/module.txt b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/module.txt
new file mode 100644
index 0000000..a19c41b
--- /dev/null
+++ b/tests/org.eclipse.koneki.ldt.ui.tests/tests/luadocumentor/reference/module.txt
@@ -0,0 +1,4 @@
+{59;7;luadoc.tags}
+{83;9;luadoc.tags}
+{130;6;luadoc.tags}
+{151;6;luadoc.tags}