mirror of
https://github.com/ariejan/i6502.git
synced 2025-04-08 21:43:30 +00:00
Add NewCpu()
This commit is contained in:
parent
0eaa592103
commit
57b940dce1
9
.travis.yml
Normal file
9
.travis.yml
Normal file
@ -0,0 +1,9 @@
|
||||
language: go
|
||||
|
||||
go:
|
||||
- 1.3
|
||||
- tip
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- go: tip
|
8
cpu.go
Normal file
8
cpu.go
Normal file
@ -0,0 +1,8 @@
|
||||
package i6502
|
||||
|
||||
type Cpu struct {
|
||||
}
|
||||
|
||||
func NewCpu() (*Cpu, error) {
|
||||
return &Cpu{}, nil
|
||||
}
|
17
cpu_test.go
Normal file
17
cpu_test.go
Normal file
@ -0,0 +1,17 @@
|
||||
package i6502
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewCpu(t *testing.T) {
|
||||
cpu, err := NewCpu()
|
||||
|
||||
if err != nil {
|
||||
t.Errorf("Expected NewCPU() to not raise an error")
|
||||
}
|
||||
|
||||
if cpu == nil {
|
||||
t.Errorf("Expected NewCPU() to create a new CPU instance")
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user