mirror of
https://github.com/turbot/steampipe.git
synced 2026-01-24 08:01:31 -05:00
- Execute RefreshConnections asyncronously - Add connection_state table to indicate the loading state of connections - Optimise RefreshConnections by cloning connection schemas - Add locking to ensure only a single instance of RefreshConnections runs - Start executing queries without waiting for connections to load, add smart error handling to wait for required connection - Optimise autocomplete for high connection count - Autocomplete and inspect data available before all conections are refreshed - Update file watcher to respond to CHMOD, so thaat it pickes up deletion of file contents Closes #3394 Closes #3267
30 lines
713 B
Go
30 lines
713 B
Go
package metaquery
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
type CmdAndArgsExpected struct {
|
|
cmd string
|
|
args []string
|
|
}
|
|
|
|
func TestGetCmdAndArgs(t *testing.T) {
|
|
cases := map[string]CmdAndArgsExpected{
|
|
`.cmd arg1`: {cmd: ".cmd", args: []string{"arg1"}},
|
|
`.cmd arg1 arg2`: {cmd: ".cmd", args: []string{"arg1", "arg2"}},
|
|
`.cmd "arg1a arg1b" arg2`: {cmd: ".cmd", args: []string{"arg1a arg1b", "arg2"}},
|
|
}
|
|
|
|
for input, expected := range cases {
|
|
actualCmd, actualArgs := getCmdAndArgs(input)
|
|
if actualCmd != expected.cmd {
|
|
t.Errorf("%s != %s", actualCmd, expected.cmd)
|
|
}
|
|
if !reflect.DeepEqual(actualArgs, expected.args) {
|
|
t.Errorf("%v != %v", actualArgs, expected.args)
|
|
}
|
|
}
|
|
}
|