error_test.go 596 B

1234567891011121314151617181920212223
  1. // Copyright 2020 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package gitutil
  5. import (
  6. "os"
  7. "testing"
  8. "github.com/gogs/git-module"
  9. "github.com/stretchr/testify/assert"
  10. )
  11. func TestIsErrRevisionNotExist(t *testing.T) {
  12. assert.True(t, IsErrRevisionNotExist(git.ErrRevisionNotExist))
  13. assert.False(t, IsErrRevisionNotExist(os.ErrNotExist))
  14. }
  15. func TestIsErrNoMergeBase(t *testing.T) {
  16. assert.True(t, IsErrNoMergeBase(git.ErrNoMergeBase))
  17. assert.False(t, IsErrNoMergeBase(os.ErrNotExist))
  18. }