mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-30 05:25:35 +00:00
12f8c98823
Updates #8296 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
25 lines
557 B
Go
25 lines
557 B
Go
// Copyright (c) Tailscale Inc & AUTHORS
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
package cmpx
|
|
|
|
import "testing"
|
|
|
|
func TestOr(t *testing.T) {
|
|
if g, w := Or[string](), ""; g != w {
|
|
t.Errorf("got %v; want %v", g, w)
|
|
}
|
|
if g, w := Or[int](), 0; g != w {
|
|
t.Errorf("got %v; want %v", g, w)
|
|
}
|
|
if g, w := Or("", "foo", "bar"), "foo"; g != w {
|
|
t.Errorf("got %v; want %v", g, w)
|
|
}
|
|
if g, w := Or("foo", "bar"), "foo"; g != w {
|
|
t.Errorf("got %v; want %v", g, w)
|
|
}
|
|
if g, w := Or("", "", "bar"), "bar"; g != w {
|
|
t.Errorf("got %v; want %v", g, w)
|
|
}
|
|
}
|