@@ -80,7 +80,7 @@ func TestParse(t *testing.T) {
8080 }
8181}
8282
83- func TestReify (t * testing.T ) {
83+ func TestReifyImmutable (t * testing.T ) {
8484 tr , err := Parse ("/some/type<some id>\t \" foo\" @[]\t \" bar\" @[]" , literal .DefaultBuilder ())
8585 if err != nil {
8686 t .Fatalf ("triple.Parse failed to parse valid triple with error %v" , err )
@@ -100,6 +100,26 @@ func TestReify(t *testing.T) {
100100 }
101101}
102102
103+ func TestReifyTemporal (t * testing.T ) {
104+ tr , err := Parse ("/some/type<some id>\t \" foo\" @[2015-01-01T00:00:00-09:00]\t \" bar\" @[]" , literal .DefaultBuilder ())
105+ if err != nil {
106+ t .Fatalf ("triple.Parse failed to parse valid triple with error %v" , err )
107+ }
108+ rts , bn , err := tr .Reify ()
109+ if err != nil {
110+ t .Errorf ("triple.Reify failed to reify %v with error %v" , tr , err )
111+ }
112+ if len (rts ) != 4 || bn == nil {
113+ t .Errorf ("triple.Reify failed to create 4 valid triples and a valid blank node; returned %v, %s instead" , rts , bn )
114+ }
115+ for _ , trpl := range rts [1 :] {
116+ ps := string (trpl .Predicate ().ID ())
117+ if ps != "_subject" && ps != "_predicate" && ps != "_object" {
118+ t .Errorf ("Inalid reification predicate; found %q" , ps )
119+ }
120+ }
121+ }
122+
103123func TestGUID (t * testing.T ) {
104124 testTable := []struct {
105125 t1 string
0 commit comments