1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-12-16 21:52:42 +02:00
crud_generator/internal/create_files/protobuf/protobuf_test.go
2024-02-12 15:25:44 +03:00

16 lines
275 B
Go

package protobuf
import "testing"
func TestFindLastGoodPos(t *testing.T) {
s := "123456\n789"
pos1 := FindLastGoodPos(s, "5")
if pos1 < 0 {
t.Error("FindLastGoodPos() error: ", pos1)
}
s2 := s[pos1:]
if s2 != "789" {
t.Error("FindLastGoodPos() error: ", s2)
}
}