From d7912a48c447233a3fddf175f8ed4fac72cf9606 Mon Sep 17 00:00:00 2001 From: Ori Braunshtein Date: Tue, 22 Dec 2020 13:10:01 +0200 Subject: [PATCH] fixed markdown order shuffling every run --- cnf-tests/docgen/cmd/generate.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cnf-tests/docgen/cmd/generate.go b/cnf-tests/docgen/cmd/generate.go index 20badf687a..b0d99f19a4 100644 --- a/cnf-tests/docgen/cmd/generate.go +++ b/cnf-tests/docgen/cmd/generate.go @@ -124,10 +124,11 @@ func descriptionsToList(descriptions map[string]string, matcher func(string) boo if !matcher(n) { continue } - i := sort.Search(len(res), func(i int) bool { return res[i].Name >= n }) + sanitizedName := sanitizeName(n) + i := sort.Search(len(res), func(i int) bool { return res[i].Name >= sanitizedName }) res = append(res, TestDescription{}) copy(res[i+1:], res[i:]) - res[i] = TestDescription{sanitizeName(n), d} + res[i] = TestDescription{sanitizedName, d} } return res }