mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-04-06 22:47:38 +03:00
Query filters
This commit is contained in:
parent
85b4abde6c
commit
9315829bc4
7 changed files with 167 additions and 37 deletions
|
@ -56,6 +56,19 @@ func TestInStringList(t *testing.T) {
|
|||
require.False(t, InStringList(s, "three"))
|
||||
}
|
||||
|
||||
func TestInStringListAll(t *testing.T) {
|
||||
s := []string{"one", "two", "three", "four"}
|
||||
require.True(t, InStringListAll(s, []string{"two", "four"}))
|
||||
require.False(t, InStringListAll(s, []string{"three", "five"}))
|
||||
}
|
||||
|
||||
func TestSplitNoEmpty(t *testing.T) {
|
||||
require.Equal(t, []string{}, SplitNoEmpty("", ","))
|
||||
require.Equal(t, []string{}, SplitNoEmpty(",,,", ","))
|
||||
require.Equal(t, []string{"tag1", "tag2"}, SplitNoEmpty("tag1,tag2", ","))
|
||||
require.Equal(t, []string{"tag1", "tag2"}, SplitNoEmpty("tag1,tag2,", ","))
|
||||
}
|
||||
|
||||
func TestExpandHome_WithTilde(t *testing.T) {
|
||||
require.Equal(t, os.Getenv("HOME")+"/this/is/a/path", ExpandHome("~/this/is/a/path"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue