mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-24 08:36:43 +03:00
db55986980
- Support for ingest cache, download cache, and progress bars.
30 lines
496 B
Go
30 lines
496 B
Go
package cli_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/neilotoole/sq/cli"
|
|
"github.com/neilotoole/sq/testh/tu"
|
|
)
|
|
|
|
func TestLastHandlePart(t *testing.T) {
|
|
testCases := []struct {
|
|
in string
|
|
want string
|
|
}{
|
|
{"@handle", "handle"},
|
|
{"@prod/db", "db"},
|
|
{"@prod/sub/db", "db"},
|
|
}
|
|
|
|
for i, tc := range testCases {
|
|
tc := tc
|
|
t.Run(tu.Name(i, tc.in), func(t *testing.T) {
|
|
got := cli.LastHandlePart(tc.in)
|
|
require.Equal(t, tc.want, got)
|
|
})
|
|
}
|
|
}
|