File tree Expand file tree Collapse file tree 5 files changed +96
-0
lines changed Expand file tree Collapse file tree 5 files changed +96
-0
lines changed Original file line number Diff line number Diff line change 1+ # Package
2+
3+ version = " 0.1.0"
4+ author = " David Anes <kraptor>"
5+ description = " A new awesome nimble package"
6+ license = " MIT"
7+ srcDir = " src"
8+ bin = @ [" run" ]
9+
10+
11+ # Dependencies
12+
13+ requires " nim >= 0.19.0"
Original file line number Diff line number Diff line change 1+ # Package
2+
3+ version = " 0.1.0"
4+ author = " David Anes <kraptor>"
5+ description = " A new awesome nimble package"
6+ license = " MIT"
7+ srcDir = " src"
8+ bin = @ [" run" ]
9+
10+
11+ # Dependencies
12+
13+ requires " nim >= 0.19.0"
14+
15+
16+ task task1, " Description1" :
17+ echo " blah"
18+
19+ task very_long_task, " This is a task with a long name" :
20+ echo " blah"
21+
22+ task aaa, " A task with a small name" :
23+ echo " blah"
Original file line number Diff line number Diff line change 1+ # Package
2+
3+ version = " 0.1.0"
4+ author = " David Anes <kraptor>"
5+ description = " A new awesome nimble package"
6+ license = " MIT"
7+ srcDir = " src"
8+ bin = @ [" run" ]
9+
10+
11+ # Dependencies
12+
13+ requires " nim >= 0.19.0"
14+
15+
16+ task a, " Description for a" :
17+ echo " blah blah"
Original file line number Diff line number Diff line change 1+ # Package
2+
3+ version = " 0.1.0"
4+ author = " David Anes <kraptor>"
5+ description = " A new awesome nimble package"
6+ license = " MIT"
7+ srcDir = " src"
8+ bin = @ [" run" ]
9+
10+
11+ # Dependencies
12+
13+ requires " nim >= 0.19.0"
14+
15+
16+ task nodesc, " " :
17+ echo " A task with no description"
Original file line number Diff line number Diff line change @@ -1283,3 +1283,29 @@ suite "issues":
12831283 let lines = output.strip.processOutput ()
12841284 check exitCode != QuitSuccess
12851285 check inLines (lines, " Nothing to build" )
1286+
1287+ suite " nimble tasks" :
1288+ test " can list tasks even with no tasks defined in nimble file" :
1289+ cd " tasks/empty" :
1290+ let (_, exitCode) = execNimble (" tasks" )
1291+ check exitCode == QuitSuccess
1292+
1293+ test " tasks with no descriptions are correctly displayed" :
1294+ cd " tasks/nodesc" :
1295+ let (output, exitCode) = execNimble (" tasks" )
1296+ check output.contains (" nodesc" )
1297+ check exitCode == QuitSuccess
1298+
1299+ test " task descriptions are correctly aligned to longer name" :
1300+ cd " tasks/max" :
1301+ let (output, exitCode) = execNimble (" tasks" )
1302+ check output.contains (" task1 Description1" )
1303+ check output.contains (" very_long_task This is a task with a long name" )
1304+ check output.contains (" aaa A task with a small name" )
1305+ check exitCode == QuitSuccess
1306+
1307+ test " task descriptions are correctly aligned to minimum (10 chars)" :
1308+ cd " tasks/min" :
1309+ let (output, exitCode) = execNimble (" tasks" )
1310+ check output.contains (" a Description for a" )
1311+ check exitCode == QuitSuccess
You can’t perform that action at this time.
0 commit comments