blob: 9467302a349ee20ebb1502ef28354c15929d7839 [file] [log] [blame]
// Copyright 2019 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package caller
import "testing"
func TestGet(t *testing.T) {
const exp = "chromiumos/tast/caller.TestGet"
if name := Get(1); name != exp {
t.Errorf("Get(1) = %q; want %q", name, exp)
}
}
func TestGetSkip(t *testing.T) {
const exp = "chromiumos/tast/caller.TestGetSkip"
func() {
if name := Get(2); name != exp {
t.Errorf("Get(2) = %q; want %q", name, exp)
}
}()
}
func TestCheckPass(t *testing.T) {
Check(1, []string{"chromiumos/tast/caller"})
}
func TestCheckPanic(t *testing.T) {
defer func() {
if recover() == nil {
t.Error("Check(1) did not panic")
}
}()
Check(1, []string{"chromiumos/tast/foobar"})
}