| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Note, we use package util rather than util_test so that we can access the |
| // unexported name util.globPatternToPrefix. |
| errBadArg = string(verror.ErrBadArg.ID) |
| func TestGlobPatternToPrefix(t *testing.T) { |
| {"foo...foo*", errBadArg}, |
| {"foo..foo*", "foo..foo"}, |
| for _, test := range tests { |
| prefix, err := globPatternToPrefix(test.pattern) |
| prefix = string(verror.ErrorID(err)) |
| if prefix != test.prefix { |
| t.Errorf("%q: got %q, want %q", test.pattern, prefix, test.prefix) |