From 747f015f48e1c063fae68b6041bf39cd83bea2b8 Mon Sep 17 00:00:00 2001 From: Barak Amar Date: Mon, 7 Apr 2025 22:38:28 +0300 Subject: [PATCH] test pr number 0 --- pkg/cmd/pr/shared/finder_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/cmd/pr/shared/finder_test.go b/pkg/cmd/pr/shared/finder_test.go index 36551ab42..25a948416 100644 --- a/pkg/cmd/pr/shared/finder_test.go +++ b/pkg/cmd/pr/shared/finder_test.go @@ -89,6 +89,19 @@ func TestFind(t *testing.T) { wantPR: 13, wantRepo: "https://github.com/ORIGINOWNER/REPO", }, + { + name: "PR number 0 is invalid", + args: args{ + selector: "0", + fields: []string{"id", "number"}, + baseRepoFn: stubBaseRepoFn(ghrepo.New("ORIGINOWNER", "REPO"), nil), + branchFn: func() (string, error) { + return "blueberries", nil + }, + branchConfig: stubBranchConfig(git.BranchConfig{}, nil), + }, + wantErr: true, + }, { name: "number argument with base branch", args: args{