X
49 | add x
50 | sub x
51 | mul x
52 | div x
53 | or x
54 | and x
55 | lsh x
56 | rsh x
57 | mod x
58 | xor x
59 |
60 | # !A
61 | neg
62 |
63 | # Jumps
64 | ja end
65 | jeq #42,prev,end
66 | jne #42,end
67 | jlt #42,end
68 | jle #42,end
69 | jgt #42,prev,end
70 | jge #42,prev,end
71 | jset #42,prev,end
72 |
73 | # Register transfers
74 | tax
75 | txa
76 |
77 | # Returns
78 | prev: ret a
79 | end: ret #42
80 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/bpf/vm_extension_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2016 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 bpf_test
6 |
7 | import (
8 | "testing"
9 |
10 | "golang.org/x/net/bpf"
11 | )
12 |
13 | func TestVMLoadExtensionNotImplemented(t *testing.T) {
14 | _, _, err := testVM(t, []bpf.Instruction{
15 | bpf.LoadExtension{
16 | Num: 100,
17 | },
18 | bpf.RetA{},
19 | })
20 | if errStr(err) != "extension 100 not implemented" {
21 | t.Fatalf("unexpected error: %v", err)
22 | }
23 | }
24 |
25 | func TestVMLoadExtensionExtLen(t *testing.T) {
26 | vm, done, err := testVM(t, []bpf.Instruction{
27 | bpf.LoadExtension{
28 | Num: bpf.ExtLen,
29 | },
30 | bpf.RetA{},
31 | })
32 | if err != nil {
33 | t.Fatalf("failed to load BPF program: %v", err)
34 | }
35 | defer done()
36 |
37 | out, err := vm.Run([]byte{
38 | 0xff, 0xff, 0xff, 0xff,
39 | 0xff, 0xff, 0xff, 0xff,
40 | 0, 1, 2, 3,
41 | })
42 | if err != nil {
43 | t.Fatalf("unexpected error while running program: %v", err)
44 | }
45 | if want, got := 4, out; want != got {
46 | t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d",
47 | want, got)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/codereview.cfg:
--------------------------------------------------------------------------------
1 | issuerepo: golang/go
2 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2015 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 | // +build !plan9,go1.7
6 |
7 | package ctxhttp
8 |
9 | import (
10 | "io"
11 | "net/http"
12 | "net/http/httptest"
13 | "testing"
14 |
15 | "context"
16 | )
17 |
18 | func TestGo17Context(t *testing.T) {
19 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
20 | io.WriteString(w, "ok")
21 | }))
22 | ctx := context.Background()
23 | resp, err := Get(ctx, http.DefaultClient, ts.URL)
24 | if resp == nil || err != nil {
25 | t.Fatalf("error received from client: %v %v", err, resp)
26 | }
27 | resp.Body.Close()
28 | }
29 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/context/withtimeout_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 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 context_test
6 |
7 | import (
8 | "fmt"
9 | "time"
10 |
11 | "golang.org/x/net/context"
12 | )
13 |
14 | func ExampleWithTimeout() {
15 | // Pass a context with a timeout to tell a blocking function that it
16 | // should abandon its work after the timeout elapses.
17 | ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)
18 | select {
19 | case <-time.After(200 * time.Millisecond):
20 | fmt.Println("overslept")
21 | case <-ctx.Done():
22 | fmt.Println(ctx.Err()) // prints "context deadline exceeded"
23 | }
24 | // Output:
25 | // context deadline exceeded
26 | }
27 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/charset/testdata/README:
--------------------------------------------------------------------------------
1 | These test cases come from
2 | http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics
3 |
4 | Distributed under both the W3C Test Suite License
5 | (http://www.w3.org/Consortium/Legal/2008/04-testsuite-license)
6 | and the W3C 3-clause BSD License
7 | (http://www.w3.org/Consortium/Legal/2008/03-bsd-license).
8 | To contribute to a W3C Test Suite, see the policies and contribution
9 | forms (http://www.w3.org/2004/10/27-testcases).
10 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiniu/kirk/9ee4bf2b1c5c3bab1bf2bf13955e155da1dbe37a/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/qiniu/kirk/9ee4bf2b1c5c3bab1bf2bf13955e155da1dbe37a/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/entity_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2010 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 html
6 |
7 | import (
8 | "testing"
9 | "unicode/utf8"
10 | )
11 |
12 | func TestEntityLength(t *testing.T) {
13 | // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key).
14 | // The +1 comes from the leading "&". This property implies that the length of
15 | // unescaped text is <= the length of escaped text.
16 | for k, v := range entity {
17 | if 1+len(k) < utf8.RuneLen(v) {
18 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v))
19 | }
20 | if len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' {
21 | t.Errorf("entity name %s is %d characters, but longestEntityWithoutSemicolon=%d", k, len(k), longestEntityWithoutSemicolon)
22 | }
23 | }
24 | for k, v := range entity2 {
25 | if 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) {
26 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v[0]) + string(v[1]))
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/example_test.go:
--------------------------------------------------------------------------------
1 | // Copyright 2012 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 | // This example demonstrates parsing HTML data and walking the resulting tree.
6 | package html_test
7 |
8 | import (
9 | "fmt"
10 | "log"
11 | "strings"
12 |
13 | "golang.org/x/net/html"
14 | )
15 |
16 | func ExampleParse() {
17 | s := `Links:
`
18 | doc, err := html.Parse(strings.NewReader(s))
19 | if err != nil {
20 | log.Fatal(err)
21 | }
22 | var f func(*html.Node)
23 | f = func(n *html.Node) {
24 | if n.Type == html.ElementNode && n.Data == "a" {
25 | for _, a := range n.Attr {
26 | if a.Key == "href" {
27 | fmt.Println(a.Val)
28 | break
29 | }
30 | }
31 | }
32 | for c := n.FirstChild; c != nil; c = c.NextSibling {
33 | f(c)
34 | }
35 | }
36 | f(doc)
37 | // Output:
38 | // foo
39 | // /bar/baz
40 | }
41 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat:
--------------------------------------------------------------------------------
1 | #data
2 | 1234
3 | #errors
4 | #document
5 | |
6 | |
7 | |
8 | |
9 | | "1"
10 | |
11 | | "2"
12 | |
13 | |
14 | |
15 | | "3"
16 | | "4"
17 |
18 | #data
19 |