2121(require 'purescript-sort-imports )
2222
2323(ert-deftest empty-buffer ()
24- (should ( with-temp-buffer
24+ (with-temp-buffer
2525 (purescript-sort-imports)
26- t )))
26+ t ))
2727
2828(ert-deftest single-line ()
29- (should ( with-temp-buffer
29+ (with-temp-buffer
3030 (insert " import A\n " )
3131 (goto-char (point-min ))
3232 (purescript-sort-imports)
33- (string= (buffer-string )
34- " import A\n " ))))
33+ (should ( string= (buffer-string )
34+ " import A\n " ))))
3535
3636(ert-deftest two-idem ()
37- (should ( with-temp-buffer
37+ (with-temp-buffer
3838 (insert " import A
3939import B
4040" )
4141 (goto-char (point-min ))
4242 (purescript-sort-imports)
43- (string= (buffer-string )
44- " import A
43+ (should ( string= (buffer-string )
44+ " import A
4545import B
4646" )))
47- (should ( with-temp-buffer
47+ (with-temp-buffer
4848 (insert " import A (A, B, C)
4949import B
5050" )
5151 (goto-char (point-min ))
5252 (purescript-sort-imports)
53- (string= (buffer-string )
54- " import A (A, B, C)
53+ (should ( string= (buffer-string )
54+ " import A (A, B, C)
5555import B
5656" )))
57- (should ( with-temp-buffer
57+ (with-temp-buffer
5858 (insert " import A (mtl)
5959import B
6060" )
6161 (goto-char (point-min ))
6262 (purescript-sort-imports)
63- (string= (buffer-string )
64- " import A (mtl)
63+ (should ( string= (buffer-string )
64+ " import A (mtl)
6565import B
6666" ))))
6767
6868(ert-deftest two-rev ()
69- (should ( with-temp-buffer
69+ (with-temp-buffer
7070 (insert " import B
7171import A
7272" )
7373 (goto-char (point-min ))
7474 (purescript-sort-imports)
75- (string= (buffer-string )
76- " import A
75+ (should ( string= (buffer-string )
76+ " import A
7777import B
7878" ))))
7979
8080(ert-deftest file-structure ()
81- (should ( with-temp-buffer
81+ (with-temp-buffer
8282 (insert " module A where
8383import B
8484import A
@@ -87,12 +87,12 @@ import A
8787 (goto-char (point-min ))
8888 (forward-line 1 )
8989 (purescript-sort-imports)
90- (string= (buffer-string )
91- " module A where
90+ (should ( string= (buffer-string )
91+ " module A where
9292import A
9393import B
9494" )))
95- (should ( with-temp-buffer
95+ (with-temp-buffer
9696 (insert " module C where
9797
9898import B
@@ -102,15 +102,15 @@ import A
102102 (goto-char (point-min ))
103103 (forward-line 2 )
104104 (purescript-sort-imports)
105- (string= (buffer-string )
106- " module C where
105+ (should ( string= (buffer-string )
106+ " module C where
107107
108108import A
109109import B
110110" ))))
111111
112112(ert-deftest bos-270 ()
113- (should ( with-temp-buffer
113+ (with-temp-buffer
114114 (insert " import Data.Aeson.Encode (encode)
115115import Data.Aeson.Types
116116import Data.Aeson.Parser.Internal (decodeWith, decodeStrictWith,
@@ -121,8 +121,8 @@ import Data.ByteString.Lazy as L
121121" )
122122 (goto-char (point-min ))
123123 (purescript-sort-imports)
124- (string= (buffer-string )
125- " import Data.Aeson.Encode (encode)
124+ (should ( string= (buffer-string )
125+ " import Data.Aeson.Encode (encode)
126126import Data.Aeson.Parser.Internal (decodeWith, decodeStrictWith,
127127 eitherDecodeWith, eitherDecodeStrictWith,
128128 jsonEOF, json, jsonEOF', json')
0 commit comments