mirror of
https://github.com/1f349/tulip.git
synced 2024-11-13 23:31:37 +00:00
27 lines
759 B
Go
27 lines
759 B
Go
|
package scope
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestFancyScopeList(t *testing.T) {
|
||
|
desc := scopeDescription
|
||
|
scopeDescription = map[string]string{
|
||
|
"a": "A",
|
||
|
"b": "B",
|
||
|
"c": "C",
|
||
|
}
|
||
|
|
||
|
assert.Equal(t, []string{"A"}, FancyScopeList("a"))
|
||
|
assert.Equal(t, []string{"A", "B"}, FancyScopeList("a b"))
|
||
|
assert.Equal(t, []string{"A", "B", "C"}, FancyScopeList("a b c"))
|
||
|
assert.Equal(t, []string{"A", "B"}, FancyScopeList("a,b"))
|
||
|
assert.Equal(t, []string{"A", "B", "C"}, FancyScopeList("a,b,c"))
|
||
|
assert.Equal(t, []string{"A", "B", "C"}, FancyScopeList("a b,c"))
|
||
|
assert.Equal(t, []string{"A", "B", "C"}, FancyScopeList("a,b c"))
|
||
|
assert.Equal(t, []string{"A", "B", "C"}, FancyScopeList("a, b, c"))
|
||
|
|
||
|
scopeDescription = desc
|
||
|
}
|