summary refs log tree commit diff stats
path: root/tests/stdlib/tcgi.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tcgi.nim')
-rw-r--r--tests/stdlib/tcgi.nim22
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/stdlib/tcgi.nim b/tests/stdlib/tcgi.nim
index bc177125e..ef39450da 100644
--- a/tests/stdlib/tcgi.nim
+++ b/tests/stdlib/tcgi.nim
@@ -1,10 +1,15 @@
-import unittest

-import cgi, strtabs

+discard """

+  matrix: "--mm:refc; --mm:orc"

+"""

 

-suite "Test cgi module":

+import std/unittest

+import std/[cgi, strtabs, sugar]

+import std/assertions

+

+block: # Test cgi module

   const queryString = "foo=bar&фу=бар&checked=✓&list=1,2,3&with_space=text%20with%20space"

 

-  test "test query parsing with readData":

+  block: # test query parsing with readData

     let parsedQuery = readData(queryString)

 

     check parsedQuery["foo"] == "bar"

@@ -15,3 +20,12 @@ suite "Test cgi module":
 

     expect KeyError:

       discard parsedQuery["not_existing_key"]

+

+# bug #15369

+let queryString = "a=1&b=0&c=3&d&e&a=5&a=t%20e%20x%20t&e=http%3A%2F%2Fw3schools.com%2Fmy%20test.asp%3Fname%3Dst%C3%A5le%26car%3Dsaab"

+

+doAssert collect(for pair in decodeData(queryString): pair) ==

+  @[("a", "1"), ("b", "0"), ("c", "3"),

+    ("d", ""),("e", ""), ("a", "5"), ("a", "t e x t"),

+  ("e", "http://w3schools.com/my test.asp?name=ståle&car=saab")

+]

tml?h=main&id=4c4d325ca8544f52bb305dbb46b1f8144c33c2af'>4c4d325c ^
a654e4ec ^
9e751bb8 ^

a654e4ec ^
e5c11a51 ^
4690ce81 ^
4a39d12d ^
a654e4ec ^
e5c11a51 ^
9e751bb8 ^
c5ffb6e1 ^

a654e4ec ^



e5c11a51 ^






















a654e4ec ^

c5ffb6e1 ^
e5c11a51 ^
a654e4ec ^
204dae92 ^







97eb971b ^
204dae92 ^


9e751bb8 ^
204dae92 ^
97eb971b ^
204dae92 ^

97eb971b ^
204dae92 ^





97eb971b ^
204dae92 ^

97eb971b ^
204dae92 ^


97eb971b ^

204dae92 ^



c5ffb6e1 ^


a654e4ec ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101