| 1 | package semverscip-go gomod github.com/blang/semver . `github.com/blang/semver`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.12 testing/" |
| 5 | ) |
| 6 | |
| 7 | func prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().(s string) PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion# { |
| 8 | return PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{s, 0, false} |
| 9 | } |
| 10 | |
| 11 | func prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(i uint64) PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion# { |
| 12 | return PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{"", i, true} |
| 13 | } |
| 14 | |
| 15 | type formatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest# struct { |
| 16 | vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v. Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version# |
| 17 | resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result. string |
| 18 | } |
| 19 | |
| 20 | var formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests. = []formatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#{ |
| 21 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, "1.2.3"}, |
| 22 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, nil, nil}, "0.0.1"}, |
| 23 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("preview")}, []string{"123", "456"}}, "0.0.1-alpha.preview+123.456"}, |
| 24 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, []string{"123", "456"}}, "1.2.3-alpha.1+123.456"}, |
| 25 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, nil}, "1.2.3-alpha.1"}, |
| 26 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, []string{"123", "456"}}, "1.2.3+123.456"}, |
| 27 | // Prereleases and build metadata hyphens |
| 28 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("b-eta")}, []string{"123", "b-uild"}}, "1.2.3-alpha.b-eta+123.b-uild"}, |
| 29 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, []string{"123", "b-uild"}}, "1.2.3+123.b-uild"}, |
| 30 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("b-eta")}, nil}, "1.2.3-alpha.b-eta"}, |
| 31 | } |
| 32 | |
| 33 | var tolerantFormatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/tolerantFormatTests. = []formatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#{ |
| 34 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, "v1.2.3"}, |
| 35 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, nil}, "1.2.0-alpha"}, |
| 36 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 0, nil, nil}, "1.2.00"}, |
| 37 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, " 1.2.3 "}, |
| 38 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, "01.02.03"}, |
| 39 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 3, nil, nil}, "00.0.03"}, |
| 40 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 3, nil, nil}, "000.0.03"}, |
| 41 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 0, nil, nil}, "1.2"}, |
| 42 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, "1"}, |
| 43 | } |
| 44 | |
| 45 | func TestStringerscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestStringer().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 46 | for _, test := range formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests. { |
| 47 | if res := test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v..Stringscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#String().(); res != test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result. { |
| 48 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Stringer, expected %q but got %q", test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result., res) |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | func TestParsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestParse().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 54 | for _, test := range formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests. { |
| 55 | if v, err := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result.); err != nil { |
| 56 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Error parsing %q: %q", test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result., err) |
| 57 | } else if comp := v.Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v.); comp != 0 { |
| 58 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Parsing, expected %q but got %q, comp: %d ", test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v., v, comp) |
| 59 | } else if err := v.Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().(); err != nil { |
| 60 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Error validating parsed version %q: %q", test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v., err) |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func TestParseTolerantscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestParseTolerant().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 66 | for _, test := range tolerantFormatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/tolerantFormatTests. { |
| 67 | if v, err := ParseTolerantscip-go gomod github.com/blang/semver . `github.com/blang/semver`/ParseTolerant().(test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result.); err != nil { |
| 68 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Error parsing %q: %q", test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result., err) |
| 69 | } else if comp := v.Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v.); comp != 0 { |
| 70 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Parsing, expected %q but got %q, comp: %d ", test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v., v, comp) |
| 71 | } else if err := v.Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().(); err != nil { |
| 72 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Error validating parsed version %q: %q", test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v., err) |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | func TestMustParsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestMustParse().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 78 | _ = MustParsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/MustParse().("32.2.1-alpha") |
| 79 | } |
| 80 | |
| 81 | func TestMustParse_panicscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestMustParse_panic().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 82 | defer func() { |
| 83 | if recover() == nil { |
| 84 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Should have panicked") |
| 85 | } |
| 86 | }() |
| 87 | _ = MustParsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/MustParse().("invalid version") |
| 88 | } |
| 89 | |
| 90 | func TestValidatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestValidate().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 91 | for _, test := range formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests. { |
| 92 | if err := test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v..Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().(); err != nil { |
| 93 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Error validating %q: %q", test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v., err) |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | var finalizeVersionMethodscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeVersionMethod. = []formatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#{ |
| 99 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, "1.2.3"}, |
| 100 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, nil, nil}, "0.0.1"}, |
| 101 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("preview")}, []string{"123", "456"}}, "0.0.1"}, |
| 102 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, []string{"123", "456"}}, "1.2.3"}, |
| 103 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, nil}, "1.2.3"}, |
| 104 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, []string{"123", "456"}}, "1.2.3"}, |
| 105 | // Prereleases and build metadata hyphens |
| 106 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("b-eta")}, []string{"123", "b-uild"}}, "1.2.3"}, |
| 107 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, []string{"123", "b-uild"}}, "1.2.3"}, |
| 108 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("b-eta")}, nil}, "1.2.3"}, |
| 109 | } |
| 110 | |
| 111 | func TestFinalizeVersionMethodscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestFinalizeVersionMethod().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 112 | for _, test := range finalizeVersionMethodscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeVersionMethod. { |
| 113 | out := test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v..FinalizeVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#FinalizeVersion().() |
| 114 | if out != test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result. { |
| 115 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Finalized version error, expected %q but got %q", test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result., out) |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | type compareTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest# struct { |
| 121 | v1scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v1. Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version# |
| 122 | v2scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v2. Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version# |
| 123 | resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#result. int |
| 124 | } |
| 125 | |
| 126 | var compareTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTests. = []compareTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#{ |
| 127 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, 0}, |
| 128 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 0, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, 1}, |
| 129 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 0, nil, nil}, 0}, |
| 130 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 2, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 0, nil, nil}, 1}, |
| 131 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, nil, nil}, 0}, |
| 132 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 2, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 1, nil, nil}, 1}, |
| 133 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, 0}, |
| 134 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 2, 4, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 4, nil, nil}, 1}, |
| 135 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 3, 3, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, 1}, |
| 136 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 4, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, 1}, |
| 137 | |
| 138 | // Spec Examples #11 |
| 139 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 0, 0, nil, nil}, -1}, |
| 140 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 0, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 1, 0, nil, nil}, -1}, |
| 141 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 1, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 1, 1, nil, nil}, -1}, |
| 142 | |
| 143 | // Spec Examples #9 |
| 144 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, nil}, 1}, |
| 145 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, nil}, -1}, |
| 146 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta")}, nil}, -1}, |
| 147 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha"), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta")}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta")}, nil}, -1}, |
| 148 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta")}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(2)}, nil}, -1}, |
| 149 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(2)}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(11)}, nil}, -1}, |
| 150 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("beta"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(11)}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("rc"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, nil}, -1}, |
| 151 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("rc"), prnumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prnum().(1)}, nil}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, -1}, |
| 152 | |
| 153 | // Ignore Build metadata |
| 154 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, []string{"1", "2", "3"}}, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}, 0}, |
| 155 | } |
| 156 | |
| 157 | func TestComparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestCompare().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 158 | for _, test := range compareTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTests. { |
| 159 | if res := test.v1scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v1..Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(test.v2scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v2.); res != test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#result. { |
| 160 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Comparing %q : %q, expected %d but got %d", test.v1scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v1., test.v2scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v2., test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#result., res) |
| 161 | } |
| 162 | // Test counterpart |
| 163 | if res := test.v2scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v2..Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(test.v1scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v1.); res != -test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#result. { |
| 164 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Comparing %q : %q, expected %d but got %d", test.v2scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v2., test.v1scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v1., -test.resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#result., res) |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | type wrongformatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest# struct { |
| 170 | vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#v. *Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version# |
| 171 | strscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#str. string |
| 172 | } |
| 173 | |
| 174 | var wrongformatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTests. = []wrongformatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#{ |
| 175 | {nil, ""}, |
| 176 | {nil, "."}, |
| 177 | {nil, "1."}, |
| 178 | {nil, ".1"}, |
| 179 | {nil, "a.b.c"}, |
| 180 | {nil, "1.a.b"}, |
| 181 | {nil, "1.1.a"}, |
| 182 | {nil, "1.a.1"}, |
| 183 | {nil, "a.1.1"}, |
| 184 | {nil, ".."}, |
| 185 | {nil, "1.."}, |
| 186 | {nil, "1.1."}, |
| 187 | {nil, "1..1"}, |
| 188 | {nil, "1.1.+123"}, |
| 189 | {nil, "1.1.-beta"}, |
| 190 | {nil, "-1.1.1"}, |
| 191 | {nil, "1.-1.1"}, |
| 192 | {nil, "1.1.-1"}, |
| 193 | // giant numbers |
| 194 | {nil, "20000000000000000000.1.1"}, |
| 195 | {nil, "1.20000000000000000000.1"}, |
| 196 | {nil, "1.1.20000000000000000000"}, |
| 197 | {nil, "1.1.1-20000000000000000000"}, |
| 198 | // Leading zeroes |
| 199 | {nil, "01.1.1"}, |
| 200 | {nil, "001.1.1"}, |
| 201 | {nil, "1.01.1"}, |
| 202 | {nil, "1.001.1"}, |
| 203 | {nil, "1.1.01"}, |
| 204 | {nil, "1.1.001"}, |
| 205 | {nil, "1.1.1-01"}, |
| 206 | {nil, "1.1.1-001"}, |
| 207 | {nil, "1.1.1-beta.01"}, |
| 208 | {nil, "1.1.1-beta.001"}, |
| 209 | {&Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("!")}, nil}, "0.0.0-!"}, |
| 210 | {&Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 0, nil, []string{"!"}}, "0.0.0+!"}, |
| 211 | // empty prversion |
| 212 | {&Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().(""), prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, nil}, "0.0.0-.alpha"}, |
| 213 | // empty build meta data |
| 214 | {&Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, []string{""}}, "0.0.0-alpha+"}, |
| 215 | {&Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, []string{"test", ""}}, "0.0.0-alpha+test."}, |
| 216 | } |
| 217 | |
| 218 | func TestWrongFormatscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestWrongFormat().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 219 | for _, test := range wrongformatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTests. { |
| 220 | |
| 221 | if res, err := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(test.strscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#str.); err == nil { |
| 222 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Parsing wrong format version %q, expected error but got %q", test.strscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#str., res) |
| 223 | } |
| 224 | |
| 225 | if test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#v. != nil { |
| 226 | if err := test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#v..Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().(); err == nil { |
| 227 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Validating wrong format version %q (%q), expected error", test.vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#v., test.strscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#str.) |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | var wrongTolerantFormatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongTolerantFormatTests. = []wrongformatTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#{ |
| 234 | {nil, "1.0+abc"}, |
| 235 | {nil, "1.0-rc.1"}, |
| 236 | } |
| 237 | |
| 238 | func TestWrongTolerantFormatscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestWrongTolerantFormat().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 239 | for _, test := range wrongTolerantFormatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongTolerantFormatTests. { |
| 240 | if res, err := ParseTolerantscip-go gomod github.com/blang/semver . `github.com/blang/semver`/ParseTolerant().(test.strscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#str.); err == nil { |
| 241 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Parsing wrong format version %q, expected error but got %q", test.strscip-go gomod github.com/blang/semver . `github.com/blang/semver`/wrongformatTest#str., res) |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | func TestCompareHelperscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestCompareHelper().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 247 | v := Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, []PRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#{prstrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/prstr().("alpha")}, nil} |
| 248 | v1 := Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil} |
| 249 | if !v.EQscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#EQ().(v) { |
| 250 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be equal to %q", v, v) |
| 251 | } |
| 252 | if !v.Equalsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Equals().(v) { |
| 253 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be equal to %q", v, v) |
| 254 | } |
| 255 | if !v1.NEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#NE().(v) { |
| 256 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should not be equal to %q", v1, v) |
| 257 | } |
| 258 | if !v.GTEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#GTE().(v) { |
| 259 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be greater than or equal to %q", v, v) |
| 260 | } |
| 261 | if !v.LTEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#LTE().(v) { |
| 262 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be less than or equal to %q", v, v) |
| 263 | } |
| 264 | if !v.LTscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#LT().(v1) { |
| 265 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be less than %q", v, v1) |
| 266 | } |
| 267 | if !v.LTEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#LTE().(v1) { |
| 268 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be less than or equal %q", v, v1) |
| 269 | } |
| 270 | if !v.LEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#LE().(v1) { |
| 271 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be less than or equal %q", v, v1) |
| 272 | } |
| 273 | if !v1.GTscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#GT().(v) { |
| 274 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be greater than %q", v1, v) |
| 275 | } |
| 276 | if !v1.GTEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#GTE().(v) { |
| 277 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be greater than or equal %q", v1, v) |
| 278 | } |
| 279 | if !v1.GEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#GE().(v) { |
| 280 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("%q should be greater than or equal %q", v1, v) |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | const ( |
| 285 | MAJORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MAJOR. = iota |
| 286 | MINORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MINOR. |
| 287 | PATCHscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PATCH. |
| 288 | ) |
| 289 | |
| 290 | type incrementTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest# struct { |
| 291 | versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version. Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version# |
| 292 | incrementTypescip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#incrementType. int |
| 293 | expectingErrorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectingError. bool |
| 294 | expectedVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectedVersion. Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version# |
| 295 | } |
| 296 | |
| 297 | var incrementTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTests. = []incrementTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#{ |
| 298 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, PATCHscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PATCH., false, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 4, nil, nil}}, |
| 299 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, MINORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MINOR., false, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 3, 0, nil, nil}}, |
| 300 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}, MAJORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MAJOR., false, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{2, 0, 0, nil, nil}}, |
| 301 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 2, nil, nil}, PATCHscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PATCH., false, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 3, nil, nil}}, |
| 302 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 2, nil, nil}, MINORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MINOR., false, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 2, 0, nil, nil}}, |
| 303 | {Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{0, 1, 2, nil, nil}, MAJORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MAJOR., false, Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 0, 0, nil, nil}}, |
| 304 | } |
| 305 | |
| 306 | func TestIncrementsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestIncrements().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 307 | for _, test := range incrementTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTests. { |
| 308 | var originalVersion = Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{ |
| 309 | test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..Majorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Major., |
| 310 | test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..Minorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Minor., |
| 311 | test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..Patchscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Patch., |
| 312 | test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..Prescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Pre., |
| 313 | test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..Buildscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Build., |
| 314 | } |
| 315 | var err error |
| 316 | switch test.incrementTypescip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#incrementType. { |
| 317 | case PATCHscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PATCH.: |
| 318 | err = test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..IncrementPatchscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#IncrementPatch().() |
| 319 | case MINORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MINOR.: |
| 320 | err = test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..IncrementMinorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#IncrementMinor().() |
| 321 | case MAJORscip-go gomod github.com/blang/semver . `github.com/blang/semver`/MAJOR.: |
| 322 | err = test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..IncrementMajorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#IncrementMajor().() |
| 323 | } |
| 324 | if test.expectingErrorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectingError. { |
| 325 | if err != nil { |
| 326 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Increment version, expecting %q, got error %q", test.expectedVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectedVersion., err) |
| 327 | } |
| 328 | if test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..EQscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#EQ().(originalVersion) { |
| 329 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Increment version, expecting %q, got %q", test.expectedVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectedVersion., test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version.) |
| 330 | } |
| 331 | } else { |
| 332 | if (err != nil) && !test.expectingErrorscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectingError. { |
| 333 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Increment version %q, not expecting error, got %q", test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version., err) |
| 334 | } |
| 335 | if test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version..NEscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#NE().(test.expectedVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectedVersion.) { |
| 336 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Increment version, expecting %q, got %q", test.expectedVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#expectedVersion., test.versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/incrementTest#version.) |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | func TestPreReleaseVersionsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestPreReleaseVersions().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 343 | p1, err := NewPRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/NewPRVersion().("123") |
| 344 | if !p1.IsNumericscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#IsNumeric().() { |
| 345 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Expected numeric prversion, got %q", p1) |
| 346 | } |
| 347 | if p1.VersionNumscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#VersionNum. != 123 { |
| 348 | t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Wrong prversion number") |
| 349 | } |
| 350 | if err != nil { |
| 351 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Not expected error %q", err) |
| 352 | } |
| 353 | p2, err := NewPRVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/NewPRVersion().("alpha") |
| 354 | if p2.IsNumericscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#IsNumeric().() { |
| 355 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Expected non-numeric prversion, got %q", p2) |
| 356 | } |
| 357 | if p2.VersionStrscip-go gomod github.com/blang/semver . `github.com/blang/semver`/PRVersion#VersionStr. != "alpha" { |
| 358 | t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Wrong prversion string") |
| 359 | } |
| 360 | if err != nil { |
| 361 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Not expected error %q", err) |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | func TestBuildMetaDataVersionsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestBuildMetaDataVersions().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 366 | _, err := NewBuildVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/NewBuildVersion().("123") |
| 367 | if err != nil { |
| 368 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Unexpected error %q", err) |
| 369 | } |
| 370 | |
| 371 | _, err = NewBuildVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/NewBuildVersion().("build") |
| 372 | if err != nil { |
| 373 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Unexpected error %q", err) |
| 374 | } |
| 375 | |
| 376 | _, err = NewBuildVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/NewBuildVersion().("test?") |
| 377 | if err == nil { |
| 378 | t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Expected error, got none") |
| 379 | } |
| 380 | |
| 381 | _, err = NewBuildVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/NewBuildVersion().("") |
| 382 | if err == nil { |
| 383 | t.Errorscip-go gomod github.com/golang/go/src go1.12 testing/common#Error().("Expected error, got none") |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | func TestNewHelperscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestNewHelper().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 388 | v, err := Newscip-go gomod github.com/blang/semver . `github.com/blang/semver`/New().("1.2.3") |
| 389 | if err != nil { |
| 390 | t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("Unexpected error %q", err) |
| 391 | } |
| 392 | |
| 393 | // New returns pointer |
| 394 | if v == nil { |
| 395 | t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().("Version is nil") |
| 396 | } |
| 397 | if v.Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}) != 0 { |
| 398 | t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().("Unexpected comparison problem") |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func TestMakeHelperscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestMakeHelper().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 403 | v, err := Makescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Make().("1.2.3") |
| 404 | if err != nil { |
| 405 | t.Fatalfscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatalf().("Unexpected error %q", err) |
| 406 | } |
| 407 | if v.Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(Versionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#{1, 2, 3, nil, nil}) != 0 { |
| 408 | t.Fatalscip-go gomod github.com/golang/go/src go1.12 testing/common#Fatal().("Unexpected comparison problem") |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | type finalizeTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest# struct { |
| 413 | inputscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest#input. string |
| 414 | outputscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest#output. string |
| 415 | } |
| 416 | |
| 417 | var finalizeTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTests. = []finalizeTestscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest#{ |
| 418 | {"", ""}, |
| 419 | {"1.2.3", "1.2.3"}, |
| 420 | {"0.0.1", "0.0.1"}, |
| 421 | {"0.0.1-alpha.preview+123.456", "0.0.1"}, |
| 422 | {"1.2.3-alpha.1+123.456", "1.2.3"}, |
| 423 | {"1.2.3-alpha.1", "1.2.3"}, |
| 424 | {"1.2.3+123.456", "1.2.3"}, |
| 425 | {"1.2.3-alpha.b-eta+123.b-uild", "1.2.3"}, |
| 426 | {"1.2.3+123.b-uild", "1.2.3"}, |
| 427 | {"1.2.3-alpha.b-eta", "1.2.3"}, |
| 428 | {"1.2-alpha", ""}, |
| 429 | } |
| 430 | |
| 431 | func TestFinalizeVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/TestFinalizeVersion().(t *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Tscip-go gomod github.com/golang/go/src go1.12 testing/T#) { |
| 432 | for _, test := range finalizeTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTests. { |
| 433 | finalVer, err := FinalizeVersionscip-go gomod github.com/blang/semver . `github.com/blang/semver`/FinalizeVersion().(test.inputscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest#input.) |
| 434 | if finalVer == "" { |
| 435 | if err == nil { |
| 436 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Finalize Version error, expected error but got nil") |
| 437 | } |
| 438 | } else if finalVer != test.outputscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest#output. && err != nil { |
| 439 | t.Errorfscip-go gomod github.com/golang/go/src go1.12 testing/common#Errorf().("Finalize Version error expected %q but got %q", test.outputscip-go gomod github.com/blang/semver . `github.com/blang/semver`/finalizeTest#output., finalVer) |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | func BenchmarkParseSimplescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkParseSimple().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 445 | const VERSION = "0.0.1" |
| 446 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 447 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 448 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 449 | _, _ = Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 450 | } |
| 451 | } |
| 452 | |
| 453 | func BenchmarkParseComplexscip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkParseComplex().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 454 | const VERSION = "0.0.1-alpha.preview+123.456" |
| 455 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 456 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 457 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 458 | _, _ = Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 459 | } |
| 460 | } |
| 461 | |
| 462 | func BenchmarkParseAveragescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkParseAverage().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 463 | l := len(formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests.) |
| 464 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 465 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 466 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 467 | _, _ = Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests.[n%l].resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result.) |
| 468 | } |
| 469 | } |
| 470 | |
| 471 | func BenchmarkParseTolerantAveragescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkParseTolerantAverage().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 472 | l := len(tolerantFormatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/tolerantFormatTests.) |
| 473 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 474 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 475 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 476 | _, _ = ParseTolerantscip-go gomod github.com/blang/semver . `github.com/blang/semver`/ParseTolerant().(tolerantFormatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/tolerantFormatTests.[n%l].resultscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#result.) |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | func BenchmarkStringSimplescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkStringSimple().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 481 | const VERSION = "0.0.1" |
| 482 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 483 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 484 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 485 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 486 | _ = v.Stringscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#String().() |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | func BenchmarkStringLargerscip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkStringLarger().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 491 | const VERSION = "11.15.2012" |
| 492 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 493 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 494 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 495 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 496 | _ = v.Stringscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#String().() |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | func BenchmarkStringComplexscip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkStringComplex().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 501 | const VERSION = "0.0.1-alpha.preview+123.456" |
| 502 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 503 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 504 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 505 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 506 | _ = v.Stringscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#String().() |
| 507 | } |
| 508 | } |
| 509 | |
| 510 | func BenchmarkStringAveragescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkStringAverage().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 511 | l := len(formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests.) |
| 512 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 513 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 514 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 515 | _ = formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests.[n%l].vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v..Stringscip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#String().() |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | func BenchmarkValidateSimplescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkValidateSimple().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 520 | const VERSION = "0.0.1" |
| 521 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 522 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 523 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 524 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 525 | _ = v.Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().() |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | func BenchmarkValidateComplexscip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkValidateComplex().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 530 | const VERSION = "0.0.1-alpha.preview+123.456" |
| 531 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 532 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 533 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 534 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 535 | _ = v.Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().() |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | func BenchmarkValidateAveragescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkValidateAverage().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 540 | l := len(formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests.) |
| 541 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 542 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 543 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 544 | _ = formatTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTests.[n%l].vscip-go gomod github.com/blang/semver . `github.com/blang/semver`/formatTest#v..Validatescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Validate().() |
| 545 | } |
| 546 | } |
| 547 | |
| 548 | func BenchmarkCompareSimplescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkCompareSimple().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 549 | const VERSION = "0.0.1" |
| 550 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 551 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 552 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 553 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 554 | v.Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(v) |
| 555 | } |
| 556 | } |
| 557 | |
| 558 | func BenchmarkCompareComplexscip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkCompareComplex().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 559 | const VERSION = "0.0.1-alpha.preview+123.456" |
| 560 | v, _ := Parsescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Parse().(VERSION) |
| 561 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 562 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 563 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 564 | v.Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().(v) |
| 565 | } |
| 566 | } |
| 567 | |
| 568 | func BenchmarkCompareAveragescip-go gomod github.com/blang/semver . `github.com/blang/semver`/BenchmarkCompareAverage().(b *testingscip-go gomod github.com/golang/go/src go1.12 testing/.Bscip-go gomod github.com/golang/go/src go1.12 testing/B#) { |
| 569 | l := len(compareTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTests.) |
| 570 | b.ReportAllocsscip-go gomod github.com/golang/go/src go1.12 testing/B#ReportAllocs().() |
| 571 | b.ResetTimerscip-go gomod github.com/golang/go/src go1.12 testing/B#ResetTimer().() |
| 572 | for n := 0; n < b.Nscip-go gomod github.com/golang/go/src go1.12 testing/B#N.; n++ { |
| 573 | compareTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTests.[n%l].v1scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v1..Comparescip-go gomod github.com/blang/semver . `github.com/blang/semver`/Version#Compare().((compareTestsscip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTests.[n%l].v2scip-go gomod github.com/blang/semver . `github.com/blang/semver`/compareTest#v2.)) |
| 574 | } |
| 575 | } |