A little improvement for repeated character handling.
This commit is contained in:
1 parent
36736725ea
commit
2c893dccb9
4 files changed
+55
-14
No files matched your search
@@ -73,6 +73,29 @@ func TestSpeechKeepsEmbeddedPunctuationAndOriginalClipboardText(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDiffstatSpeechKeepsOriginalClipboardText(t *testing.T) {
|
||||
processor, _, err := punctuation.Load([]string{"../../config/punctuation/default.toml"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
settings := config.Defaults()
|
||||
settings.Reading.RepeatedSymbols = true
|
||||
settings.Reading.RepeatedSymbolsMin = 4
|
||||
voice := &fakeVoice{}
|
||||
echo := &echoSpeaker{Speaker: voice, punctuation: processor, punctuationLevel: "some", settings: &settings}
|
||||
text := "docs/user.md | 7 +++++--"
|
||||
echo.Say(text)
|
||||
if len(voice.messages) != 1 {
|
||||
t.Fatal("missing diffstat speech", voice.messages)
|
||||
}
|
||||
if got := strings.Join(strings.Fields(voice.messages[0]), " "); got != "docs slash user dot md 7 5 plus dash dash" {
|
||||
t.Fatal("diffstat did not summarize", got)
|
||||
}
|
||||
if echo.last != text {
|
||||
t.Fatal("clipboard echo lost original diffstat", echo.last)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPackageProgressBarSpeechKeepsOriginalClipboardText(t *testing.T) {
|
||||
processor, _, err := punctuation.Load([]string{"../../config/punctuation/default.toml"})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user