tests(aa): improve rules unit tests.

This commit is contained in:
Alexandre Pujol 2024-05-29 21:17:21 +01:00
parent 23eaa20fb7
commit 5f64bb4e0c
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
3 changed files with 441 additions and 661 deletions

View file

@ -12,7 +12,7 @@ import (
)
func Test_tokenizeRule(t *testing.T) {
for _, tt := range testRules {
for _, tt := range testTokenRules {
t.Run(tt.name, func(t *testing.T) {
if got := tokenize(tt.raw); !reflect.DeepEqual(got, tt.tokens) {
t.Errorf("tokenize() = %v, want %v", got, tt.tokens)
@ -37,7 +37,7 @@ func Test_AppArmorProfileFile_Parse(t *testing.T) {
var (
// Test cases for tokenize
testRules = []struct {
testTokenRules = []struct {
name string
raw string
tokens []string