Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
heppu committed Mar 28, 2020
1 parent e2466d0 commit 15a734d
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME = embdr
MAIN = cmd/${NAME}/main.go
SOURCES = $(wildcard *.go) ${MAIN}
SOURCES = $(wildcard *.go) $(wildcard cmd/emdbr/*.go)
COVERAGE = target/coverage.txt
LINT_REPORT = target/lint.txt
BINARY = target/${NAME}
6 changes: 3 additions & 3 deletions template_test.go
Original file line number Diff line number Diff line change
@@ -16,20 +16,20 @@ func TestTemplate(t *testing.T) {
expected, err := ioutil.ReadFile(filename)
noErrorf(t, err, "failed to read %s", filename)

got, err := embdr.LoadTemplate(filename)
got, err := embdr.Load(filename)
noErrorf(t, err, "failed get template for %s", filename)

isTruef(t, string(expected) == got, "content of file %s doesn't match stored data", filename)
}

func TestTemplateNotFound(t *testing.T) {
_, err := embdr.LoadTemplate("foo")
_, err := embdr.Load("foo")
isTruef(t, err == embdr.ErrTemplateDoesNotExist, "expected 'embdr.ErrTemplateDoesNotExist' error, got '%s'", err)
}

func ExampleTemplate() {
const name = "template.tmpl"
tmpl, err := embdr.LoadTemplate(name)
tmpl, err := embdr.Load(name)
if err != nil {
log.Fatalf("Couldn't get template with name: %s", err)
}

0 comments on commit 15a734d

Please sign in to comment.