This pull request adds unit testing to pkg/marc. It adds five files and one directory to the pkg/marc root directory. Those files and directory are:
field_test.go
filters_test.go
leader_test.go
marcfile_test.go
record_test.go
testdata/, which has copies of the files in the marcli/data directory and adds:
bad, an XML file without an XML extension
test_bad.xml, a MARC binary file with an XML extension
The PR also includes an addition to the .gitignore file, adds https://github.com/google/go-cmp as a dependency for testing, fixes some compiler warnings and typos in the comments, and lightly refactors some of the library files.
Some behavior remains untested, primarily the error handling code.
This pull request adds unit testing to
pkg/marc
. It adds five files and one directory to thepkg/marc
root directory. Those files and directory are:field_test.go
filters_test.go
leader_test.go
marcfile_test.go
record_test.go
testdata/
, which has copies of the files in themarcli/data
directory and adds:bad
, an XML file without an XML extensiontest_bad.xml
, a MARC binary file with an XML extensionThe PR also includes an addition to the
.gitignore
file, adds https://github.com/google/go-cmp as a dependency for testing, fixes some compiler warnings and typos in the comments, and lightly refactors some of the library files.Some behavior remains untested, primarily the error handling code.
Closes #12