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
501f0b57
Commit
501f0b57
authored
Feb 23, 2012
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: commentary for [h-m]*.go
R=golang-dev, gri CC=golang-dev
https://golang.org/cl/5674112
parent
3391de8d
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
66 additions
and
11 deletions
+66
-11
test/helloworld.go
test/helloworld.go
+2
-0
test/if.go
test/if.go
+2
-0
test/import.go
test/import.go
+2
-2
test/import1.go
test/import1.go
+2
-1
test/import2.go
test/import2.go
+3
-0
test/import3.go
test/import3.go
+1
-1
test/import4.go
test/import4.go
+4
-2
test/import5.go
test/import5.go
+3
-1
test/index.go
test/index.go
+1
-0
test/indirect.go
test/indirect.go
+2
-0
test/indirect1.go
test/indirect1.go
+3
-0
test/init.go
test/init.go
+3
-0
test/initialize.go
test/initialize.go
+2
-0
test/initializerr.go
test/initializerr.go
+3
-0
test/int_lit.go
test/int_lit.go
+2
-0
test/intcvt.go
test/intcvt.go
+2
-0
test/iota.go
test/iota.go
+2
-0
test/label.go
test/label.go
+3
-1
test/label1.go
test/label1.go
+4
-1
test/linkx.go
test/linkx.go
+2
-0
test/literal.go
test/literal.go
+2
-0
test/mallocfin.go
test/mallocfin.go
+1
-1
test/map.go
test/map.go
+2
-0
test/map1.go
test/map1.go
+3
-0
test/method.go
test/method.go
+3
-0
test/method1.go
test/method1.go
+3
-0
test/method2.go
test/method2.go
+3
-0
test/method3.go
test/method3.go
+1
-1
No files found.
test/helloworld.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test that we can do page 1 of the C book.
package
main
func
main
()
{
...
...
test/if.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test if statements in various forms.
package
main
func
assertequal
(
is
,
shouldbe
int
,
msg
string
)
{
...
...
test/import.go
View file @
501f0b57
...
...
@@ -4,8 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
check
that when import gives multiple names
// to a
type, they're still all the same type
//
Test
that when import gives multiple names
// to a
single type, they still all refer to the same type.
package
main
...
...
test/import1.go
View file @
501f0b57
...
...
@@ -4,7 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// check for import conflicts
// Verify that import conflicts are detected by the compiler.
// Does not compile.
package
main
...
...
test/import2.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Various declarations of exported variables and functions.
// Imported by import3.go.
package
p
var
C1
chan
<-
chan
int
=
(
chan
<-
(
chan
int
))(
nil
)
...
...
test/import3.go
View file @
501f0b57
...
...
@@ -4,7 +4,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
Check
that all the types from import2.go made it
//
Test
that all the types from import2.go made it
// intact and with the same meaning, by assigning to or using them.
package
main
...
...
test/import4.go
View file @
501f0b57
...
...
@@ -4,9 +4,11 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
main
// Verify that various kinds of "imported and not used"
// errors are caught by the compiler.
// Does not compile.
// various kinds of imported and not used
package
main
// standard
import
"fmt"
// ERROR "imported and not used.*fmt"
...
...
test/import5.go
View file @
501f0b57
...
...
@@ -4,7 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// import paths are slash-separated; reject backslash
// Verify that imports with backslashes are rejected by the compiler.
// Does not compile.
// TODO: make more thorough.
package
main
...
...
test/index.go
View file @
501f0b57
...
...
@@ -9,6 +9,7 @@
// license that can be found in the LICENSE file.
// Generate test of index and slice bounds checks.
// The output is compiled and run.
package
main
...
...
test/indirect.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test various safe uses of indirection.
package
main
var
m0
map
[
string
]
int
...
...
test/indirect1.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Verify that illegal uses of indirection are caught by the compiler.
// Does not compile.
package
main
var
m0
map
[
string
]
int
...
...
test/init.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Verify that erroneous use of init is detected.
// Does not compile.
package
main
import
"runtime"
...
...
test/initialize.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test initialization of package-level variables.
package
main
import
"fmt"
...
...
test/initializerr.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Verify that erroneous initialization expressions are caught by the compiler
// Does not compile.
package
main
type
S
struct
{
...
...
test/int_lit.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test integer literal syntax.
package
main
import
"os"
...
...
test/intcvt.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test implicit and explicit conversions of constants.
package
main
const
(
...
...
test/iota.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test iota.
package
main
func
assert
(
cond
bool
,
msg
string
)
{
...
...
test/label.go
View file @
501f0b57
...
...
@@ -4,7 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Pass 1 label errors.
// Verify that erroneous labels are caught by the compiler.
// This set is caught by pass 1.
// Does not compile.
package
main
...
...
test/label1.go
View file @
501f0b57
...
...
@@ -4,7 +4,10 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Pass 2 label errors.
// Verify that erroneous labels are caught by the compiler.
// This set is caught by pass 2. That's why this file is label1.go.
// Does not compile.
package
main
...
...
test/linkx.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test the -X facility of the gc linker (6l etc.).
package
main
var
tbd
string
...
...
test/literal.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test literal syntax for basic types.
package
main
var
nbad
int
...
...
test/mallocfin.go
View file @
501f0b57
...
...
@@ -4,7 +4,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
trivial finalizer test
//
Test basic operation of finalizers.
package
main
...
...
test/map.go
View file @
501f0b57
...
...
@@ -4,6 +4,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test maps, almost exhaustively.
package
main
import
(
...
...
test/map1.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test map declarations of many types, including erroneous ones.
// Does not compile.
package
main
func
main
()
{}
...
...
test/method.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test simple methods of various types, with pointer and
// value receivers.
package
main
type
S
string
...
...
test/method1.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Verify that method redeclarations are caught by the compiler.
// Does not compile.
package
main
type
T
struct
{
}
...
...
test/method2.go
View file @
501f0b57
...
...
@@ -4,6 +4,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Verify that pointers and interface types cannot be method receivers.
// Does not compile.
package
main
type
T
struct
{
...
...
test/method3.go
View file @
501f0b57
...
...
@@ -4,7 +4,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
test that methods on slices work
//
Test methods on slices.
package
main
...
...
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