From a1ad188326f9af633d2be0920a140275a4972bfe Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 2 Jun 2020 23:20:19 +0100 Subject: Fix chardet test and add ordering option (#11621) * Fix chardet test and add ordering option Signed-off-by: Andrew Thornton * minor fixes Signed-off-by: Andrew Thornton * remove log Signed-off-by: Andrew Thornton * remove log2 Signed-off-by: Andrew Thornton * only iterate through top results Signed-off-by: Andrew Thornton * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md * slight restructure of for loop Signed-off-by: Andrew Thornton Co-authored-by: techknowlogick --- modules/charset/charset_test.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/charset/charset_test.go') diff --git a/modules/charset/charset_test.go b/modules/charset/charset_test.go index a81a6e03ee..394a42c71f 100644 --- a/modules/charset/charset_test.go +++ b/modules/charset/charset_test.go @@ -230,7 +230,11 @@ func TestDetectEncoding(t *testing.T) { // we accept either. assert.Contains(t, encoding, "ISO-8859") + old := setting.Repository.AnsiCharset setting.Repository.AnsiCharset = "placeholder" + defer func() { + setting.Repository.AnsiCharset = old + }() testSuccess(b, "placeholder") // invalid bytes -- cgit v1.2.3