// TestParseClassDeclWithFullIRI tests IRIs with full notation. Not prefixes.
TestParseClassDeclWithFullIRI tests IRIs with full notation. Not prefixes.
// TestParseClassDeclWithFullIRI tests IRIs with full notation . Not prefixes .
func TestParseClassDeclWithFullIRI(t *testing.T) {
	var p *parser.Parser
	var err error
	var expr meta.ClassExpression
	decls, prefixes := mock.NewBuilder().AddPrefixes("abc").
		AddClassDecl(*tech.MustNewFragmentedIRI("longname-for-abc#", "CheeseTopping")).
		AddClassDecl(tech.IRI{Fragment: "", Head: `http://www.example.org/(*§!_)someWildÜRI/`}).
		Get()
	p = mock.NewTestParser(`<longname-for-abc#CheeseTopping>`)
	expr, err = ParseClassExpression(p, decls, prefixes)
	if err != nil {
		t.Fatal(err)
	}
	var x *decl.ClassDecl
	var ok bool
	if x, ok = expr.(*decl.ClassDecl); !ok {
		t.Fatal(x)
	}
	if x.IRI != `longname-for-abc#CheeseTopping` {
		t.Fatal(x.IRI)
	}
	p = mock.NewTestParser(`<http://www.w3.org/2002/07/owl#Nothing>`)
	expr, err = ParseClassExpression(p, decls, prefixes)
	if err != nil {
		t.Fatal(err)
	}
	if _, ok := expr.(*classexpression.OWLNothing); !ok {
		t.Fatal(expr)
	}
	p = mock.NewTestParser(`<http://www.example.org/(*§!_)someWildÜRI/>`)
	expr, err = ParseClassExpression(p, decls, prefixes)
	if err != nil {
		t.Fatal(err)
	}
	if _, ok := expr.(*decl.ClassDecl); !ok {
		t.Fatal(expr)
	}
}
func TestParseClassDeclWithFullIRI ( t * testing . T ) { var p * parser . Parser var err error var expr meta . ClassExpression decls , prefixes := mock . NewBuilder ( ) . AddPrefixes ( " " ) . AddClassDecl ( * tech . MustNewFragmentedIRI ( " " , " " ) ) . AddClassDecl ( tech . IRI { Fragment : " " , Head : `http://www.example.org/(*§!_)someWildÜRI/`}) . Get ( ) p = mock . NewTestParser ( `<longname-for-abc#CheeseTopping>` ) expr , err = ParseClassExpression ( p , decls , prefixes ) if err != nil { t . Fatal ( err ) } var x * decl . ClassDecl var ok bool if x , ok = expr . ( * decl . ClassDecl ) ; ! ok { t . Fatal ( x ) } if x . IRI != `longname-for-abc#CheeseTopping` { t . Fatal ( x . IRI ) } p = mock . NewTestParser ( `<http://www.w3.org/2002/07/owl#Nothing>` ) expr , err = ParseClassExpression ( p , decls , prefixes ) if err != nil { t . Fatal ( err ) } if _ , ok := expr . ( * classexpression . OWLNothing ) ; ! ok { t . Fatal ( expr ) } p = mock . NewTestParser ( `<http://www.example.org/(*§!_)someWildÜRI/>`) expr , err = ParseClassExpression ( p , decls , prefixes ) if err != nil { t . Fatal ( err ) } if _ , ok := expr . ( * decl . ClassDecl ) ; ! ok { t . Fatal ( expr ) } }
TestParseClassDeclWithFullIRI tests IRIs with full notation.
TestParseClassDeclWithFullIRI tests IRIs with full notation .
// parse a predeclared named class