You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: filter_patterns_test.go
    path of file: ./repos/restic/internal/filter
    
    the code of the file until where you have to start completion: package filter_test

import (
	"testing"

	"github.com/restic/restic/internal/filter"
	rtest "github.com/restic/restic/internal/test"
)

func TestValidPatterns(t *testing.T) {
	// Test invalid patterns are detected and returned
	t.Run("detect-invalid-patterns", func(t *testing.T) {
		err := filter.ValidatePatterns([]string{"*.foo", "*[._]log[.-][0-9]", "!*[._]log[.-][0-9]"})

		rtest.Assert(t, err != nil, "Expected invalid patterns to be detected")

		if ip, ok := err.(*filter.InvalidPatternError); ok {
			rtest.Equals(t, ip.InvalidPatterns, []string{"*[._]log[.-][0-9]", "!*[._]log[.-][0-9]"})
		} else {
			t.Errorf("wrong error type %v", err)
		}
	})

	// Test all patterns defined in matchTests are valid
	patterns := make([]string,
    
func TestValidPatterns(t *testing.T) {
	// Test invalid patterns are detected and returned
	t.Run("detect-invalid-patterns", func(t *testing.T) {
		err := filter.ValidatePatterns([]string{"*.foo", "*[._]log[.-][0-9]", "!*[._]log[.-][0-9]"})

		rtest.Assert(t, err != nil, "Expected invalid patterns to be detected")

		if ip, ok := err.(*filter.InvalidPatternError); ok {
			rtest.Equals(t, ip.InvalidPatterns, []string{"*[._]log[.-][0-9]", "!*[._]log[.-][0-9]"})
		} else {
			t.Errorf("wrong error type %v", err)
		}
	})

	// Test all patterns defined in matchTests are valid
	patterns := make([]string, 0)

	for _, data := range matchTests {
		patterns = append(patterns, data.pattern)
	}

	t.Run("validate-patterns", func(t *testing.T) {
		err := filter.ValidatePatterns(patterns)

		if err != nil {
			t.Error(err)
		}
	})

	// Test all patterns defined in childMatchTests are valid
	childPatterns := make([]string, 0)

	for _, data := range childMatchTests {
		childPatterns = append(childPatterns, data.pattern)
	}

	t.Run("validate-child-patterns", func(t *testing.T) {
		err := filter.ValidatePatterns(childPatterns)

		if err != nil {
			t.Error(err)
		}
	})
}