aboutsummaryrefslogtreecommitdiffstats
path: root/commands/cmdtest/regex_test.go
blob: 7f2e75faa2f9b0d47e490ccf16d16f2f3fe96485 (plain) (blame)
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 cmdtest

import (
	"testing"

	"github.com/stretchr/testify/require"
)

func TestMakeExpectedRegex(t *testing.T) {
	cases := []struct {
		sub  string
		text string
	}{
		{ExpId, "d96dc877077a571414168c946eb013035888715b561e75682cfae9ef785e3227"},
		{ExpHumanId, "d96dc87"},
		{ExpTimestamp, "1674368486"},
		{ExpISO8601, "2023-01-22T07:21:26+01:00"},
	}

	for _, tc := range cases {
		t.Run(tc.sub, func(t *testing.T) {
			require.Regexp(t, MakeExpectedRegex(tc.text), tc.text)
		})
	}
}