https://github.com/google/cayley
Raw File
Tip revision: 1f545a1a9de91c7d3367e90fddf0c0ccd307ad31 authored by Robert Lin on 14 August 2019, 08:10:18 UTC
add wrappers as param to api constructor
Tip revision: 1f545a1
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