GoPLS Viewer

Home|gopls/go/expect/testdata/test.go
1// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Package fake1 is used to test the expect package.
6package fake1
7
8// The greek letters in this file mark points we use for marker tests.
9// We use unique markers so we can make the tests stable against changes to
10// this file.
11
12const (
13    _                   int = iota
14    αSimpleMarkerα          //@αSimpleMarker
15    offsetββMarker          //@mark(OffsetMarker, "β")
16    regexγMaγrker           //@mark(RegexMarker, re`\p{Greek}Ma`)
17    εMultipleεζMarkersζ     //@εMultiple,ζMarkers
18    ηBlockMarkerη           /*@ηBlockMarker*/
19)
20
21/*Marker ι inside ι a comment*/ //@mark(Comment,"ι inside ")
22var x = "hello"                 //@mark(StringMarker, `"hello"`)
23
24// someFunc is a function. //@mark(LineComment, "someFunc")
25func someFunc(ab intint {
26    // The line below must be the first occurrence of the plus operator
27    return a + b + 1 //@mark(NonIdentifier, re`\+[^\+]*`)
28}
29
30// And some extra checks for interesting action parameters
31// Also checks for multi-line expectations
32/*@
33check(αSimpleMarker)
34check(StringAndInt,
35    "Number %d",
36    12,
37)
38
39check(Bool, true)
40*/
41
MembersX
x
someFunc
someFunc.a
someFunc.b
Members
X