aboutsummaryrefslogtreecommitdiffstats
path: root/config/ui_test.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2024-01-06 17:40:33 +0100
committerRobin Jarry <robin@jarry.cc>2024-01-08 00:07:51 +0100
commitec0f4a50cf777895ff970fff2900265c8357c2bc (patch)
treef2ad11cc4281ef95ad0bb147cae883c7a572508a /config/ui_test.go
parentb76bf1b7eecfc885798385960b04b92cb62d75f0 (diff)
downloadaerc-ec0f4a50cf777895ff970fff2900265c8357c2bc.tar.gz
config: remove deprecated settings
Several settings have been deprecated a few versions ago and announced their removal in 0.17. Remove these deprecated sections and their uses. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config/ui_test.go')
-rw-r--r--config/ui_test.go65
1 files changed, 0 insertions, 65 deletions
diff --git a/config/ui_test.go b/config/ui_test.go
deleted file mode 100644
index 188fae01..00000000
--- a/config/ui_test.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package config
-
-import (
- "reflect"
- "testing"
- "text/template"
-
- "github.com/stretchr/testify/assert"
-)
-
-func templateText(t *template.Template) string {
- // unfortunately, the original template text is stored as a private
- // field, for test purposes, access its value via reflection
- v := reflect.ValueOf(t).Elem()
- return v.FieldByName("text").String()
-}
-
-func TestConvertIndexFormat(t *testing.T) {
- columns, err := convertIndexFormat("%-20.20D %-17.17n %Z %s")
- if err != nil {
- t.Fatal(err)
- }
- assert.Len(t, columns, 4)
-
- assert.Equal(t, "date", columns[0].Name)
- assert.Equal(t, 20.0, columns[0].Width)
- assert.Equal(t, ALIGN_LEFT|WIDTH_EXACT, columns[0].Flags)
- assert.Equal(t, `{{.DateAutoFormat .Date.Local}}`,
- templateText(columns[0].Template))
-
- assert.Equal(t, "name", columns[1].Name)
- assert.Equal(t, 17.0, columns[1].Width)
- assert.Equal(t, ALIGN_LEFT|WIDTH_EXACT, columns[1].Flags)
- assert.Equal(t, `{{index (.From | names) 0}}`,
- templateText(columns[1].Template))
-
- assert.Equal(t, "flags", columns[2].Name)
- assert.Equal(t, 4.0, columns[2].Width)
- assert.Equal(t, ALIGN_RIGHT|WIDTH_EXACT, columns[2].Flags)
- assert.Equal(t, `{{.Flags | join ""}}`,
- templateText(columns[2].Template))
-
- assert.Equal(t, "subject", columns[3].Name)
- assert.Equal(t, 0.0, columns[3].Width)
- assert.Equal(t, ALIGN_LEFT|WIDTH_AUTO, columns[3].Flags)
- assert.Equal(t, `{{.ThreadPrefix}}{{.Subject}}`, templateText(columns[3].Template))
-}
-
-func TestConvertDirlistFormat(t *testing.T) {
- left, right := convertDirlistFormat("%n %>r")
- assert.Equal(t, "{{.Folder}}", left)
- assert.Equal(t, unreadExists, right)
-
- left, right = convertDirlistFormat("%n %>r ")
- assert.Equal(t, "{{.Folder}}", left)
- assert.Equal(t, unreadExists, right)
-
- left, right = convertDirlistFormat("%r%>n")
- assert.Equal(t, unreadExists, left)
- assert.Equal(t, "{{.Folder}}", right)
-
- left, right = convertDirlistFormat("%>N")
- assert.Equal(t, "", left)
- assert.Equal(t, "{{.Folder | compactDir}}", right)
-}