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

Delta Between Two Patch Sets: src/pkg/json/tags_test.go

Issue 4918051: code review 4918051: json: add struct tag option to wrap literals in strings (Closed)
Left Patch Set: diff -r 7860bad4407f https://go.googlecode.com/hg/ Created 12 years, 7 months ago
Right Patch Set: diff -r 73c091a3fc96 https://go.googlecode.com/hg Created 12 years, 7 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/pkg/json/tags.go ('k') | no next file » | 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 json
6
7 import (
8 "testing"
9 )
10
11 func TestTagParsing(t *testing.T) {
12 name, opts := parseTag("field,foobar,foo")
13 if name != "field" {
14 t.Fatalf("name = %q, want field", name)
15 }
16 for _, tt := range []struct {
17 opt string
18 want bool
19 }{
20 {"foobar", true},
21 {"foo", true},
22 {"bar", false},
23 } {
24 if opts.Contains(tt.opt) != tt.want {
25 t.Errorf("Contains(%q) = %v", tt.opt, !tt.want)
26 }
27 }
28 }
LEFTRIGHT

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