https://github.com/google/cayley
Raw File
Tip revision: fd06e88bb05803595482c0e9239cf0ba8d1a31e1 authored by Iddan Aaronsohn on 08 July 2019, 21:54:22 UTC
Recovered unintended changes
Tip revision: fd06e88
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