ioc_test.go | |
---|---|
|
|
Documentation in literate-programming-style is available at: https://RedHatInsights.github.io/insights-operator-cli/packages/ioc_test.html |
|
createDocumentWithCommand function constructs an instance of prompt.Document containing the command and cursor position. |
|
try to allocate a buffer |
|
insert command into buffer |
|
and gather instance of new document |
|
checkSuggestionCount function checks the number of suggestions returned by suggester. |
|
test if number of suffestions is expected |
|
checkSuggestionCount function checks the suggestion text and description. |
|
test suggestion text by comparing it with command |
|
test suggestion description |
|
TestCompleterEmptyInput function checks which suggestions are returned for empty input. |
|
test the suggestion(s) for empty input |
|
no suggestions are expected |
|
TestCompleterHelpCommand function checks which suggestions are returned for 'help' input. |
|
test the suggestion(s) for help command |
|
just one suggestion is expected |
|
TestReadConfiguration function tries to read configuration from existing configuration file. |
|
test the suggestion(s) for command for reading configuration file |
|
TestReadConfigurationNegative function tries to read configuration from non-existing configuration file. |
|
test the suggestion(s) for command for reading configuration file |
|
TestPrintVersion function is dummy ATM - we'll check versions etc. in integration tests. |
|
make sure the colorizer is initialized |
|
just print the version w/o any checks |
|