mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-25 09:01:29 +02:00
22 lines
431 B
Go
22 lines
431 B
Go
package elevate
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFirstLine(t *testing.T) {
|
|
tests := []struct{ in, want string }{
|
|
{in: "", want: noOutput},
|
|
{in: " \n ", want: noOutput},
|
|
{in: "one line", want: "one line"},
|
|
{in: "first\nsecond", want: "first"},
|
|
{in: "\nsecond\n", want: "second"},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
assert.Equal(t, tt.want, firstLine(tt.in), "input %q", tt.in)
|
|
}
|
|
}
|