package ncurses import ( "testing" ) func StartTest(t *testing.T) Window { err := Init() if err != nil { t.Fatalf("Init err - %s", err) } window := InitScr.Load()() return window } func EndTest(t *testing.T) { ret := EndWin.Load()() if ret != 0 { t.Fatalf("EndWin result - 0x%x", ret) } } func TestInitScr(t *testing.T) { window := StartTest(t) t.Logf("InitScr result - 0x%x", window) EndTest(t) } func TestNewWin(t *testing.T) { StartTest(t) window := NewWin.Load()(10, 10, 0, 0) t.Logf("NewWin result - 0x%x", window) ret := DelWin.Load()(window) if ret != 0 { t.Fatalf("DelWin result - 0x%x", ret) } EndTest(t) }