From 5a9531778b9e295f2a8f7bdc5818ac0c682063e0 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 10 Aug 2021 18:25:17 +0200 Subject: [PATCH] MarkdownToolbar: Add more tests I was sure this would fail, but it passes. Why am I getting errors in Sentry!! --- test/markdown_toolbar_test.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/markdown_toolbar_test.dart b/test/markdown_toolbar_test.dart index 484c4072..d15371d1 100644 --- a/test/markdown_toolbar_test.dart +++ b/test/markdown_toolbar_test.dart @@ -244,6 +244,22 @@ void main() { _testPrevWord(text, 5, 0); }); + test('Navigation with spaces', () { + const text = ' Hello '; + + _testNextWord(text, 0, 1); + _testNextWord(text, 3, 6); + _testNextWord(text, 6, 7); + _testNextWord(text, 7, 7); + _testNextWord(text, 8, 7); + + _testPrevWord(text, 0, 0); + _testPrevWord(text, 1, 0); + _testPrevWord(text, 3, 1); + _testPrevWord(text, 6, 1); + _testPrevWord(text, 7, 6); + }); + test('Navigation with multiple words', () { const text = 'Hello there Obiwan.';