diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-02 20:45:25 +0100 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2018-02-02 20:45:25 +0100 |
commit | 5871ec04deb8f4715cab37146940baa35c08cbee (patch) | |
tree | 8d643e991a3525c69a317c85cde6708bae2925aa /src/helper_test.go | |
parent | 4f97b52ea60ce4f2448d8617853aa44759727197 (diff) |
Fixed tests
Diffstat (limited to 'src/helper_test.go')
-rw-r--r-- | src/helper_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/helper_test.go b/src/helper_test.go index 8548121..41e6b72 100644 --- a/src/helper_test.go +++ b/src/helper_test.go @@ -28,8 +28,8 @@ func (tun *DummyTUN) MTU() (int, error) { return tun.mtu, nil } -func (tun *DummyTUN) Write(d []byte) (int, error) { - tun.packets <- d +func (tun *DummyTUN) Write(d []byte, offset int) (int, error) { + tun.packets <- d[offset:] return len(d), nil } @@ -41,9 +41,9 @@ func (tun *DummyTUN) Events() chan TUNEvent { return tun.events } -func (tun *DummyTUN) Read(d []byte) (int, error) { +func (tun *DummyTUN) Read(d []byte, offset int) (int, error) { t := <-tun.packets - copy(d, t) + copy(d[offset:], t) return len(t), nil } |