mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
9f85b74fc9
Former-commit-id: da4f38eb9034daa49446df3ee529423b98f9b331
27 lines
457 B
Go
27 lines
457 B
Go
// black-box testing
|
|
package errors_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/kataras/iris/core/errors"
|
|
)
|
|
|
|
func TestReporterAdd(t *testing.T) {
|
|
errors.Prefix = ""
|
|
|
|
r := errors.NewReporter()
|
|
|
|
tests := []string{"err1", "err3", "err4\nerr5"}
|
|
for _, tt := range tests {
|
|
r.Add(tt)
|
|
}
|
|
|
|
for i, e := range r.Stack() {
|
|
tt := tests[i]
|
|
if expected, got := tt, e.Error(); expected != got {
|
|
t.Fatalf("[%d] expected %s but got %s", i, expected, got)
|
|
}
|
|
}
|
|
}
|