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

« back to all changes in this revision

Viewing changes to src/cmd/fix/httpserver_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(httpserverTests, httpserver)
9
 
}
10
 
 
11
 
var httpserverTests = []testCase{
12
 
        {
13
 
                Name: "httpserver.0",
14
 
                In: `package main
15
 
 
16
 
import "http"
17
 
 
18
 
func f(xyz http.ResponseWriter, abc *http.Request, b string) {
19
 
        xyz.SetHeader("foo", "bar")
20
 
        xyz.SetHeader("baz", "")
21
 
        xyz.Hijack()
22
 
        xyz.Flush()
23
 
        go xyz.Hijack()
24
 
        defer xyz.Flush()
25
 
        _ = xyz.UsingTLS()
26
 
        _ = true == xyz.UsingTLS()
27
 
        _ = xyz.RemoteAddr()
28
 
        _ = xyz.RemoteAddr() == "hello"
29
 
        if xyz.UsingTLS() {
30
 
        }
31
 
}
32
 
`,
33
 
                Out: `package main
34
 
 
35
 
import "http"
36
 
 
37
 
func f(xyz http.ResponseWriter, abc *http.Request, b string) {
38
 
        xyz.Header().Set("foo", "bar")
39
 
        xyz.Header().Del("baz")
40
 
        xyz.(http.Hijacker).Hijack()
41
 
        xyz.(http.Flusher).Flush()
42
 
        go xyz.(http.Hijacker).Hijack()
43
 
        defer xyz.(http.Flusher).Flush()
44
 
        _ = abc.TLS != nil
45
 
        _ = true == (abc.TLS != nil)
46
 
        _ = abc.RemoteAddr
47
 
        _ = abc.RemoteAddr == "hello"
48
 
        if abc.TLS != nil {
49
 
        }
50
 
}
51
 
`,
52
 
        },
53
 
}