GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( c0e633...6828f1 )
by Victor Hugo
01:13 queued 13s
created

pagination.TestExtractFromQueryParam   B

Complexity

Conditions 5

Size

Total Lines 37
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 28
dl 0
loc 37
rs 8.7413
c 0
b 0
f 0
nop 1
1
package pagination
2
3
import "testing"
4
5
func TestExtractFromQueryParam(t *testing.T) {
6
	type args struct {
7
		uri string
8
	}
9
	tests := []struct {
10
		name       string
11
		args       args
12
		wantLastID string
13
		wantErr    bool
14
	}{
15
		{
16
			name: "test extracts correct parameter",
17
			args: args{
18
				"https://api.mollie.com/v2/payments?from=tr_EkceGSH8Ga&limit=5",
19
			},
20
			wantLastID: "tr_EkceGSH8Ga",
21
			wantErr:    false,
22
		},
23
		{
24
			name: "test wrong url error parameter",
25
			args: args{
26
				"h%%s12",
27
			},
28
			wantLastID: "",
29
			wantErr:    true,
30
		},
31
	}
32
	for _, tt := range tests {
33
		t.Run(tt.name, func(t *testing.T) {
34
			gotLastID, err := ExtractFromQueryParam(tt.args.uri)
35
			t.Log(err)
36
			if (err != nil) != tt.wantErr {
37
				t.Errorf("ExtractFromQueryParam() error = %v, wantErr %v", err, tt.wantErr)
38
				return
39
			}
40
			if gotLastID != tt.wantLastID {
41
				t.Errorf("ExtractFromQueryParam() = %v, want %v", gotLastID, tt.wantLastID)
42
			}
43
		})
44
	}
45
}
46