1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Test suites for module `markdown`
16 module test_wikilinks
is test_suite
21 class TestTokenWikilink
24 fun test_token_location1
do
25 var string
= "[[wikilink]]"
26 var stack
= ["TokenWikiLink at 1,1--1,1"]
27 (new TestTokenProcessor(stack
)).process
(string
)
30 fun test_token_location2
do
31 var string
= "Hello [[World]]"
32 var stack
= ["TokenWikiLink at 1,7--1,7"]
33 (new TestTokenProcessor(stack
)).process
(string
)
36 fun test_token_location3
do
37 var string
= "\nHello\nworld [[wikilink]] !"
38 var stack
= ["TokenWikiLink at 3,7--3,7"]
39 (new TestTokenProcessor(stack
)).process
(string
)
42 fun test_token_location4
do
43 var string
= "[[link1]]\n\n[[link2]]"
45 "TokenWikiLink at 1,1--1,1",
46 "TokenWikiLink at 3,1--3,1"]
47 (new TestTokenProcessor(stack
)).process
(string
)
50 fun test_token_location5
do
51 var string
= "[[link1]]\n[[link2]]"
53 "TokenWikiLink at 1,1--1,1",
54 "TokenWikiLink at 2,1--2,1"]
55 (new TestTokenProcessor(stack
)).process
(string
)
58 fun test_token_location6
do
68 "TokenWikiLink at 1,1--1,1",
69 "TokenWikiLink at 3,1--3,1",
70 "TokenWikiLink at 7,1--7,1"]
71 (new TestTokenProcessor(stack
)).process
(string
)