https://github.com/google/cayley
Raw File
Tip revision: b9c2e614185e6a9de14fdc02ca3795f7c8c669dc authored by camazotz on 27 November 2017, 21:15:47 UTC
Elastic mapping conversion error
Tip revision: b9c2e61
voc_test.go
package voc

import "testing"

var casesShortIRI = []struct {
	full  string
	short string
}{
	{full: "http://example.com/name", short: "ex:name"},
}

func TestShortIRI(t *testing.T) {
	RegisterPrefix("ex:", "http://example.com/")
	for _, c := range casesShortIRI {
		if f := FullIRI(c.full); f != c.full {
			t.Fatal("unexpected full iri:", f)
		}
		s := ShortIRI(c.full)
		if s != c.short {
			t.Fatal("unexpected short iri:", s)
		}
		if f := FullIRI(s); f != c.full {
			t.Fatal("unexpected full iri:", f)
		}
	}
}
back to top