aboutsummaryrefslogtreecommitdiff
path: root/internal/gitutil/error_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/gitutil/error_test.go')
-rw-r--r--internal/gitutil/error_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/gitutil/error_test.go b/internal/gitutil/error_test.go
new file mode 100644
index 00000000..c0b9f77a
--- /dev/null
+++ b/internal/gitutil/error_test.go
@@ -0,0 +1,23 @@
+// Copyright 2020 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package gitutil
+
+import (
+ "os"
+ "testing"
+
+ "github.com/gogs/git-module"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestIsErrRevisionNotExist(t *testing.T) {
+ assert.True(t, IsErrRevisionNotExist(git.ErrRevisionNotExist))
+ assert.False(t, IsErrRevisionNotExist(os.ErrNotExist))
+}
+
+func TestIsErrNoMergeBase(t *testing.T) {
+ assert.True(t, IsErrNoMergeBase(git.ErrNoMergeBase))
+ assert.False(t, IsErrNoMergeBase(os.ErrNotExist))
+}