OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [go/] [printer/] [testdata/] [slow.input] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2011 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package deepequal_test
6
 
7
import (
8
        "testing"
9
        "google3/spam/archer/frontend/deepequal"
10
)
11
 
12
func TestTwoNilValues(t *testing.T) {
13
        if err := deepequal.Check(nil, nil); err != nil {
14
                t.Errorf("expected nil, saw %v", err)
15
        }
16
}
17
 
18
type Foo struct {
19
        bar *Bar
20
        bang *Bar
21
}
22
 
23
type Bar struct {
24
        baz *Baz
25
        foo []*Foo
26
}
27
 
28
type Baz struct {
29
        entries  map[int]interface{}
30
        whatever string
31
}
32
 
33
func newFoo() (*Foo) {
34
return &Foo{bar: &Bar{ baz: &Baz{
35
entries: map[int]interface{}{
36
42: &Foo{},
37
21: &Bar{},
38
11: &Baz{ whatever: "it's just a test" }}}},
39
        bang: &Bar{foo: []*Foo{
40
&Foo{bar: &Bar{ baz: &Baz{
41
entries: map[int]interface{}{
42
43: &Foo{},
43
22: &Bar{},
44
13: &Baz{ whatever: "this is nuts" }}}},
45
        bang: &Bar{foo: []*Foo{
46
&Foo{bar: &Bar{ baz: &Baz{
47
entries: map[int]interface{}{
48
61: &Foo{},
49
71: &Bar{},
50
11: &Baz{ whatever: "no, it's Go" }}}},
51
        bang: &Bar{foo: []*Foo{
52
&Foo{bar: &Bar{ baz: &Baz{
53
entries: map[int]interface{}{
54
0: &Foo{},
55
-2: &Bar{},
56
-11: &Baz{ whatever: "we need to go deeper" }}}},
57
        bang: &Bar{foo: []*Foo{
58
&Foo{bar: &Bar{ baz: &Baz{
59
entries: map[int]interface{}{
60
-2: &Foo{},
61
-5: &Bar{},
62
-7: &Baz{ whatever: "are you serious?" }}}},
63
        bang: &Bar{foo: []*Foo{}}},
64
&Foo{bar: &Bar{ baz: &Baz{
65
entries: map[int]interface{}{
66
-100: &Foo{},
67
50: &Bar{},
68
20: &Baz{ whatever: "na, not really ..." }}}},
69
        bang: &Bar{foo: []*Foo{}}}}}}}}},
70
&Foo{bar: &Bar{ baz: &Baz{
71
entries: map[int]interface{}{
72
2: &Foo{},
73
1: &Bar{},
74
-1: &Baz{ whatever: "... it's just a test." }}}},
75
        bang: &Bar{foo: []*Foo{}}}}}}}}}
76
}
77
 
78
func TestElaborate(t *testing.T) {
79
        a := newFoo()
80
        b := newFoo()
81
 
82
        if err := deepequal.Check(a, b); err != nil {
83
                t.Errorf("expected nil, saw %v", err)
84
        }
85
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.