package persistence

import (
	"fmt"
	"strings"
)

func expectSQLTokens(expectedSQL, actualSQL string) error {
	for _, token := range strings.Split(expectedSQL, ";;") {
		token = strings.TrimSpace(token)
		if token == "" {
			continue
		}
		if !strings.Contains(actualSQL, token) {
			return fmt.Errorf("actual SQL missing %q: %s", token, actualSQL)
		}
	}
	return nil
}
