-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathregex_test.go
40 lines (34 loc) · 926 Bytes
/
regex_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package gojsonld
import (
"testing"
)
func TestRegexStatement01(t *testing.T) {
matches := STATEMENT.MatchString("_:alice <http://xmlns.com/foaf/0.1/knows> _:bob <http://example.org/graphs/john> .")
if !matches {
t.Error("Input does not match regex")
}
}
func TestRegexStatement02(t *testing.T) {
matches := STATEMENT.MatchString("_:alice <http://xmlns.com/foaf/0.1/knows> _:bob .")
if !matches {
t.Error("Input does not match regex")
}
}
func TestRegexStatement03(t *testing.T) {
matches := STATEMENT.MatchString("_:alice <http://example.org/graphs/john> .")
if matches {
t.Error("Input matches regex")
}
}
func TestRegexIRI01(t *testing.T) {
matches := IRIREF.MatchString("<http://google.com/>")
if !matches {
t.Error("Input does not match regex")
}
}
func TestRegexIRI02(t *testing.T) {
matches := IRIREF.MatchString("<http://\"google.com/>")
if matches {
t.Error("Input matches regex")
}
}