add 'map' cli command to provide map information (#100)
* add 'map' cli command - provides the following map information functions: - list all available maps in the global registry - display map metadata - update docs with map command examples * add list and info subcommands to map cli command * rename map command list and info factory functions * add --all flag to map info subcommand * handle cmd.Help error
This commit is contained in:
parent
91106aec09
commit
ffeb401377
7 changed files with 177 additions and 0 deletions
|
|
@ -112,3 +112,15 @@ func pickSize(meta Metadata) Dimensions {
|
|||
// For fixed, just pick the first supported size
|
||||
return meta.BoardSizes[0]
|
||||
}
|
||||
|
||||
func TestListRegisteredMaps(t *testing.T) {
|
||||
keys := globalRegistry.List()
|
||||
mapCount := 0
|
||||
for k := range globalRegistry {
|
||||
// every registry key should exist in List results
|
||||
require.Contains(t, keys, k)
|
||||
mapCount++
|
||||
}
|
||||
// List should equal number of maps in the global registry
|
||||
require.Equal(t, len(keys), mapCount)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue