-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
529 changed files
with
8,081 additions
and
2,577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
.PHONY: test fmt | ||
.PHONY: test fmt report download | ||
|
||
# Runs the tests. | ||
test: | ||
go test -v -cover ./... | ||
|
||
# Formats the code and runs the linter. | ||
fmt: | ||
go mod tidy | ||
gofmt -s -w . | ||
goarrange run -r . | ||
golangci-lint run ./... | ||
|
||
# Generates a test report for the W3C test suite. | ||
report: | ||
TEST_SUITE_REPORT=true go test ./... | ||
|
||
# Downloads the latest test suite from the W3C website. | ||
download: | ||
rm ntriples/testdata/suite/* && curl -s -L https://www.w3.org/2013/N-TriplesTests/TESTS.tar.gz | tar xvz - -C ntriples/testdata/suite | ||
rm nquads/testdata/suite/* && curl -s -L https://www.w3.org/2013/N-QuadsTests/TESTS.tar.gz | tar xvz - -C nquads/testdata/suite | ||
rm turtle/testdata/suite/* && curl -s -L https://www.w3.org/2013/TurtleTests/TESTS.tar.gz | tar xvz - -C turtle/testdata/suite | ||
mv turtle/testdata/suite/TurtleTests/* turtle/testdata/suite && rmdir turtle/testdata/suite/TurtleTests # move files up one level | ||
rm trig/testdata/suite/* && curl -s -L https://www.w3.org/2013/TrigTests/TESTS.tar.gz | tar xvz - -C trig/testdata/suite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,24 +3,24 @@ package project | |
import ( | ||
"fmt" | ||
"github.com/0x51-dev/rdf/internal/testsuite" | ||
"github.com/0x51-dev/rdf/turtle" | ||
ttl "github.com/0x51-dev/rdf/turtle" | ||
"time" | ||
) | ||
|
||
var ( | ||
assertedBy = turtle.IRI{Value: "https://github.com/q-uint"} | ||
subject = turtle.IRI{Value: "https://github.com/0x51-dev/rdf"} | ||
assertedBy = ttl.IRI{Value: "https://github.com/q-uint"} | ||
subject = ttl.IRI{Value: "https://github.com/0x51-dev/rdf"} | ||
) | ||
|
||
type Report struct { | ||
test turtle.IRI | ||
test ttl.IRI | ||
r *testsuite.Report | ||
} | ||
|
||
func NewReport(test turtle.IRI) *Report { | ||
func NewReport(test ttl.IRI) *Report { | ||
r := testsuite.NewReport() | ||
r.Project = testsuite.Project{ | ||
IRI: turtle.IRI{Value: "https://github.com/0x51-dev/rdf"}, | ||
IRI: ttl.IRI{Value: "https://github.com/0x51-dev/rdf"}, | ||
Name: "RDF", | ||
Homepage: "https://github.com/0x51-dev/rdf", | ||
License: "https://www.apache.org/licenses/LICENSE-2.0", | ||
|
@@ -31,10 +31,11 @@ func NewReport(test turtle.IRI) *Report { | |
"https://www.w3.org/TR/n-triples/", | ||
"https://www.w3.org/TR/n-quads/", | ||
"https://www.w3.org/TR/turtle/", | ||
"https://www.w3.org/TR/trig/", | ||
}, | ||
Developer: []testsuite.Developer{ | ||
{ | ||
IRI: turtle.IRI{Value: "https://github.com/q-uint"}, | ||
IRI: ttl.IRI{Value: "https://github.com/q-uint"}, | ||
Name: "Quint Daenen", | ||
Title: "Implementor", | ||
MBox: "mailto:[email protected]", | ||
|
@@ -46,12 +47,12 @@ func NewReport(test turtle.IRI) *Report { | |
} | ||
|
||
func (r *Report) AddTest(name string, outcome testsuite.OutcomeValue) { | ||
test := turtle.IRI{Prefixed: r.test.Prefixed, Value: fmt.Sprintf("%s%s", r.test.Value, name)} | ||
test := ttl.IRI{Prefixed: r.test.Prefixed, Value: fmt.Sprintf("%s%s", r.test.Value, name)} | ||
r.r.AddTestCase(testsuite.TestCase{ | ||
AssertedBy: assertedBy, | ||
Mode: testsuite.Automatic, | ||
Result: testsuite.TestResult{ | ||
Date: turtle.StringLiteral{ | ||
Date: ttl.StringLiteral{ | ||
Value: time.Now().In(time.UTC).Format("2006-01-02-0700"), | ||
DatatypeIRI: "xsd:date", | ||
}, | ||
|
@@ -62,6 +63,10 @@ func (r *Report) AddTest(name string, outcome testsuite.OutcomeValue) { | |
}) | ||
} | ||
|
||
func (r *Report) Len() int { | ||
return r.r.Len() | ||
} | ||
|
||
func (r *Report) String() string { | ||
return r.r.String() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.