package bootstrapimpl

import (
	"strings"
	"testing"
)

func TestAutoNumberSeedLiveScanStaysOutOfSeedGodFile(t *testing.T) {
	root := "."
	seedSrc := readBootstrapSourceForStructure(t, root, "autonumber_seed.go")
	liveScanSrc := readBootstrapSourceForStructure(t, root, "autonumber_seed_live_scan.go")

	symbols := []string{
		"type legacyRowSampler struct",
		"func sqlRegexFromGoRegex(",
		"func deriveCounterRegex(",
		"func scanLiveMaxCounter(",
		"func scanLivePerPrefixCounters(",
		"func physicalColumnExists(",
	}

	for _, symbol := range symbols {
		if strings.Contains(seedSrc, symbol) {
			t.Fatalf("%s belongs in autonumber_seed_live_scan.go, not autonumber_seed.go", symbol)
		}
		if !strings.Contains(liveScanSrc, symbol) {
			t.Fatalf("%s missing from autonumber_seed_live_scan.go", symbol)
		}
	}
}
