From f37ec13c757fce0e3cc3db308e95fd695b9b396f Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Tue, 22 Oct 2024 16:31:29 +0300 Subject: [PATCH] polish code --- menutraversal_test/menu_traversal_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/menutraversal_test/menu_traversal_test.go b/menutraversal_test/menu_traversal_test.go index 8d028c9..2b2a093 100644 --- a/menutraversal_test/menu_traversal_test.go +++ b/menutraversal_test/menu_traversal_test.go @@ -48,7 +48,7 @@ func extractBalance(response []byte) string { // Regex to match "Balance: " followed by a newline re := regexp.MustCompile(`(?m)^Balance:\s+(\d+(\.\d+)?)\s+([A-Z]+)`) match := re.FindSubmatch(response) - if match != nil && len(match) > 0 { + if match != nil { return string(match[1]) + " " + string(match[3]) // " " } return "" @@ -59,7 +59,7 @@ func extractMaxAmount(response []byte) string { // Regex to match "Maximum amount: " followed by a newline re := regexp.MustCompile(`(?m)^Maximum amount:\s+(\d+(\.\d+)?)\s+([A-Z]+)`) match := re.FindSubmatch(response) - if match != nil && len(match) > 0 { + if match != nil { return string(match[1]) + " " + string(match[3]) // " " } return "" @@ -324,7 +324,6 @@ func TestMainMenuSend(t *testing.T) { } } - func TestGroups(t *testing.T) { groups, err := driver.LoadTestGroups(groupTestFile) if err != nil {