From aed8ac092ddcccc4ce154eacefaf4307d3bad31a Mon Sep 17 00:00:00 2001 From: badcw Date: Sat, 15 Jan 2022 00:35:58 +0800 Subject: [PATCH] test: add unit test for nil flagset in Context --- context_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/context_test.go b/context_test.go index b37876c033..84757063eb 100644 --- a/context_test.go +++ b/context_test.go @@ -112,6 +112,8 @@ func TestContext_String(t *testing.T) { c := NewContext(nil, set, parentCtx) expect(t, c.String("myflag"), "hello world") expect(t, c.String("top-flag"), "hai veld") + c = NewContext(nil, nil, parentCtx) + expect(t, c.String("top-flag"), "hai veld") } func TestContext_Path(t *testing.T) {