sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 0f3e15ee8aee0477acebe0b0c221c3693d42e976
parent 1aac9d43889f0f4f4420d3632f6cc8e7ac8cd639
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun, 17 Apr 2022 18:39:32 +1000

add a test case for sources with invalid URI characters

Since commit 3dbb5444 sup-add will just pass through the invalid URI
characters and emit them in sources.yaml. The path component will be URI
encoded/decoded at runtime through sup's convoluted handling of source
URIs.

Relates to #545.

Diffstat:
M test/integration/test_sup-add.rb | 17 +++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/test/integration/test_sup-add.rb b/test/integration/test_sup-add.rb
@@ -57,4 +57,21 @@ EOS
 EOS
   end
 
+  ## https://github.com/sup-heliotrope/sup/issues/545
+  def test_source_with_invalid_uri_chars_in_path
+    assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:~/.mail/gmail/[Gmail]/.All Mail/")
+
+    generated_sources_yaml = File.read "#{@path}/sources.yaml"
+    assert_equal <<EOS, generated_sources_yaml
+---
+- !<tag:supmua.org,2006-10-01/Redwood/Maildir>
+  uri: maildir:~/.mail/gmail/[Gmail]/.All Mail/
+  usual: true
+  archived: false
+  sync_back: true
+  id: 1
+  labels: []
+EOS
+  end
+
 end