Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiifong committed Jan 11, 2025
1 parent 30713a6 commit a041057
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions modules/git/ref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ func TestRefName(t *testing.T) {
assert.Equal(t, "my/branch", RefName("refs/for/my/branch").ForBranchName())

// Test for review name
assert.Equal(t, false, RefName("refs/for-review/").IsForReview())
assert.Equal(t, false, RefName("refs/for-review/-1").IsForReview())
assert.Equal(t, false, RefName("refs/for-review/0").IsForReview())
assert.Equal(t, false, RefName("refs/for-review/01").IsForReview())
assert.Equal(t, true, RefName("refs/for-review/1").IsForReview())
assert.Equal(t, true, RefName("refs/for-review/10").IsForReview())
assert.Equal(t, true, RefName("refs/for-review/10999").IsForReview())
assert.Equal(t, false, RefName("refs/for-review/a10").IsForReview())
assert.Equal(t, false, RefName("refs/for-review/10a").IsForReview())
assert.Equal(t, false, RefName("refs/for-review/abc").IsForReview())
assert.False(t, RefName("refs/for-review/").IsForReview())
assert.False(t, RefName("refs/for-review/-1").IsForReview())
assert.False(t, RefName("refs/for-review/0").IsForReview())
assert.False(t, RefName("refs/for-review/01").IsForReview())
assert.True(t, RefName("refs/for-review/1").IsForReview())
assert.True(t, RefName("refs/for-review/10").IsForReview())
assert.True(t, RefName("refs/for-review/10999").IsForReview())
assert.False(t, RefName("refs/for-review/a10").IsForReview())
assert.False(t, RefName("refs/for-review/10a").IsForReview())
assert.False(t, RefName("refs/for-review/abc").IsForReview())

// Test commit hashes.
assert.Equal(t, "c0ffee", RefName("c0ffee").ShortName())
Expand Down

0 comments on commit a041057

Please sign in to comment.