diff options
author | Moritz Poldrack <git@moritz.sh> | 2024-01-06 17:40:33 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-01-08 00:07:51 +0100 |
commit | ec0f4a50cf777895ff970fff2900265c8357c2bc (patch) | |
tree | f2ad11cc4281ef95ad0bb147cae883c7a572508a /config/ui_test.go | |
parent | b76bf1b7eecfc885798385960b04b92cb62d75f0 (diff) | |
download | aerc-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.go | 65 |
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) -} |