refresh neither leaks wraps, allows 2 of the same at once, nor closes raws

This commit is contained in:
bel
2023-03-25 10:50:39 -06:00
parent 97cc3ae151
commit ae1e32391c
18 changed files with 94 additions and 64 deletions

View File

@@ -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())