github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/updater/util/strings_test.go (about) 1 // Copyright 2015 Keybase, Inc. All rights reserved. Use of 2 // this source code is governed by the included BSD license. 3 4 package util 5 6 import ( 7 "strings" 8 "testing" 9 ) 10 11 func TestJoinPredicate(t *testing.T) { 12 f := func(s string) bool { return strings.HasPrefix(s, "f") } 13 s := JoinPredicate([]string{"foo", "bar", "faa"}, "-", f) 14 if s != "foo-faa" { 15 t.Errorf("Unexpected output: %s", s) 16 } 17 }