Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
80e4a053
Commit
80e4a053
authored
Jul 07, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tests for new reflect
R=r DELTA=12 (0 added, 0 deleted, 12 changed) OCL=31240 CL=31290
parent
87783933
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
golden.out
test/golden.out
+2
-2
fake.go
test/interface/fake.go
+10
-10
No files found.
test/golden.out
View file @
80e4a053
...
@@ -74,13 +74,13 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
...
@@ -74,13 +74,13 @@ abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
PASS
PASS
=========== interface/fail.go
=========== interface/fail.go
cannot convert type *main.S to interface
main.I: missing method Foo
*main.S is not
main.I: missing method Foo
throw: interface conversion
throw: interface conversion
panic PC=xxx
panic PC=xxx
=========== interface/returntype.go
=========== interface/returntype.go
cannot convert type *main.S to interface
main.I2: missing method Name
*main.S is not
main.I2: missing method Name
throw: interface conversion
throw: interface conversion
panic PC=xxx
panic PC=xxx
...
...
test/interface/fake.go
View file @
80e4a053
...
@@ -53,27 +53,27 @@ func main() {
...
@@ -53,27 +53,27 @@ func main() {
// check mem and string
// check mem and string
v
:=
reflect
.
NewValue
(
x
);
v
:=
reflect
.
NewValue
(
x
);
i
:=
v
.
(
reflect
.
StructValue
)
.
Field
(
0
);
i
:=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
0
);
j
:=
v
.
(
reflect
.
StructValue
)
.
Field
(
1
);
j
:=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
1
);
assert
(
i
.
Interface
()
==
j
.
Interface
());
assert
(
i
.
Interface
()
==
j
.
Interface
());
s
:=
v
.
(
reflect
.
StructValue
)
.
Field
(
2
);
s
:=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
2
);
t
:=
v
.
(
reflect
.
StructValue
)
.
Field
(
3
);
t
:=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
3
);
assert
(
s
.
Interface
()
==
t
.
Interface
());
assert
(
s
.
Interface
()
==
t
.
Interface
());
// make sure different values are different.
// make sure different values are different.
// make sure whole word is being compared,
// make sure whole word is being compared,
// not just a single byte.
// not just a single byte.
i
=
v
.
(
reflect
.
StructValue
)
.
Field
(
4
);
i
=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
4
);
j
=
v
.
(
reflect
.
StructValue
)
.
Field
(
5
);
j
=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
5
);
assert
(
i
.
Interface
()
!=
j
.
Interface
());
assert
(
i
.
Interface
()
!=
j
.
Interface
());
i
=
v
.
(
reflect
.
StructValue
)
.
Field
(
6
);
i
=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
6
);
j
=
v
.
(
reflect
.
StructValue
)
.
Field
(
7
);
j
=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
7
);
assert
(
i
.
Interface
()
!=
j
.
Interface
());
assert
(
i
.
Interface
()
!=
j
.
Interface
());
i
=
v
.
(
reflect
.
StructValue
)
.
Field
(
8
);
i
=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
8
);
j
=
v
.
(
reflect
.
StructValue
)
.
Field
(
9
);
j
=
v
.
(
*
reflect
.
StructValue
)
.
Field
(
9
);
assert
(
i
.
Interface
()
==
j
.
Interface
());
assert
(
i
.
Interface
()
==
j
.
Interface
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment