https://github.com/google/cayley
Raw File
Tip revision: f1722c836ac4460dfe48127131499447d3f4aaf2 authored by Gaurav Tiwari on 05 January 2018, 12:43:50 UTC
Move to new line for readability
Tip revision: f1722c8
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