PR tree-optimization/86274 - SEGFAULT when logging std::to_string(NAN)
[official-gcc.git] / libgo / go / encoding / json / tags_test.go
blob8ba8ddd5f805867ab8865dc4320d1e8e88799f9b
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.
5 package json
7 import (
8 "testing"
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)
16 for _, tt := range []struct {
17 opt string
18 want bool
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)