mirror of
https://github.com/ariejan/i6502.git
synced 2025-08-20 04:27:56 +00:00
Use testify for cleaner tests
This commit is contained in:
@@ -7,3 +7,6 @@ go:
|
|||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- go: tip
|
- go: tip
|
||||||
|
|
||||||
|
install:
|
||||||
|
- go get github.com/stretchr/testify
|
||||||
|
10
cpu_test.go
10
cpu_test.go
@@ -1,17 +1,13 @@
|
|||||||
package i6502
|
package i6502
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewCpu(t *testing.T) {
|
func TestNewCpu(t *testing.T) {
|
||||||
cpu, err := NewCpu()
|
cpu, err := NewCpu()
|
||||||
|
|
||||||
if err != nil {
|
assert.NotNil(t, cpu)
|
||||||
t.Errorf("Expected NewCPU() to not raise an error")
|
assert.Nil(t, err)
|
||||||
}
|
|
||||||
|
|
||||||
if cpu == nil {
|
|
||||||
t.Errorf("Expected NewCPU() to create a new CPU instance")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user