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
476e3cd7
Commit
476e3cd7
authored
Jan 07, 2009
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed and added more tests
R=r OCL=22187 CL=22187
parent
5bd3c3b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
initcomma.go
test/initcomma.go
+20
-3
No files found.
test/initcomma.go
View file @
476e3cd7
...
@@ -6,12 +6,29 @@
...
@@ -6,12 +6,29 @@
package
main
package
main
var
a
=
[]
int
{
1
,
2
,
}
var
a
=
[]
int
{
1
,
2
,
}
var
b
=
[
]
int
{
}
var
b
=
[
5
]
int
{
1
,
2
,
3
}
var
c
=
[]
int
{
1
}
var
c
=
[]
int
{
1
}
var
d
=
[
...
]
int
{
1
,
2
,
3
}
func
main
()
{
func
main
()
{
if
len
(
a
)
!=
2
{
panicln
(
"len a"
,
len
(
a
))
}
if
len
(
a
)
!=
2
{
panicln
(
"len a"
,
len
(
a
))
}
if
len
(
b
)
!=
5
{
panicln
(
"len b"
,
len
(
b
))
}
if
len
(
b
)
!=
5
{
panicln
(
"len b"
,
len
(
b
))
}
if
len
(
c
)
!=
1
{
panicln
(
"len a"
,
len
(
c
))
}
if
len
(
c
)
!=
1
{
panicln
(
"len d"
,
len
(
c
))
}
if
len
(
d
)
!=
3
{
panicln
(
"len c"
,
len
(
d
))
}
if
a
[
0
]
!=
1
{
panicln
(
"a[0]"
,
a
[
0
])
}
if
a
[
1
]
!=
2
{
panicln
(
"a[1]"
,
a
[
1
])
}
if
b
[
0
]
!=
1
{
panicln
(
"b[0]"
,
b
[
0
])
}
if
b
[
1
]
!=
2
{
panicln
(
"b[1]"
,
b
[
1
])
}
if
b
[
2
]
!=
3
{
panicln
(
"b[2]"
,
b
[
2
])
}
if
b
[
3
]
!=
0
{
panicln
(
"b[3]"
,
b
[
3
])
}
if
b
[
4
]
!=
0
{
panicln
(
"b[4]"
,
b
[
4
])
}
if
c
[
0
]
!=
1
{
panicln
(
"c[0]"
,
c
[
0
])
}
if
d
[
0
]
!=
1
{
panicln
(
"d[0]"
,
d
[
0
])
}
if
d
[
1
]
!=
2
{
panicln
(
"d[1]"
,
d
[
1
])
}
if
d
[
2
]
!=
3
{
panicln
(
"d[2]"
,
d
[
2
])
}
}
}
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