blob: 46b4e063bd69b2055aeb6e4adb216efd1ae6b50c (
plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
module Main (main) where
import Process.Shell (sh)
import Test.Hspec (describe, hspec, it, shouldBe)
main :: IO ()
main = do
anissue :: String <- [sh|realpath dist-newstyle/build/*/*/anissue-*/x/anissue/build/anissue|]
hspec do
describe "issue events" do
it "smoke" do
( `shouldBe`
concat
[ "df7c026 created issue 1\n",
"55b493c deleted issue 1\n",
"618907d changed issue 1\n",
"618907d created issue 2\n",
"e95b4ec created issue 1"
]
)
. fst @String @()
=<< [sh|
set -efu
PATH=#{anissue}${PATH+:$PATH}; export PATH
readonly tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
GIT_AUTHOR_DATE="Thu Jan 1 00:00:00 1970 +0000"; export GIT_AUTHOR_DATE
GIT_AUTHOR_EMAIL="jane@example.com"; export GIT_AUTHOR_EMAIL
GIT_AUTHOR_NAME="Jane Doe"; export GIT_AUTHOR_NAME
GIT_COMMITTER_DATE="Thu Jan 1 00:00:00 1970 +0000"; export GIT_COMMITTER_DATE
GIT_COMMITTER_EMAIL="jane@example.com"; export GIT_COMMITTER_EMAIL
GIT_COMMITTER_NAME="Jane Doe"; export GIT_COMMITTER_NAME
(
git init --initial-branch=main
cat >main.hs <<'EOF'
module Main where
EOF
git add main.hs
git commit -m 'no issues'
cat >main.hs <<'EOF'
module Main where
-- TODO issue 1
EOF
git add main.hs
git commit -m 'create issue 1'
cat >main.hs <<'EOF'
module Main where
-- TODO issue 2
EOF
cat >lib.hs <<'EOF'
module Main where
-- TODO issue 1
--
-- remark: file modifications are not considered changes!
EOF
git add main.hs lib.hs
git commit -m 'create issue 2, modify issue 1'
cat >lib.hs <<'EOF'
module Main where
EOF
git add lib.hs
git commit -m 'close issue 1'
cat >lib.hs <<'EOF'
module Main where
-- TODO issue 1
--
-- remark: file changes are not considered changes!
EOF
git add main.hs lib.hs
git commit -m 'reopen issue 1'
) 1>/dev/null
anissue log|]
describe "issues" do
it "smoke" do
( `shouldBe`
concat
[ "issue 2 on 1970-01-01 by Jane Doe\n",
"\n",
"issue 1 on 1970-01-01 by Jane Doe"
]
)
. fst @String @()
=<< [sh|
set -efu
PATH=#{anissue}${PATH+:$PATH}; export PATH
readonly tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
cd "$tmp"
GIT_AUTHOR_DATE="Thu Jan 1 00:00:00 1970 +0000"; export GIT_AUTHOR_DATE
GIT_AUTHOR_EMAIL="jane@example.com"; export GIT_AUTHOR_EMAIL
GIT_AUTHOR_NAME="Jane Doe"; export GIT_AUTHOR_NAME
GIT_COMMITTER_DATE="Thu Jan 1 00:00:00 1970 +0000"; export GIT_COMMITTER_DATE
GIT_COMMITTER_EMAIL="jane@example.com"; export GIT_COMMITTER_EMAIL
GIT_COMMITTER_NAME="Jane Doe"; export GIT_COMMITTER_NAME
(
git init --initial-branch=main
cat >main.hs <<'EOF'
module Main where
EOF
git add main.hs
git commit -m 'no issues'
cat >main.hs <<'EOF'
module Main where
-- TODO issue 1
EOF
git add main.hs
git commit -m 'create issue 1'
cat >main.hs <<'EOF'
module Main where
-- TODO issue 2
EOF
cat >lib.hs <<'EOF'
module Main where
-- TODO issue 1
--
-- remark: file modifications are not considered changes!
EOF
git add main.hs lib.hs
git commit -m 'create issue 2, modify issue 1'
cat >lib.hs <<'EOF'
module Main where
EOF
git add lib.hs
git commit -m 'close issue 1'
cat >lib.hs <<'EOF'
module Main where
-- TODO issue 1
--
-- remark: file changes are not considered changes!
EOF
git add main.hs lib.hs
git commit -m 'reopen issue 1'
) 1>/dev/null
anissue list|]
|