Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 793 Bytes

README.md

File metadata and controls

37 lines (25 loc) · 793 Bytes

Assert

Go

🍯 Requirement Go 1.18+ for Generics, lower Go version please use 0.x

Extends stretchr/testify/assert for add more useful methods.

  • assert.Equal - asserts values equal, but ignore type.
  • assert.EqualHTML - asserts HTML equal, ignore spaces.

Installation

go get github.com/longbridge/assert

Usage

package some_test

import (
  "github.com/longbridge/assert"
)

func TestSomeMethod(t *testing.T) {
	assert.EqualHTML(t, "<p>Hello world</p><p>This is next line</p>", `
		<p>Hello world</p>
		<p>This is next line</p>
	`)
}

License

MIT