Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

cosmetic

  • Loading branch information...
commit 99e007e5eb9f05bd659f901edb9d954f5ea98cc4 1 parent 428da92
Sergey Lymar lymar authored

Showing 1 changed file with 14 additions and 12 deletions. Show diff stats Hide diff stats

  1. +14 12 tests/test.hs
26 tests/test.hs
@@ -13,10 +13,12 @@ import qualified Data.ByteString as BS
13 13 import qualified Data.ByteString.Lazy as LZ
14 14 import qualified Data.Text as T
15 15
  16 +resCorrectness = "result correctness"
  17 +
16 18 -- Hastache comments
17 19 commentsTest = do
18 20 res <- hastacheStr defaultConfig (encodeStr template) undefined
19   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  21 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
20 22 where
21 23 template = "\
22 24 \hello {{! comment #1}} world! \n\
@@ -33,7 +35,7 @@ commentsTest = do
33 35 variablesTest = do
34 36 res <- hastacheStr defaultConfig (encodeStr template)
35 37 (mkStrContext context)
36   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  38 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
37 39 where
38 40 template = "\
39 41 \ Char: [ {{Char}} ] \n\
@@ -70,7 +72,7 @@ variablesTest = do
70 72 emptyListSectionsTest = do
71 73 res <- hastacheStr defaultConfig (encodeStr template)
72 74 (mkStrContext context)
73   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  75 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
74 76 where
75 77 template = "\
76 78 \text 1\n\
@@ -97,7 +99,7 @@ emptyListSectionsTest = do
97 99 listSectionTest = do
98 100 res <- hastacheStr defaultConfig (encodeStr template)
99 101 (mkStrContext context)
100   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  102 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
101 103 where
102 104 template = "\
103 105 \text 1\n\
@@ -123,7 +125,7 @@ listSectionTest = do
123 125 boolSectionTest = do
124 126 res <- hastacheStr defaultConfig (encodeStr template)
125 127 (mkStrContext context)
126   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  128 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
127 129 where
128 130 template = "\
129 131 \text 1\n\
@@ -156,7 +158,7 @@ boolSectionTest = do
156 158 lambdaSectionTest = do
157 159 res <- hastacheStr defaultConfig (encodeStr template)
158 160 (mkStrContext context)
159   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  161 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
160 162 where
161 163 template = "\
162 164 \text 1\n\
@@ -174,7 +176,7 @@ lambdaSectionTest = do
174 176 -- Transform section with monadic function
175 177 lambdaMSectionTest = do
176 178 (res, writerState) <- runWriterT monadicFunction
177   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  179 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
178 180 assertEqualStr "monad state correctness" (decodeStr writerState)
179 181 testMonad
180 182 where
@@ -199,7 +201,7 @@ lambdaMSectionTest = do
199 201 setDelimiterTest = do
200 202 res <- hastacheStr defaultConfig (encodeStr template)
201 203 (mkStrContext context)
202   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  204 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
203 205 where
204 206 template = "\
205 207 \text 1\n\
@@ -224,7 +226,7 @@ setDelimiterTest = do
224 226 partialsTest = do
225 227 res <- hastacheStr defaultConfig (encodeStr template)
226 228 (mkStrContext context)
227   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  229 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
228 230 where
229 231 template = "\
230 232 \text 1\n\
@@ -261,7 +263,7 @@ data SomeData = SomeData {
261 263 genericContextTest = do
262 264 res <- hastacheStr defaultConfig (encodeStr template)
263 265 (mkGenericContext context)
264   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  266 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
265 267 where
266 268 template = "\
267 269 \text 1\n\
@@ -321,7 +323,7 @@ genericContextTest = do
321 323 nestedContextTest = do
322 324 res <- hastacheStr defaultConfig (encodeStr template)
323 325 (mkStrContext context)
324   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  326 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
325 327 where
326 328 template = "\
327 329 \{{top}}\n\
@@ -356,7 +358,7 @@ data NestedData = NestedData {
356 358
357 359 nestedGenericContextTest = do
358 360 res <- hastacheStr defaultConfig (encodeStr template) context
359   - assertEqualStr "result correctness" (decodeStrLBS res) testRes
  361 + assertEqualStr resCorrectness (decodeStrLBS res) testRes
360 362 where
361 363 template = "\
362 364 \Top variable : {{topDataTop}}\n\

0 comments on commit 99e007e

Please sign in to comment.
Something went wrong with that request. Please try again.