File: example_test.go

package info (click to toggle)
golang-github-alecthomas-assert 0.0~git20170929.405dbfe-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 176 kB
  • sloc: makefile: 2
file content (25 lines) | stat: -rw-r--r-- 559 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package example

import (
	"github.com/alecthomas/assert"
	"github.com/stretchr/testify/require"

	"testing"
)

type Person struct {
	Name string
	Age  int
}

func TestDiff(t *testing.T) {
	expected := []*Person{{"Alec", 20}, {"Bob", 21}, {"Sally", 22}}
	actual := []*Person{{"Alex", 20}, {"Bob", 22}, {"Sally", 22}}
	assert.Equal(t, expected, actual)
}

func TestStretchrDiff(t *testing.T) {
	expected := []*Person{{"Alec", 20}, {"Bob", 21}, {"Sally", 22}}
	actual := []*Person{{"Alex", 20}, {"Bob", 22}, {"Sally", 22}}
	require.Equal(t, expected, actual)
}