mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-10 13:04:03 +03:00
22 lines
417 B
Go
22 lines
417 B
Go
// License: GPLv3 Copyright: 2022, Kovid Goyal, <kovid at kovidgoyal.net>
|
|
|
|
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
var _ = fmt.Print
|
|
|
|
func TestLongestCommon(t *testing.T) {
|
|
p := func(expected string, items ...string) {
|
|
actual := Prefix(items)
|
|
if actual != expected {
|
|
t.Fatalf("Failed with %#v\nExpected: %#v\nActual: %#v", items, expected, actual)
|
|
}
|
|
}
|
|
p("abc", "abc", "abcd")
|
|
p("", "abc", "xy")
|
|
}
|