Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
696815c5
Commit
696815c5
authored
Sep 04, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extend composite literal test.
update tests. update golden.out R=gri OCL=14816 CL=14816
parent
eab46c6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
test/complit.go
test/complit.go
+17
-1
test/fixedbugs/bug081.go
test/fixedbugs/bug081.go
+0
-0
test/golden.out
test/golden.out
+3
-5
No files found.
test/complit.go
View file @
696815c5
...
...
@@ -8,6 +8,20 @@ package main
type
T
struct
{
i
int
;
f
float
;
s
string
;
next
*
T
}
type
R
struct
{
num
int
}
func
itor
(
a
int
)
*
R
{
r
:=
new
(
R
);
r
.
num
=
a
;
return
r
;
}
func
eq
(
a
*
[]
*
R
)
{
for
i
:=
0
;
i
<
len
(
a
);
i
++
{
if
a
[
i
]
.
num
!=
i
{
panic
(
"bad"
)
}
}
}
func
main
()
{
var
t
T
;
t
=
T
(
0
,
7.2
,
"hi"
,
&
t
);
...
...
@@ -18,7 +32,7 @@ func main() {
a1
:=
[]
int
(
1
,
2
,
3
);
if
len
(
a1
)
!=
3
{
panic
(
"a1"
)
}
a2
:=
[
10
]
int
(
1
,
2
,
3
);
if
len
(
a2
)
!=
10
||
a2
[
3
]
!=
0
{
panic
(
"a2"
)
}
if
len
(
a2
)
!=
10
||
cap
(
a2
)
!=
1
0
{
panic
(
"a2"
)
}
//a3 := [10]int(1,2,3,); // BUG: trailing commas not allowed
//if len(a3) != 10 || a2[3] != 0 { panic("a3") }
...
...
@@ -41,4 +55,6 @@ func main() {
m
:=
map
[
string
]
float
(
"one"
:
1.0
,
"two"
:
2.0
,
"pi"
:
22.
/
7.
);
if
len
(
m
)
!=
3
{
panic
(
"m"
)
}
eq
(
&
[]
*
R
(
itor
(
0
),
itor
(
1
),
itor
(
2
),
itor
(
3
),
itor
(
4
),
itor
(
5
)));
}
test/bugs/bug081.go
→
test/
fixed
bugs/bug081.go
View file @
696815c5
File moved
test/golden.out
View file @
696815c5
...
...
@@ -112,11 +112,6 @@ bugs/bug080.go:12: illegal types for operand: CALL
({<x><int32>INT32;<y><float32>FLOAT32;})
BUG: fails incorrectly
=========== bugs/bug081.go
bugs/bug081.go:5: first constant must evaluate an expression
BUG: compiler should not crash
Bus error $G $D/$F.go
=========== bugs/bug083.go
BUG: succeeds incorrectly
...
...
@@ -212,5 +207,8 @@ fixedbugs/bug073.go:9: illegal types for operand: RSH
(<int32>INT32)
(<int32>INT32)
=========== fixedbugs/bug081.go
fixedbugs/bug081.go:5: syntax error
=========== fixedbugs/bug091.go
fixedbugs/bug091.go:14: label exit not defined
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