~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/cmd/fix/httpheaders_test.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 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 main
6
 
 
7
 
func init() {
8
 
        addTestCases(httpHeadersTests, httpheaders)
9
 
}
10
 
 
11
 
var httpHeadersTests = []testCase{
12
 
        {
13
 
                Name: "httpheaders.0",
14
 
                In: `package headertest
15
 
 
16
 
import (
17
 
        "http"
18
 
)
19
 
 
20
 
type Other struct {
21
 
        Referer   string
22
 
        UserAgent string
23
 
        Cookie    []*http.Cookie
24
 
}
25
 
 
26
 
func f(req *http.Request, res *http.Response, other *Other) {
27
 
        _ = req.Referer
28
 
        _ = req.UserAgent
29
 
        _ = req.Cookie
30
 
 
31
 
        _ = res.Cookie
32
 
 
33
 
        _ = other.Referer
34
 
        _ = other.UserAgent
35
 
        _ = other.Cookie
36
 
 
37
 
        _ = req.Referer()
38
 
        _ = req.UserAgent()
39
 
        _ = req.Cookies()
40
 
        _ = res.Cookies()
41
 
}
42
 
`,
43
 
                Out: `package headertest
44
 
 
45
 
import (
46
 
        "http"
47
 
)
48
 
 
49
 
type Other struct {
50
 
        Referer   string
51
 
        UserAgent string
52
 
        Cookie    []*http.Cookie
53
 
}
54
 
 
55
 
func f(req *http.Request, res *http.Response, other *Other) {
56
 
        _ = req.Referer()
57
 
        _ = req.UserAgent()
58
 
        _ = req.Cookies()
59
 
 
60
 
        _ = res.Cookies()
61
 
 
62
 
        _ = other.Referer
63
 
        _ = other.UserAgent
64
 
        _ = other.Cookie
65
 
 
66
 
        _ = req.Referer()
67
 
        _ = req.UserAgent()
68
 
        _ = req.Cookies()
69
 
        _ = res.Cookies()
70
 
}
71
 
`,
72
 
        },
73
 
}