mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 19:06:33 +02:00
- import path comments are obsoleted by the go.mod file's module statement Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
26 lines
487 B
Go
26 lines
487 B
Go
package mock
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
func TestMockEncoder(t *testing.T) {
|
|
e := errors.New("err")
|
|
mc := Encoder{
|
|
MarshalResponse: []byte("MarshalResponse"),
|
|
MarshalError: e,
|
|
UnmarshalError: e,
|
|
}
|
|
s, err := mc.Marshal("test")
|
|
if err != e {
|
|
t.Error("unexpected Marshal error")
|
|
}
|
|
if string(s) != "MarshalResponse" {
|
|
t.Error("unexpected MarshalResponse error")
|
|
}
|
|
err = mc.Unmarshal([]byte("s"), "s")
|
|
if err != e {
|
|
t.Error("unexpected Unmarshal error")
|
|
}
|
|
}
|