Skip to content

Commit 1101d3c

Browse files
Added a few more unit tests, updated README #172
1 parent 75dc486 commit 1101d3c

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ make
344344

345345
```bash
346346
gofmt -w `find . -name '*.go' | grep -v vendor`
347-
go vet -all $$(go list ./... | grep -v datatypes)
347+
go vet -all $(go list ./... | grep -v datatypes)
348348
go get -d -v ./...
349349
go build ./...
350350

@@ -356,6 +356,13 @@ go build ./...
356356
make test
357357
```
358358

359+
```bash
360+
gofmt -w `find . -name '*.go' | grep -v vendor`
361+
go vet -all $(go list ./... | grep -v datatypes)
362+
go get -d -v -t ./...
363+
go test $(go list ./... | grep -v '/vendor/') -timeout=30s -parallel=4 -coverprofile coverage.out
364+
```
365+
359366
### Updating dependencies
360367

361368
```

tools/loadmeta_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,31 @@ func TestDesnak(t *testing.T) {
6161
t.Errorf("Desnake(SoftLayer_Test_This_Thing) != SoftLayerTestThisThing")
6262
}
6363
}
64+
65+
func TestGoDoc(t *testing.T) {
66+
result := GoDoc("")
67+
expected := "// no documentation yet"
68+
if result != expected {
69+
t.Errorf("TestGoDoc1: %s != %s", expected, result)
70+
}
71+
72+
result = GoDoc("TEST")
73+
expected = "// TEST"
74+
if result != expected {
75+
t.Errorf("TestGoDoc2: %s != %s", expected, result)
76+
77+
}
78+
}
79+
80+
func TestTags(t *testing.T) {
81+
result := Tags("resourceRecords")
82+
expected := "resourceRecords"
83+
if result != expected {
84+
t.Errorf("TestTags1: %s != %s", expected, result)
85+
}
86+
result = Tags("SomethingElse")
87+
expected = "SomethingElse,omitempty"
88+
if result != expected {
89+
t.Errorf("TestTags2: %s != %s", expected, result)
90+
}
91+
}

0 commit comments

Comments
 (0)