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
dbce368e
Commit
dbce368e
authored
Jan 25, 2012
by
Robert Griesemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/doc: test cases for sort order
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5569059
parent
7eaad5e6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
310 additions
and
0 deletions
+310
-0
src/pkg/go/doc/testdata/d.0.golden
src/pkg/go/doc/testdata/d.0.golden
+104
-0
src/pkg/go/doc/testdata/d.1.golden
src/pkg/go/doc/testdata/d.1.golden
+104
-0
src/pkg/go/doc/testdata/d1.go
src/pkg/go/doc/testdata/d1.go
+57
-0
src/pkg/go/doc/testdata/d2.go
src/pkg/go/doc/testdata/d2.go
+45
-0
No files found.
src/pkg/go/doc/testdata/d.0.golden
0 → 100644
View file @
dbce368e
//
PACKAGE d
IMPORTPATH
testdata/d
FILENAMES
testdata/d1.go
testdata/d2.go
CONSTANTS
// CBx constants should appear before CAx constants.
const (
CB2 = iota // before CB1
CB1 // before CB0
CB0 // at end
)
// CAx constants should appear after CBx constants.
const (
CA2 = iota // before CA1
CA1 // before CA0
CA0 // at end
)
// C0 should be first.
const C0 = 0
// C1 should be second.
const C1 = 1
// C2 should be third.
const C2 = 2
//
const (
// Single const declarations inside ()'s are considered ungrouped
// and show up in sorted order.
Cungrouped = 0
)
VARIABLES
// VBx variables should appear before VAx variables.
var (
VB2 int // before VB1
VB1 int // before VB0
VB0 int // at end
)
// VAx variables should appear after VBx variables.
var (
VA2 int // before VA1
VA1 int // before VA0
VA0 int // at end
)
// V0 should be first.
var V0 uintptr
// V1 should be second.
var V1 uint
// V2 should be third.
var V2 int
//
var (
// Single var declarations inside ()'s are considered ungrouped
// and show up in sorted order.
Vungrouped = 0
)
FUNCTIONS
// F0 should be first.
func F0()
// F1 should be second.
func F1()
// F2 should be third.
func F2()
TYPES
// T0 should be first.
type T0 struct{}
// T1 should be second.
type T1 struct{}
// T2 should be third.
type T2 struct{}
// TG0 should be first.
type TG0 struct{}
// TG1 should be second.
type TG1 struct{}
// TG2 should be third.
type TG2 struct{}
src/pkg/go/doc/testdata/d.1.golden
0 → 100644
View file @
dbce368e
//
PACKAGE d
IMPORTPATH
testdata/d
FILENAMES
testdata/d1.go
testdata/d2.go
CONSTANTS
// CBx constants should appear before CAx constants.
const (
CB2 = iota // before CB1
CB1 // before CB0
CB0 // at end
)
// CAx constants should appear after CBx constants.
const (
CA2 = iota // before CA1
CA1 // before CA0
CA0 // at end
)
// C0 should be first.
const C0 = 0
// C1 should be second.
const C1 = 1
// C2 should be third.
const C2 = 2
//
const (
// Single const declarations inside ()'s are considered ungrouped
// and show up in sorted order.
Cungrouped = 0
)
VARIABLES
// VBx variables should appear before VAx variables.
var (
VB2 int // before VB1
VB1 int // before VB0
VB0 int // at end
)
// VAx variables should appear after VBx variables.
var (
VA2 int // before VA1
VA1 int // before VA0
VA0 int // at end
)
// V0 should be first.
var V0 uintptr
// V1 should be second.
var V1 uint
// V2 should be third.
var V2 int
//
var (
// Single var declarations inside ()'s are considered ungrouped
// and show up in sorted order.
Vungrouped = 0
)
FUNCTIONS
// F0 should be first.
func F0()
// F1 should be second.
func F1()
// F2 should be third.
func F2()
TYPES
// T0 should be first.
type T0 struct{}
// T1 should be second.
type T1 struct{}
// T2 should be third.
type T2 struct{}
// TG0 should be first.
type TG0 struct{}
// TG1 should be second.
type TG1 struct{}
// TG2 should be third.
type TG2 struct{}
src/pkg/go/doc/testdata/d1.go
0 → 100644
View file @
dbce368e
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test cases for sort order of declarations.
package
d
// C2 should be third.
const
C2
=
2
// V2 should be third.
var
V2
int
// CBx constants should appear before CAx constants.
const
(
CB2
=
iota
// before CB1
CB1
// before CB0
CB0
// at end
)
// VBx variables should appear before VAx variables.
var
(
VB2
int
// before VB1
VB1
int
// before VB0
VB0
int
// at end
)
const
(
// Single const declarations inside ()'s are considered ungrouped
// and show up in sorted order.
Cungrouped
=
0
)
var
(
// Single var declarations inside ()'s are considered ungrouped
// and show up in sorted order.
Vungrouped
=
0
)
// T2 should be third.
type
T2
struct
{}
// Grouped types are sorted nevertheless.
type
(
// TG2 should be third.
TG2
struct
{}
// TG1 should be second.
TG1
struct
{}
// TG0 should be first.
TG0
struct
{}
)
// F2 should be third.
func
F2
()
{}
src/pkg/go/doc/testdata/d2.go
0 → 100644
View file @
dbce368e
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test cases for sort order of declarations.
package
d
// C1 should be second.
const
C1
=
1
// C0 should be first.
const
C0
=
0
// V1 should be second.
var
V1
uint
// V0 should be first.
var
V0
uintptr
// CAx constants should appear after CBx constants.
const
(
CA2
=
iota
// before CA1
CA1
// before CA0
CA0
// at end
)
// VAx variables should appear after VBx variables.
var
(
VA2
int
// before VA1
VA1
int
// before VA0
VA0
int
// at end
)
// T1 should be second.
type
T1
struct
{}
// T0 should be first.
type
T0
struct
{}
// F1 should be second.
func
F1
()
{}
// F0 should be first.
func
F0
()
{}
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