-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce first test and test harness
Related to #3
- Loading branch information
Showing
45 changed files
with
16,750 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package tests | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"path/filepath" | ||
"testing" | ||
|
||
"github.com/gocomply/xsd2go/pkg/xsd2go" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestSanity(t *testing.T) { | ||
xsdFiles, err := filepath.Glob("xsd-examples/valid/*.xsd") | ||
assert.Nil(t, err) | ||
assert.NotEmpty(t, xsdFiles) | ||
|
||
for _, xsdPath := range xsdFiles { | ||
assertConvertsFine(t, xsdPath) | ||
} | ||
} | ||
|
||
func assertConvertsFine(t *testing.T, xsdPath string) { | ||
dname, err := ioutil.TempDir("", "xsd2go_tests_") | ||
assert.Nil(t, err) | ||
defer os.RemoveAll(dname) | ||
|
||
outputDir := dname | ||
|
||
goModule := "user.com/private" | ||
|
||
err = xsd2go.Convert(xsdPath, goModule, outputDir) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
xmlns:simple-schema="https://simple.example.com/" | ||
targetNamespace="https://simple.example.com/" | ||
elementFormDefault="qualified"> | ||
<xsd:element name="myelement" type="simple-schema:MyElementType" /> | ||
<xsd:complexType name="MyElementType"> | ||
<xsd:sequence> | ||
<xsd:element name="id" type="xsd:integer" /> | ||
</xsd:sequence> | ||
</xsd:complexType> | ||
</xsd:schema> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
145 changes: 145 additions & 0 deletions
145
vendor/github.com/davecgh/go-spew/spew/bypass.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.