File: category_test.go

package info (click to toggle)
golang-github-getsentry-sentry-go 0.29.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,404 kB
  • sloc: makefile: 75; sh: 21
file content (25 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (2)
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
package ratelimit

import "testing"

func TestCategoryString(t *testing.T) {
	tests := []struct {
		Category
		want string
	}{
		{CategoryAll, "CategoryAll"},
		{CategoryError, "CategoryError"},
		{CategoryTransaction, "CategoryTransaction"},
		{Category("unknown"), "CategoryUnknown"},
		{Category("two words"), "CategoryTwoWords"},
	}
	for _, tt := range tests {
		tt := tt
		t.Run(tt.want, func(t *testing.T) {
			got := tt.Category.String()
			if got != tt.want {
				t.Errorf("got %q, want %q", got, tt.want)
			}
		})
	}
}