Adjusted starting speech rate for new users. Fixed error that could happen when figuring out where to write changes.
This commit is contained in:
1 parent
f989628a5a
commit
3b7a44c224
19 files changed
+163
-49
No files matched your search
@@ -271,7 +271,7 @@ func TestAttributeSessionToggleQuickSaveAndFreshStartup(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
saved, _, err := config.Load(path, nil)
|
||||
if err != nil || saved.Reading.Attributes != mode || saved.Reading.AttributeFormat != "fenrirBold" || saved.Presentation.Speech.Rate != 90 {
|
||||
if err != nil || saved.Reading.Attributes != mode || saved.Reading.AttributeFormat != "fenrirBold" || saved.Presentation.Speech.Rate != -10 {
|
||||
t.Fatal("temporary toggle persisted", saved, err)
|
||||
}
|
||||
settings = saved
|
||||
|
||||
@@ -95,7 +95,7 @@ func (a *application) handle_command(id command.ID) {
|
||||
case command.Help:
|
||||
a.ui.open_tutorial(a.options.Bindings, a.options.Scripts, a.settings.live.General.ScriptKeys)
|
||||
case command.Version:
|
||||
a.present(i18n.Format("Fenrir screen reader version {0}-{1}", version.Build, version.Channel), "")
|
||||
a.present(i18n.Format("Fenrir screen reader version {0}-{1}", version.Version, version.Channel), "")
|
||||
case command.Time:
|
||||
text, _ := datetime.Format_time(a.settings.live.Presentation.DateTime.TimeFormat, time.Now())
|
||||
a.present(text, "")
|
||||
|
||||
@@ -36,6 +36,7 @@ import (
|
||||
|
||||
func TestQuickSpeechSelectionAdjustmentAndBounds(t *testing.T) {
|
||||
settings := config.Defaults()
|
||||
settings.Presentation.Speech.Rate = 80 // Exercise the upper rate bound.
|
||||
voice := &fakeVoice{}
|
||||
menu := new_quick_settings("speech-dispatcher")
|
||||
for _, testCase := range []struct {
|
||||
@@ -89,14 +90,14 @@ func TestHardwareQuickSettingsOnlyOfferSupportedControls(t *testing.T) {
|
||||
menu.selectSpeech = func(config.Speech, func(error, bool)) {
|
||||
t.Fatal("hardware numeric adjustment tried reopening the device")
|
||||
}
|
||||
for _, want := range []string{"speech pitch 0", "speech volume 100", "speech rate 80"} {
|
||||
for _, want := range []string{"speech pitch 0", "speech volume 100", "speech rate -20"} {
|
||||
menu.command(command.NextQuickEntry, &settings, voice)
|
||||
if got := voice.messages[len(voice.messages)-1]; got != want {
|
||||
t.Fatal(driver, got, want)
|
||||
}
|
||||
}
|
||||
menu.command(command.NextQuickValue, &settings, voice)
|
||||
if settings.Presentation.Speech.Rate != 90 || voice.parameters[len(voice.parameters)-1].Rate != 90 {
|
||||
if settings.Presentation.Speech.Rate != -10 || voice.parameters[len(voice.parameters)-1].Rate != -10 {
|
||||
t.Fatal(settings, voice.parameters)
|
||||
}
|
||||
}
|
||||
@@ -124,7 +125,7 @@ func TestQuickChangesSurviveMenuCancelAndExplicitSaveThenQuit(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
saved, _, err := config.Load(path, nil)
|
||||
if err != nil || saved.Presentation.Speech.Rate != 90 || saved.Presentation.Speech.Pitch != -10 || !saved.Reading.Automatic || saved.Reading.Mode != "table" || !reflect.DeepEqual(saved.General, base.General) {
|
||||
if err != nil || saved.Presentation.Speech.Rate != -10 || saved.Presentation.Speech.Pitch != -10 || !saved.Reading.Automatic || saved.Reading.Mode != "table" || !reflect.DeepEqual(saved.General, base.General) {
|
||||
t.Fatal(saved, err)
|
||||
}
|
||||
if !strings.Contains(strings.Join(voice.messages, "|"), "Settings saved.") {
|
||||
@@ -208,7 +209,7 @@ func TestSessionMuteDoesNotPersistAcrossRestart(t *testing.T) {
|
||||
if err != nil || settings.Presentation.Speech.Enabled != trial.enabled {
|
||||
t.Fatal("session mute changed saved speech enablement", settings.Presentation.Speech, err)
|
||||
}
|
||||
if trial.save && settings.Presentation.Speech.Rate != 90 {
|
||||
if trial.save && settings.Presentation.Speech.Rate != -10 {
|
||||
t.Fatal("quick speech adjustment was not saved", settings.Presentation.Speech)
|
||||
}
|
||||
}
|
||||
@@ -277,7 +278,7 @@ func TestSessionAutomaticReadingDoesNotPersistAcrossRestart(t *testing.T) {
|
||||
if err != nil || settings.Reading.Automatic != trial.automatic || !settings.Presentation.Speech.Enabled {
|
||||
t.Fatal("session reading toggle changed saved startup behavior", settings, err)
|
||||
}
|
||||
if trial.save && settings.Presentation.Speech.Rate != 90 {
|
||||
if trial.save && settings.Presentation.Speech.Rate != -10 {
|
||||
t.Fatal("quick adjustment was not saved", settings.Presentation.Speech)
|
||||
}
|
||||
}
|
||||
@@ -305,7 +306,7 @@ func TestSaveFailureKeepsRunningQuickSettings(t *testing.T) {
|
||||
case <-time.After(time.Second):
|
||||
t.Fatal("save hung")
|
||||
}
|
||||
if saver.busy || settings.Presentation.Speech.Rate != 90 || voice.messages[len(voice.messages)-1] != "Failed to save settings." {
|
||||
if saver.busy || settings.Presentation.Speech.Rate != -10 || voice.messages[len(voice.messages)-1] != "Failed to save settings." {
|
||||
t.Fatal(settings, voice.messages)
|
||||
}
|
||||
}
|
||||
@@ -341,7 +342,7 @@ func TestQuickCategoriesRememberSelectionAndWrap(t *testing.T) {
|
||||
t.Fatalf("%s: got %q, want %q", trial.id, got, trial.want)
|
||||
}
|
||||
}
|
||||
if menu := new_quick_settings("speech-dispatcher"); !menu.command(command.CurrentQuickEntry, &settings, voice) || voice.messages[len(voice.messages)-1] != "speech rate 80" {
|
||||
if menu := new_quick_settings("speech-dispatcher"); !menu.command(command.CurrentQuickEntry, &settings, voice) || voice.messages[len(voice.messages)-1] != "speech rate -20" {
|
||||
t.Fatal("new session did not reset selection", voice.messages)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ func TestMenuSelectionFailurePreservesDiskAndCommittedSaveSurvivesClose(t *testi
|
||||
t.Fatal("failure changed disk/live", outcome)
|
||||
}
|
||||
} else {
|
||||
if outcome != nil || a.settings.live.Presentation.Speech.Voice != "Base Voice" || a.settings.live.Presentation.Speech.Rate != 90 || a.settings.resetBase.Presentation.Speech.Rate != 80 || a.settings.resetBase.Presentation.Speech.Voice != "Base Voice" {
|
||||
if outcome != nil || a.settings.live.Presentation.Speech.Voice != "Base Voice" || a.settings.live.Presentation.Speech.Rate != -10 || a.settings.resetBase.Presentation.Speech.Rate != -20 || a.settings.resetBase.Presentation.Speech.Voice != "Base Voice" {
|
||||
t.Fatal("committed selection or newer numeric override lost", outcome, a.settings.live, a.settings.resetBase)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"git.stormux.org/storm/fenrir/internal/version"
|
||||
)
|
||||
|
||||
func TestVersionUsesBuildMetadataInBothModes(t *testing.T) {
|
||||
func TestVersionUsesReleaseMetadataInBothModes(t *testing.T) {
|
||||
for _, terminalMode := range []bool{false, true} {
|
||||
voice := &fakeVoice{}
|
||||
a, err := new_application(context.Background(), &fakeSource{}, &fakeKeys{}, voice, RunOptions{Settings: config.Defaults(), TerminalMode: terminalMode})
|
||||
|
||||
Reference in new issue
Block a user