github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/lang/process/background_test.go (about) 1 package process_test 2 3 import ( 4 "testing" 5 6 "github.com/lmorg/murex/lang/process" 7 "github.com/lmorg/murex/test/count" 8 ) 9 10 func TestBackground(t *testing.T) { 11 count.Tests(t, 6) 12 13 bg := new(process.Background) 14 15 bg.Set(false) 16 if bg.Get() { 17 t.Errorf("Set and/or Get failed. Returned true but expected false") 18 } 19 if bg.String() != "no" { 20 t.Errorf("String() didn't return 'no'") 21 } 22 23 bg.Set(true) 24 if !bg.Get() { 25 t.Errorf("Set and/or Get failed. Returned false but expected true") 26 } 27 if bg.String() != "yes" { 28 t.Errorf("String() didn't return 'yes'") 29 } 30 }