Closed lidaobing closed 6 years ago
testcase:
func TestDialog_GetWidgetForResponse(t *testing.T) { dialog := NewDialog() dialog.AddButton("A", RESPONSE_ACCEPT) dialog.AddButton("B", RESPONSE_CANCEL) accept := dialog.GetWidgetForResponse(int(RESPONSE_ACCEPT)) cancel := dialog.GetWidgetForResponse(int(RESPONSE_CANCEL)) assert.Equal(t, newButtonInternal(accept.GWidget).GetLabel(), "A") assert.Equal(t, newButtonInternal(cancel.GWidget).GetLabel(), "B") }
result:
=== RUN TestDialog_GetWidgetForResponse --- FAIL: TestDialog_GetWidgetForResponse (0.00s) Error Trace: gtk_test.go:78 Error: Not equal: expected: "B" actual: "A" FAIL
testcase:
result: