File: extractors_test.go

package info (click to toggle)
golang-github-go-ap-activitypub 0.0~git20250501.71edba4-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 920 kB
  • sloc: makefile: 26
file content (87 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package activitypub

import "testing"

func TestContentOf(t *testing.T) {
	tests := []struct {
		name string
		arg  Item
		want string
	}{
		{
			name: "empty",
			arg:  nil,
			want: "",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := ContentOf(tt.arg); got != tt.want {
				t.Errorf("ContentOf() = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestNameOf(t *testing.T) {
	tests := []struct {
		name string
		arg  Item
		want string
	}{
		{
			name: "empty",
			arg:  nil,
			want: "",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := NameOf(tt.arg); got != tt.want {
				t.Errorf("NameOf() = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestPreferredNameOf(t *testing.T) {
	tests := []struct {
		name string
		arg  Item
		want string
	}{
		{
			name: "empty",
			arg:  nil,
			want: "",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := PreferredNameOf(tt.arg); got != tt.want {
				t.Errorf("PreferredNameOf() = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestSummaryOf(t *testing.T) {
	tests := []struct {
		name string
		arg  Item
		want string
	}{
		{
			name: "empty",
			arg:  nil,
			want: "",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := SummaryOf(tt.arg); got != tt.want {
				t.Errorf("SummaryOf() = %v, want %v", got, tt.want)
			}
		})
	}
}