-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathconscell_test.go
More file actions
42 lines (32 loc) · 878 Bytes
/
conscell_test.go
File metadata and controls
42 lines (32 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2014 SteelSeries ApS. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//This package implements a basic LISP interpretor for embedding in a go program for scripting.
// This file impliments tests for cons cell.
package golisp
import (
. "gopkg.in/check.v1"
)
type ConsCellSuite struct {
a *Data
b *Data
cell *Data
}
var _ = Suite(&ConsCellSuite{})
func (s *ConsCellSuite) SetUpTest(c *C) {
s.a = IntegerWithValue(1)
s.b = IntegerWithValue(2)
s.cell = Cons(s.a, s.b)
}
func (s *ConsCellSuite) TestCar(c *C) {
c.Check(Car(s.cell), Equals, s.a)
}
func (s *ConsCellSuite) TestCarNil(c *C) {
c.Check(Car(nil), IsNil)
}
func (s *ConsCellSuite) TestCdr(c *C) {
c.Check(Cdr(s.cell), Equals, s.b)
}
func (s *ConsCellSuite) TestCdrNil(c *C) {
c.Check(Cdr(nil), IsNil)
}