99 [clojure.string :as string]))
1010
1111(clojure.test/deftest block-0001
12- (clojure.test/testing " doc/example.adoc - line 15 - The Basics"
12+ (clojure.test/testing " doc/example.adoc - line 18 - The Basics"
1313; ; Some valid Clojure code here
1414
1515; test-doc-blocks dummy assertion to appease tools that fail on no assertions
1616(clojure.test/is (= '" dummy" " dummy" ))))
1717
1818(clojure.test/deftest block-0002
19- (clojure.test/testing " doc/example.adoc - line 27 - The Basics"
19+ (clojure.test/testing " doc/example.adoc - line 30 - The Basics"
2020; ; test-doc-block will generate an assertion to verify (+ 1 2 3) evaluates to the expected 6
2121(clojure.test/is (= '6 (+ 1 2 3 )))))
2222
2323(clojure.test/deftest block-0003
24- (clojure.test/testing " doc/example.adoc - line 36 - The Basics"
24+ (clojure.test/testing " doc/example.adoc - line 39 - The Basics"
2525; ; test-doc-blocks will generate an assertion to verify (+ 1 2 3 4) evaluates to the expected 10
2626(clojure.test/is (= '10 (+ 1 2 3 4 )))
2727; ; it understands that Clojure and ClojureScript can evaluate differently
3636 (clojure.test/is (= [" is this right?" " or not?" ] (clojure.string/split-lines actual-out))))))
3737
3838(clojure.test/deftest block-0004
39- (clojure.test/testing " doc/example.adoc - line 89 - The Basics"
39+ (clojure.test/testing " doc/example.adoc - line 92 - The Basics"
4040(->> " here we are only checking that our code will run"
4141 reverse
4242 reverse
4646(clojure.test/is (= '" dummy" " dummy" ))))
4747
4848(clojure.test/deftest block-0005
49- (clojure.test/testing " doc/example.adoc - line 151 - Wrap Test in a Reader Conditional - :reader-cond"
49+ (clojure.test/testing " doc/example.adoc - line 154 - Wrap Test in a Reader Conditional - :reader-cond"
5050#?(:clj
5151(do
5252; ; This code block will be wrapped in a #?(:clj (do ...))
5959(clojure.test/is (= '" dummy" " dummy" ))))
6060
6161(clojure.test/deftest block-0006
62- (clojure.test/testing " doc/example.adoc - line 163 - Wrap Test in a Reader Conditional - :reader-cond"
62+ (clojure.test/testing " doc/example.adoc - line 166 - Wrap Test in a Reader Conditional - :reader-cond"
6363#?(:cljs
6464(do
6565; ; This code block will be wrapped in a #?(:cljs (do ...))
7171(clojure.test/is (= '" dummy" " dummy" ))))
7272
7373(clojure.test/deftest block-0007
74- (clojure.test/testing " doc/example.adoc - line 173 - Wrap Test in a Reader Conditional - :reader-cond"
74+ (clojure.test/testing " doc/example.adoc - line 176 - Wrap Test in a Reader Conditional - :reader-cond"
7575; ; And our generic cljc code:
7676(clojure.test/is (= '[1 2 3 ] (read-string " [1 2 3]" )))))
7777
7878(clojure.test/deftest ^:testing-meta123 block-0008
79- (clojure.test/testing " doc/example.adoc - line 273 - Specifying Metadata - :meta"
79+ (clojure.test/testing " doc/example.adoc - line 276 - Specifying Metadata - :meta"
8080; ; this code block will generate a test with metadata {:testing-meta123 true}
8181
8282(clojure.test/is (= '[[:a 1 ]] (into [] {:a 1 })))))
8383
8484(clojure.test/deftest ^{:testing-meta123 " a-specific-value" , :testing-meta789 :yip } block-0009
85- (clojure.test/testing " doc/example.adoc - line 286 - Specifying Metadata - :meta"
85+ (clojure.test/testing " doc/example.adoc - line 289 - Specifying Metadata - :meta"
8686; ; this code block will generate a test with metadata:
8787; ; {:testing-meta123 "a-specific-value" :testing-meta789 :yip}
8888
9393 [" oh" " my" " goodness" ])))))
9494
9595(clojure.test/deftest block-0010
96- (clojure.test/testing " doc/example.adoc - line 326 - Section Titles"
96+ (clojure.test/testing " doc/example.adoc - line 329 - Section Titles"
9797nil
9898
9999(clojure.test/is (= '" well!how!about!that" (string/join " !" [" well" " how" " about" " that" ])))))
100100
101101(clojure.test/deftest block-0011
102- (clojure.test/testing " doc/example.adoc - line 342 - Support for CommonMark Code Block Syntax"
102+ (clojure.test/testing " doc/example.adoc - line 345 - Support for CommonMark Code Block Syntax"
103103nil
104104
105105(clojure.test/is (= '{1 :a , 2 :b } (set/map-invert {:a 1 :b 2 })))))
106106
107107(clojure.test/deftest block-0012
108- (clojure.test/testing " doc/example.adoc - line 430 - Test Run Order"
108+ (clojure.test/testing " doc/example.adoc - line 433 - Test Run Order"
109109(defn fn-block1 [] (+ 1 2 3 ))
110110
111111; test-doc-blocks dummy assertion to appease tools that fail on no assertions
112112(clojure.test/is (= '" dummy" " dummy" ))))
113113
114114(clojure.test/deftest block-0013
115- (clojure.test/testing " doc/example.adoc - line 436 - Test Run Order"
115+ (clojure.test/testing " doc/example.adoc - line 439 - Test Run Order"
116116(def var-block2 (+ 4 5 6 ))
117117
118118(clojure.test/is (= '21 (+ (fn-block1 ) var-block2)))))
119119
120120(clojure.test/deftest block-0014
121- (clojure.test/testing " doc/example.adoc - line 445 - Test Run Order"
121+ (clojure.test/testing " doc/example.adoc - line 448 - Test Run Order"
122122(clojure.test/is (= '100 (+ (fn-block1 ) var-block2 79 )))))
123123
124124(defn test-ns-hook [] (block-0001 ) (block-0002 ) (block-0003 ) (block-0004 ) (block-0005 ) (block-0006 ) (block-0007 ) (block-0008 ) (block-0009 ) (block-0010 ) (block-0011 ) (block-0012 ) (block-0013 ) (block-0014 ))
0 commit comments