mu-message-part: rework cooked_filename a bit

Improve working, add a 'minimal' mode, and add some unit tests.
This commit is contained in:
Dirk-Jan C. Binnema
2023-02-19 10:47:50 +02:00
parent 558745bf00
commit 6da223fcb6
4 changed files with 121 additions and 45 deletions

View File

@ -235,7 +235,7 @@ World!
{
auto&& part{message->parts().at(2)};
assert_equal(part.raw_filename().value(), "/tmp/file-02.bin");
assert_equal(part.cooked_filename().value(), "tmp-file-02.bin");
assert_equal(part.cooked_filename().value(), "file-02.bin");
assert_equal(part.mime_type().value(), "audio/ogg");
// file consistso of 4 bytes 4..7
assert_equal(part.to_string().value(), "\004\005\006\007");