mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-27 14:47:50 -03:00
Merge commit 'f955c625aded244864e83a872b396868a490dbc5' as 'go-enry'
This commit is contained in:
27
go-enry/regex/standard_test.go
Normal file
27
go-enry/regex/standard_test.go
Normal file
@ -0,0 +1,27 @@
|
||||
//go:build !oniguruma
|
||||
// +build !oniguruma
|
||||
|
||||
package regex
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMustCompileMultiline(t *testing.T) {
|
||||
const re = `^\.(.*)!$`
|
||||
want := MustCompileMultiline(re)
|
||||
assert.Equal(t, "(?m)"+re, want.String())
|
||||
|
||||
const s = `.one
|
||||
.two!
|
||||
thre!`
|
||||
if !want.MatchString(s) {
|
||||
t.Fatalf("MustCompileMultiline(`%s`) must match multiline %q\n", re, s)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMustCompileRuby(t *testing.T) {
|
||||
assert.Nil(t, MustCompileRuby(``))
|
||||
}
|
Reference in New Issue
Block a user