Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2609)

Delta Between Two Patch Sets: src/cmd/gofix/imagecolor_test.go

Issue 5132048: code review 5132048: image: spin off a new color package out of the image pa... (Closed)
Left Patch Set: diff -r 087a4bd61f20 https://go.googlecode.com/hg/ Created 13 years, 5 months ago
Right Patch Set: diff -r e144a6dec55e https://go.googlecode.com/hg/ Created 13 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/gofix/imagecolor.go ('k') | src/cmd/gofix/imagenew_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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(colorTests)
9 }
10
11 var colorTests = []testCase{
12 {
13 Name: "color.0",
14 In: `package main
15
16 import (
17 "image"
18 )
19
20 var (
21 _ image.Image
22 _ image.RGBA
23 _ image.Black
24 _ image.Color
25 _ image.ColorModel
26 _ image.ColorModelFunc
27 _ image.PalettedColorModel
28 _ image.RGBAColor
29 _ image.RGBA64Color
30 _ image.NRGBAColor
31 _ image.NRGBA64Color
32 _ image.AlphaColor
33 _ image.Alpha16Color
34 _ image.GrayColor
35 _ image.Gray16Color
36 )
37
38 func f() {
39 _ = image.RGBAColorModel
40 _ = image.RGBA64ColorModel
41 _ = image.NRGBAColorModel
42 _ = image.NRGBA64ColorModel
43 _ = image.AlphaColorModel
44 _ = image.Alpha16ColorModel
45 _ = image.GrayColorModel
46 _ = image.Gray16ColorModel
47 }
48 `,
49 Out: `package main
50
51 import (
52 "image"
53 "image/color"
54 )
55
56 var (
57 _ image.Image
58 _ image.RGBA
59 _ image.Black
60 _ color.Color
61 _ color.Model
62 _ color.ModelFunc
63 _ color.Palette
64 _ color.RGBA
65 _ color.RGBA64
66 _ color.NRGBA
67 _ color.NRGBA64
68 _ color.Alpha
69 _ color.Alpha16
70 _ color.Gray
71 _ color.Gray16
72 )
73
74 func f() {
75 _ = color.RGBAModel
76 _ = color.RGBA64Model
77 _ = color.NRGBAModel
78 _ = color.NRGBA64Model
79 _ = color.AlphaModel
80 _ = color.Alpha16Model
81 _ = color.GrayModel
82 _ = color.Gray16Model
83 }
84 `,
85 },
86 {
87 Name: "color.1",
88 In: `package main
89
90 import (
91 "fmt"
92 "image"
93 )
94
95 func f() {
96 fmt.Println(image.RGBAColor{1, 2, 3, 4}.RGBA())
97 }
98 `,
99 Out: `package main
100
101 import (
102 "fmt"
103 "image/color"
104 )
105
106 func f() {
107 fmt.Println(color.RGBA{1, 2, 3, 4}.RGBA())
108 }
109 `,
110 },
111 {
112 Name: "color.2",
113 In: `package main
114
115 import "image"
116
117 var c *image.ColorImage = image.NewColorImage(nil)
118 `,
119 Out: `package main
120
121 import "image"
122
123 var c *image.Uniform = image.NewUniform(nil)
124 `,
125 },
126 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b