https://github.com/google/cayley
Raw File
Tip revision: 431ee2850fa29f8f7dfa0de6a03c07237871d504 authored by Denys Smirnov on 03 June 2018, 14:55:18 UTC
graphql: update dependency and test filter with multiple values
Tip revision: 431ee28
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