mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 05:31:38 +03:00
db55986980
- Support for ingest cache, download cache, and progress bars.
33 lines
567 B
Go
33 lines
567 B
Go
package ast
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestExtractHandles(t *testing.T) {
|
|
testCases := []struct {
|
|
input string
|
|
want []string
|
|
}{
|
|
{
|
|
input: "@sakila | .actor",
|
|
want: []string{"@sakila"},
|
|
},
|
|
{
|
|
input: "@sakila_pg | .actor | join(@sakila_ms.film_actor, .actor_id)",
|
|
want: []string{"@sakila_ms", "@sakila_pg"},
|
|
},
|
|
}
|
|
|
|
for _, tc := range testCases {
|
|
tc := tc
|
|
t.Run(tc.input, func(t *testing.T) {
|
|
a := mustParse(t, tc.input)
|
|
got := ExtractHandles(a)
|
|
require.Equal(t, tc.want, got)
|
|
})
|
|
}
|
|
}
|