refresh neither leaks wraps, allows 2 of the same at once, nor closes raws
This commit is contained in:
@@ -3,6 +3,7 @@ package input_test
|
||||
import (
|
||||
"context"
|
||||
"mayhem-party/src/device/input"
|
||||
"mayhem-party/src/device/input/wrap"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
@@ -30,10 +31,10 @@ func TestNewRemapped(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
os.Setenv("WRAP_REMAP_FILE", remap)
|
||||
wrap.FlagRemapFile = remap
|
||||
os.Setenv("RAW_RANDOM_WEIGHT_FILE", rand)
|
||||
t.Cleanup(func() {
|
||||
os.Unsetenv("WRAP_REMAP_FILE")
|
||||
wrap.FlagRemapFile = ""
|
||||
os.Unsetenv("RAW_RANDOM_WEIGHT_FILE")
|
||||
})
|
||||
|
||||
@@ -50,9 +51,9 @@ func TestNewRemapped(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewBuffered(t *testing.T) {
|
||||
os.Setenv("WRAP_BUFFERED", "true")
|
||||
wrap.FlagBuffered = true
|
||||
t.Cleanup(func() {
|
||||
os.Unsetenv("WRAP_BUFFERED")
|
||||
wrap.FlagBuffered = false
|
||||
})
|
||||
|
||||
r := input.New(context.Background())
|
||||
|
||||
Reference in New Issue
Block a user