Attempt to improve the multicharacter detection code.
This commit is contained in:
1 parent
6fc3416a1b
commit
3cf41e662c
12 files changed
+1135
-843
No files matched your search
@@ -66,6 +66,28 @@ func TestURLSpeechKeepsEmbeddedPunctuationAndOriginalClipboardText(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPackageProgressBarSpeechKeepsOriginalClipboardText(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
|
||||
voice := &fakeVoice{}
|
||||
echo := &echoSpeaker{Speaker: voice, punctuation: processor, punctuationLevel: "some", settings: &settings}
|
||||
text := "(123/189) upgrading nodejs-lts-jod" + strings.Repeat(" ", 157) + "[" + strings.Repeat("#", 120) + "] 100%"
|
||||
echo.Say(text)
|
||||
if len(voice.messages) != 1 {
|
||||
t.Fatal("missing progress speech", voice.messages)
|
||||
}
|
||||
if got := strings.Join(strings.Fields(voice.messages[0]), " "); got != "123 slash 189 upgrading nodejs dash lts dash jod 120 number 100" {
|
||||
t.Fatal("progress bar did not summarize", got)
|
||||
}
|
||||
if echo.last != text {
|
||||
t.Fatal("clipboard echo lost original progress bar", echo.last)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReviewCharactersUseProfileRegardlessOfLevelAndKeepBoundaries(t *testing.T) {
|
||||
processor, _, err := punctuation.Load([]string{"../../config/punctuation/fr.toml"})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user