File: testing_test.go

package info (click to toggle)
golang-github-anacrolix-missinggo 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 836 kB
  • sloc: makefile: 4
file content (22 lines) | stat: -rw-r--r-- 537 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package missinggo

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

// Since GetTestName panics if the test name isn't found, it'll be easy to
// expand the tests if we find weird cases.
func TestGetTestName(t *testing.T) {
	assert.EqualValues(t, "TestGetTestName", GetTestName())
}

func TestGetSubtestName(t *testing.T) {
	t.Run("hello", func(t *testing.T) {
		assert.Contains(t, "TestGetSubtestName", GetTestName())
	})
	t.Run("world", func(t *testing.T) {
		assert.Contains(t, "TestGetSubtestName", GetTestName())
	})
}