Skip to content

Commit 897dbcd

Browse files
committed
wip
1 parent fc7e53b commit 897dbcd

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

tests/test_flatten_pragma

3.31 MB
Binary file not shown.

tests/test_flatten_pragma.nim

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,14 @@ suite "test flatten opts in subcommand":
281281
conf.outerArg1 == "quz"
282282

283283
type
284-
LvlCmd1 = enum
284+
Lvl1Cmd = enum
285285
lvlCmd1
286286

287287
suite "test one lvl flatten subcommand":
288288
type
289289
TopSubCmdConf = object
290-
case cmd {.command.}: LvlCmd1
291-
of LvlCmd1.lvlCmd1:
290+
case cmd {.command.}: Lvl1Cmd
291+
of Lvl1Cmd.lvlCmd1:
292292
lvl1Arg1 {.
293293
defaultValue: "lvl1Arg1 default"
294294
desc: "lvl1Arg1 desc"
@@ -303,7 +303,7 @@ suite "test one lvl flatten subcommand":
303303
"--lvl1-arg1=foo"
304304
])
305305
check:
306-
conf.cmd == LvlCmd1.lvlCmd1
306+
conf.cmd == Lvl1Cmd.lvlCmd1
307307
conf.lvl1Arg1 == "foo"
308308

309309
test "top cmd flatten":
@@ -312,7 +312,7 @@ suite "test one lvl flatten subcommand":
312312
"--lvl1-arg1=foo"
313313
])
314314
check:
315-
conf.topCmd.cmd == LvlCmd1.lvlCmd1
315+
conf.topCmd.cmd == Lvl1Cmd.lvlCmd1
316316
conf.topCmd.lvl1Arg1 == "foo"
317317

318318
test "redefine cmd flatten opt":
@@ -334,8 +334,8 @@ type
334334
suite "test two lvls flatten subcommands":
335335
type
336336
TopSubCmdConf = object
337-
case cmd {.command.}: LvlCmd1
338-
of LvlCmd1.lvlCmd1:
337+
case cmd {.command.}: Lvl1Cmd
338+
of Lvl1Cmd.lvlCmd1:
339339
lvl1Arg1 {.
340340
defaultValue: "lvl1Arg1 default"
341341
desc: "lvl1Arg1 desc"
@@ -356,7 +356,7 @@ suite "test two lvls flatten subcommands":
356356
])
357357
check:
358358
conf.cmd == TopCmd1.topLvlCmd1
359-
conf.topCmd1.cmd == LvlCmd1.lvlCmd1
359+
conf.topCmd1.cmd == Lvl1Cmd.lvlCmd1
360360
conf.topCmd1.lvl1Arg1 == "foo"
361361

362362
test "topLvlCmd2 lvlCmd1":
@@ -367,26 +367,26 @@ suite "test two lvls flatten subcommands":
367367
])
368368
check:
369369
conf.cmd == TopCmd1.topLvlCmd2
370-
conf.topCmd2.cmd == LvlCmd1.lvlCmd1
370+
conf.topCmd2.cmd == Lvl1Cmd.lvlCmd1
371371
conf.topCmd2.lvl1Arg1 == "foo"
372372

373373
type
374-
LvlCmd2 = enum
374+
Lvl2Cmd = enum
375375
lvlCmd2
376376

377377
suite "test nested flatten subcommands":
378378
type
379379
TopSubCmdConf2 = object
380-
case cmd {.command.}: LvlCmd2
381-
of LvlCmd2.lvlCmd2:
380+
case cmd {.command.}: Lvl2Cmd
381+
of Lvl2Cmd.lvlCmd2:
382382
lvl2Arg1 {.
383383
defaultValue: "lvl2Arg1 default"
384384
desc: "lvl2Arg1 desc"
385385
name: "lvl2-arg1" }: string
386386

387387
TopSubCmdConf = object
388-
case cmd {.command.}: LvlCmd1
389-
of LvlCmd1.lvlCmd1:
388+
case cmd {.command.}: Lvl1Cmd
389+
of Lvl1Cmd.lvlCmd1:
390390
lvl1Arg1 {.
391391
defaultValue: "lvl1Arg1 default"
392392
desc: "lvl1Arg1 desc"
@@ -411,7 +411,7 @@ suite "test nested flatten subcommands":
411411
])
412412
check:
413413
conf.cmd == TopCmd1.topLvlCmd1
414-
conf.topCmd1.cmd == LvlCmd1.lvlCmd1
415-
conf.topCmd1.topCmd2.cmd == LvlCmd2.lvlCmd2
414+
conf.topCmd1.cmd == Lvl1Cmd.lvlCmd1
415+
conf.topCmd1.topCmd2.cmd == Lvl2Cmd.lvlCmd2
416416
conf.topCmd1.lvl1Arg1 == "foo"
417417
conf.topCmd1.topCmd2.lvl2Arg1 == "bar"

0 commit comments

Comments
 (0)