test: commentary for [h-m]*.go

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5674112
This commit is contained in:
Rob Pike 2012-02-23 18:47:26 +11:00
Родитель 3391de8df7
Коммит 501f0b578f
28 изменённых файлов: 66 добавлений и 11 удалений

Просмотреть файл

@ -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() {

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -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"

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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"

Просмотреть файл

@ -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"

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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"

Просмотреть файл

@ -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 (

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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 (

Просмотреть файл

@ -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() {}

Просмотреть файл

@ -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

Просмотреть файл

@ -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 { }

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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