Debian Codegraph @

uint16_test.go

raw symbols SCIP
1 // Copyright 2013 Google Inc. 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 getoptscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/
6
7 import (
8 "fmtscip-go gomod github.com/golang/go/src go1.13 fmt/"
9 "stringsscip-go gomod github.com/golang/go/src go1.13 strings/"
10 "testingscip-go gomod github.com/golang/go/src go1.13 testing/"
11 )
12
13 var uint16Testsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests. = []struct {
14 wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:where. string
15 inscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:in. []string
16 iscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:i. uint16
17 uint16scip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:uint16. uint16
18 errscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:err. string
19 }{
20 {
21 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
22 []string{},
23 17, 42,
24 "",
25 },
26 {
27 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
28 []string{"test", "-i", "1", "--uint16", "2"},
29 1, 2,
30 "",
31 },
32 {
33 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
34 []string{"test", "-i1", "--uint16=2"},
35 1, 2,
36 "",
37 },
38 {
39 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
40 []string{"test", "-i1", "-i2"},
41 2, 42,
42 "",
43 },
44 {
45 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
46 []string{"test", "-i=1"},
47 17, 42,
48 "test: not a valid number: =1\n",
49 },
50 {
51 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
52 []string{"test", "-i0x20"},
53 0x20, 42,
54 "",
55 },
56 {
57 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
58 []string{"test", "-i010"},
59 8, 42,
60 "",
61 },
62 }
63
64 func TestUint16scip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/TestUint16().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
65 for x, tt := range uint16Testsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests. {
66 resetscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/reset().()
67 i := Uint16scip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Uint16().('i', 17)
68 opt := Uint16Longscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Uint16Long().("uint16", 0, 42)
69 if stringsscip-go gomod github.com/golang/go/src go1.13 strings/.Indexscip-go gomod github.com/golang/go/src go1.13 strings/Index().(tt.wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:where., ":-") > 0 {
70 tt.wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:where. = fmtscip-go gomod github.com/golang/go/src go1.13 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.13 fmt/Sprintf().("#%d", x)
71 }
72
73 parsescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/parse().(tt.inscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:in.)
74 if s := checkErrorscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/checkError().(tt.errscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:err.); s != "" {
75 t.Errorfscip-go gomod github.com/golang/go/src go1.13 testing/common#Errorf().("%s: %s", tt.wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:where., s)
76 }
77 if got, want := *i, tt.iscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:i.; got != want {
78 t.Errorfscip-go gomod github.com/golang/go/src go1.13 testing/common#Errorf().("%s: got %v, want %v", tt.wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:where., got, want)
79 }
80 if got, want := *opt, tt.uint16scip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:uint16.; got != want {
81 t.Errorfscip-go gomod github.com/golang/go/src go1.13 testing/common#Errorf().("%s: got %v, want %v", tt.wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/uint16Tests:where., got, want)
82 }
83 }
84 }