MCPcopy Create free account
hub / github.com/ethereum/node-crawler / TestParseVersionString

Function TestParseVersionString

pkg/vparser/vparser_test.go:8–152  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestParseVersionString(t *testing.T) {
9 type ParseTestCase struct {
10 name string
11 args string
12 want *ParsedInfo
13 }
14
15 var test_data = []ParseTestCase{
16 {
17 name: "single",
18 args: "geth",
19 want: &ParsedInfo{
20 Name: "geth",
21 },
22 },
23 {
24 name: "perfect-case",
25 args: "Geth/v1.10.3-stable-991384a7/linux-amd64/go1.16.3",
26 want: &ParsedInfo{
27 Name: "geth",
28 Version: Version{
29 Major: 1,
30 Minor: 10,
31 Patch: 3,
32 Tag: "stable",
33 Build: "991384a7",
34 },
35 Os: OSInfo{
36 Os: "linux",
37 Architecture: "amd64",
38 },
39 Language: LanguageInfo{
40 Name: "go",
41 Version: "1.16.3",
42 },
43 },
44 },
45 {
46 name: "without-build",
47 args: "Geth/v1.10.4-stable/linux-x64/go1.16.4",
48 want: &ParsedInfo{
49 Name: "geth",
50 Version: Version{
51 Major: 1,
52 Minor: 10,
53 Patch: 4,
54 Tag: "stable",
55 },
56 Os: OSInfo{
57 Os: "linux",
58 Architecture: "x64",
59 },
60 Language: LanguageInfo{
61 Name: "go",
62 Version: "1.16.4",
63 },
64 },
65 },

Callers

nothing calls this directly

Calls 2

ParseVersionStringFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected