Debian Codegraph @

signed_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 signedNumberTestsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests. = []struct {
14 wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:where. string
15 inscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:in. []string
16 lscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:l. SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#
17 outscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:out. int64
18 errscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:err. string
19 }{
20 {
21 wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:where.: locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
22 },
23 {
24 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
25 []string{"test", "-n", "1010"},
26 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Basescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Base.: 2, Bitsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Bits.: 5},
27 10,
28 "",
29 },
30 {
31 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
32 []string{"test", "-n", "1010"},
33 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Basescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Base.: 2, Bitsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Bits.: 4},
34 0,
35 "test: value out of range: 1010\n",
36 },
37 {
38 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
39 []string{"test", "-n", "-1000"},
40 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Basescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Base.: 2, Bitsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Bits.: 4},
41 -8,
42 "",
43 },
44 {
45 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
46 []string{"test", "-n", "3"},
47 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Minscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Min.: 4, Maxscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Max.: 6},
48 0,
49 "test: value out of range (<4): 3\n",
50 },
51 {
52 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
53 []string{"test", "-n", "4"},
54 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Minscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Min.: 4, Maxscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Max.: 6},
55 4,
56 "",
57 },
58 {
59 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
60 []string{"test", "-n", "5"},
61 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Minscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Min.: 4, Maxscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Max.: 6},
62 5,
63 "",
64 },
65 {
66 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
67 []string{"test", "-n", "6"},
68 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Minscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Min.: 4, Maxscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Max.: 6},
69 6,
70 "",
71 },
72 {
73 locscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/loc().(),
74 []string{"test", "-n", "7"},
75 SignedLimitscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#{Minscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Min.: 4, Maxscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/SignedLimit#Max.: 6},
76 0,
77 "test: value out of range (>6): 7\n",
78 },
79 }
80
81 func TestSignedsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/TestSigneds().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) {
82 for x, tt := range signedNumberTestsscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests. {
83 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`/signedNumberTests:where., ":-") > 0 {
84 tt.wherescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests: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)
85 }
86
87 resetscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/reset().()
88 n := Signedscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/Signed().('n', 0, &tt.lscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:l.)
89 parsescip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/parse().(tt.inscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:in.)
90 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`/signedNumberTests:err.); s != "" {
91 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`/signedNumberTests:where., s)
92 }
93 if *n != tt.outscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:out. {
94 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`/signedNumberTests:where., *n, tt.outscip-go gomod github.com/pborman/getopt . `github.com/pborman/getopt`/signedNumberTests:out.)
95 }
96 }
97 }