Skip to content

Commit

Permalink
Upgrade gomponents to v0.18.0
Browse files Browse the repository at this point in the history
And copy assert package to local scope.
  • Loading branch information
markuswustenberg committed Oct 8, 2021
1 parent 37d5db2 commit 71ff79e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ lint:
golangci-lint run

test:
go test -coverprofile=cover.out ./...
go test -coverprofile=cover.out -shuffle on ./...
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/maragudk/gomponents-heroicons

go 1.15

require github.com/maragudk/gomponents v0.16.0
require github.com/maragudk/gomponents v0.18.0
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/maragudk/gomponents v0.16.0 h1:qoFF52ePoX27b6uvLGfGNcIfN/F6NSg9YCtqoipBXuM=
github.com/maragudk/gomponents v0.16.0/go.mod h1:0OdlqOoqxcwvhBFrp8wlKHnEXhNB7IVhb8GuARmd+tI=
github.com/maragudk/gomponents v0.18.0 h1:EcdeRUWsWW6hK9ftnGAoyXR00SQWecCBxuXghQvdEcc=
github.com/maragudk/gomponents v0.18.0/go.mod h1:0OdlqOoqxcwvhBFrp8wlKHnEXhNB7IVhb8GuARmd+tI=
2 changes: 1 addition & 1 deletion heroicons_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package heroicons_test
import (
"testing"

"github.com/maragudk/gomponents/assert"
. "github.com/maragudk/gomponents/html"
"github.com/maragudk/gomponents/svg"

heroicons "github.com/maragudk/gomponents-heroicons"
"github.com/maragudk/gomponents-heroicons/internal/assert"
)

func TestOutline(t *testing.T) {
Expand Down
20 changes: 20 additions & 0 deletions internal/assert/assert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Package assert provides testing helpers.
package assert

import (
"strings"
"testing"

g "github.com/maragudk/gomponents"
)

// Equal checks for equality between the given expected string and the rendered Node string.
func Equal(t *testing.T, expected string, actual g.Node) {
t.Helper()

var b strings.Builder
_ = actual.Render(&b)
if expected != b.String() {
t.Fatalf(`expected "%v" but got "%v"`, expected, actual)
}
}
2 changes: 1 addition & 1 deletion outline/adjustments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package outline_test
import (
"testing"

"github.com/maragudk/gomponents/assert"
. "github.com/maragudk/gomponents/html"

"github.com/maragudk/gomponents-heroicons/internal/assert"
"github.com/maragudk/gomponents-heroicons/outline"
)

Expand Down
3 changes: 2 additions & 1 deletion solid/adjustments_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"testing"

"github.com/maragudk/gomponents-heroicons/solid"
"github.com/maragudk/gomponents/assert"
. "github.com/maragudk/gomponents/html"

"github.com/maragudk/gomponents-heroicons/internal/assert"
)

func TestAdjustments(t *testing.T) {
Expand Down

0 comments on commit 71ff79e

Please sign in to comment.