Пример #1
0
func TestIsMatching_Name_Exact(t *testing.T) {
	exactMatch, _ := createFilters("foo", "")

	fooThread := tdformat.Thread{}
	fooThread.Name = "foo"
	barThread := tdformat.Thread{}
	barThread.Name = "bar"

	assert.True(t, isMatching(&fooThread, &exactMatch))
	assert.False(t, isMatching(&barThread, &exactMatch))
}
Пример #2
0
func TestIsMatching_Stacktrace(t *testing.T) {
	methodMatchingFilter, _ := createFilters("", "myMethod")
	nonmatchingFilter, _ := createFilters("", "foo")
	fooThread := tdformat.Thread{}
	fooThread.Stacktrace = []tdformat.CodeLine{
		tdformat.CodeLine{"myMethod", "someFile", 1337, false},
	}

	assert.True(t, isMatching(&fooThread, &methodMatchingFilter))
	assert.False(t, isMatching(&fooThread, &nonmatchingFilter))
}