marckhouzam / cobra-completion-testing

A set of completion tests for Cobra
MIT License
4 stars 4 forks source link

fix: make sure expected dirs are present in git checkouts #18

Closed scop closed 2 years ago

scop commented 2 years ago

Empty dirs don't persist, add .gitkeep markers to keep them around.

Without the dirs present, I get these errors for each setup run by make bash:

ERROR: "testprog dir di" should complete to "dir dir2" but we got ""
ERROR: "testprog subdir " should complete to "jsondir txtdir yamldir" but we got ""
ERROR: "testprog subdir j" should complete to "jsondir" but we got ""
ERROR: "testprog --theme " should complete to "jsondir txtdir yamldir" but we got ""
ERROR: "testprog --theme t" should complete to "txtdir" but we got ""
ERROR: "testprog --theme=" should complete to "jsondir txtdir yamldir" but we got ""
ERROR: "testprog --theme=t" should complete to "txtdir" but we got ""
marckhouzam commented 2 years ago

I pushed another dir to the main branch (https://github.com/marckhouzam/cobra-completion-testing/commit/15f98de47a248e95ec47b173aab7b9575695b217). The tests don't report an error for it, so you couldn't know I had it in my local copy. It is useful to make sure it is not suggested by the completion logic.