aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-13 17:07:24 +0200
committerMichael Muré <batolettre@gmail.com>2018-07-13 17:07:24 +0200
commit289f8d53ee960d35c1f0c42e8753ad536737b875 (patch)
treeca1f0af1e041ff5779d39a79c486c331a88c0334
parentdeff9e0a41eca43f832314219241c9a63cf8007e (diff)
downloadgit-bug-289f8d53ee960d35c1f0c42e8753ad536737b875.tar.gz
little bit more tests
-rw-r--r--tests/bug_test.go (renamed from test/bug_test.go)18
-rw-r--r--tests/operation_iterator_test.go (renamed from test/operation_iterator_test.go)13
2 files changed, 18 insertions, 13 deletions
diff --git a/test/bug_test.go b/tests/bug_test.go
index d7c3ddc5..dfb3ac09 100644
--- a/test/bug_test.go
+++ b/tests/bug_test.go
@@ -1,21 +1,23 @@
-package test
+package tests
import (
"github.com/MichaelMure/git-bug/bug"
- "github.com/MichaelMure/git-bug/bug/operations"
"testing"
)
-func TestBug(t *testing.T) {
- var rene = bug.Person{
- Name: "René Descartes",
- Email: "rene@descartes.fr",
+func TestBugId(t *testing.T) {
+ bug1, err := bug.NewBug()
+ if err != nil {
+ t.Error(err)
}
- var createOp = operations.NewCreateOp(rene, "title", "message")
+ if len(bug1.HumanId()) == 0 {
+ t.Fatal("Bug doesn't have a human readable identifier")
+ }
+}
+func TestBugValidity(t *testing.T) {
bug1, err := bug.NewBug()
-
if err != nil {
t.Error(err)
}
diff --git a/test/operation_iterator_test.go b/tests/operation_iterator_test.go
index d8e78a1f..e41fff99 100644
--- a/test/operation_iterator_test.go
+++ b/tests/operation_iterator_test.go
@@ -1,4 +1,4 @@
-package test
+package tests
import (
"github.com/MichaelMure/git-bug/bug"
@@ -6,14 +6,17 @@ import (
"testing"
)
-func TestOpIterator(t *testing.T) {
- var rene = bug.Person{
+var (
+ rene = bug.Person{
Name: "René Descartes",
Email: "rene@descartes.fr",
}
- var createOp = operations.NewCreateOp(rene, "title", "message")
- var setTitleOp = operations.NewSetTitleOp("title2")
+ createOp = operations.NewCreateOp(rene, "title", "message")
+ setTitleOp = operations.NewSetTitleOp("title2")
+)
+
+func TestOpIterator(t *testing.T) {
bug1, err := bug.NewBug()