mirror of
https://github.com/awnumar/memguard.git
synced 2026-02-07 02:09:53 +00:00
20 lines
329 B
Go
20 lines
329 B
Go
|
|
package core
|
||
|
|
|
||
|
|
import "testing"
|
||
|
|
|
||
|
|
func TestError(t *testing.T) {
|
||
|
|
for i := range errors {
|
||
|
|
if errors[i].s != errors[i].Error() {
|
||
|
|
t.Error("error string does not match")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func TestIsXError(t *testing.T) {
|
||
|
|
for i := range errors {
|
||
|
|
if !isXError(errors[i], errors[i].c) {
|
||
|
|
t.Error("error should match itself")
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|