From 3417c3d5bff2a4a33355aeca8a9aeae9f0bf38a2 Mon Sep 17 00:00:00 2001 From: Hariom Verma Date: Sat, 4 Nov 2023 19:28:14 +0530 Subject: [PATCH] Add tests --- gnovm/cmd/gno/bug.go | 3 ++- gnovm/cmd/gno/bug_test.go | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gnovm/cmd/gno/bug.go b/gnovm/cmd/gno/bug.go index 937deaa3ae6..99a6d20fd1a 100644 --- a/gnovm/cmd/gno/bug.go +++ b/gnovm/cmd/gno/bug.go @@ -43,7 +43,8 @@ func execBug(args []string, io *commands.IO) error { url := "https://github.com/gnolang/gno/issues/new?body=" + url.QueryEscape(body) if !openBrowser(url) { - io.Println("Please file a new issue at github.com/gnolang/gno/issues/new using this template:\n") + io.Println("Please file a new issue at github.com/gnolang/gno/issues/new using this template:") + io.Println() io.Println(body) } diff --git a/gnovm/cmd/gno/bug_test.go b/gnovm/cmd/gno/bug_test.go index 3e7df71c23f..76546fed758 100644 --- a/gnovm/cmd/gno/bug_test.go +++ b/gnovm/cmd/gno/bug_test.go @@ -2,6 +2,16 @@ package main import "testing" -func TestBug(t *testing.T) { - +func TestBugApp(t *testing.T) { + tc := []testMainCase{ + { + args: []string{"bug -h"}, + errShouldBe: "flag: help requested", + }, + { + args: []string{"bug unknown"}, + errShouldBe: "flag: help requested", + }, + } + testMainCaseRun(t, tc) }