Skip to content

Commit

Permalink
feat(*): added basic e2e tests and updated godoc (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickersoft authored Jan 4, 2021
1 parent 1d354b2 commit 80ca45c
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 133 deletions.
52 changes: 25 additions & 27 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,34 @@ name: Go

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:

build:
name: Build
name: Build & Test
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v .

- name: Test
run: go test -v .
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v .

- name: Test
run: go test -v .
46 changes: 0 additions & 46 deletions examples/example.xml

This file was deleted.

20 changes: 10 additions & 10 deletions test.xml → examples/example1.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<dictionary id="68b4ab76-afaa-44aa-b48c-6b0f7e8efc80" name="Example Dictionary 1">
<dictionary name="Example Dictionary 1">
<entry term="run">
<ety id="0">
<usage pos="verb">
<group id="" description="A number of verb usages">
<ety description="Latin root">
<usage pos="v">
<group description="A number of verb usages">
<definition>(vertebrates) To move swiftly.</definition>
<definition>(fluids) To flow.</definition>
<definition>(nautical, of a vessel) To sail before the wind, in distinction from reaching or sailing close-hauled.</definition>
Expand All @@ -11,7 +11,7 @@
<definition>(transitive) To execute or carry out a plan, procedure or program.</definition>
</group>
</usage>
<usage pos="noun">
<usage pos="n">
<definition>Act or instance of running, of moving rapidly using the feet.</definition>
<definition>Act or instance of hurrying (to or from a place) (not necessarily by foot); dash or errand, trip.</definition>
<definition>A pleasure trip.</definition>
Expand All @@ -22,9 +22,9 @@
</ety>
</entry>
<entry term="跑步">
<ety id="0">
<usage pos="verb">
<group id="" description="A number of verb usages">
<ety description="Latin root">
<usage pos="v">
<group description="A number of verb usages">
<definition>(vertebrates) To move swiftly.</definition>
<definition>(fluids) To flow.</definition>
<definition>(nautical, of a vessel) To sail before the wind, in distinction from reaching or sailing close-hauled.</definition>
Expand All @@ -33,7 +33,7 @@
<definition>(transitive) To execute or carry out a plan, procedure or program.</definition>
</group>
</usage>
<usage pos="noun">
<usage pos="n">
<definition>Act or instance of running, of moving rapidly using the feet.</definition>
<definition>Act or instance of hurrying (to or from a place) (not necessarily by foot); dash or errand, trip.</definition>
<definition>A pleasure trip.</definition>
Expand All @@ -43,4 +43,4 @@
</usage>
</ety>
</entry>
</dictionary>
</dictionary>
15 changes: 3 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
module github.com/odict/odict

go 1.13
go 1.15

require (
github.com/RoaringBitmap/roaring v0.4.21 // indirect
github.com/blevesearch/bleve v0.8.1
github.com/blevesearch/go-porterstemmer v1.0.2 // indirect
github.com/blevesearch/segment v0.0.0-20160915185041-762005e7a34f // indirect
github.com/couchbase/vellum v0.0.0-20190829182332-ef2e028c01fd // indirect
github.com/etcd-io/bbolt v1.3.3 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/blevesearch/bleve v1.0.14
github.com/golang/snappy v0.0.1
github.com/google/flatbuffers v1.11.0
github.com/google/uuid v1.1.1
github.com/imdario/mergo v0.3.9
github.com/mitchellh/mapstructure v1.3.2
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect
github.com/urfave/cli v1.22.4 // indirect
github.com/stretchr/testify v1.6.1
github.com/urfave/cli/v2 v2.1.1
github.com/wolfeidau/unflatten v1.1.0
)
Loading

0 comments on commit 80ca45c

Please sign in to comment.