summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 05:15:35 -0300
committerGabriel Schneider <[email protected]>2026-10-01 05:18:09 -0300
commitb666f96e734bb87d6558c76c908314da562122d5 (patch)
tree234ca0b2762b95673663d98448098954cdc1e29a /src/ninep/ctl.zig
parent6ec5935396f2a5584f464bb256de88c501ab6bf1 (diff)
downloadpardes-b666f96e734bb87d6558c76c908314da562122d5.tar.gz
pardes-b666f96e734bb87d6558c76c908314da562122d5.zip
A Restore whose ThemeFile fails to load changes no theme: the session goes on showing the one it did, its file still the one named
A Restore makes a fresh core, which started at the default theme and asked for the dump's ThemeFile; when that file had broken since, the failure reverted to what the fresh core had loaded, nothing, and ink became orchard. A Restore that asks for a ThemeFile now carries over the theme the old session showed and the file it loaded (and its Theme, unless the dump names one), so a failure there changes nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index b7c529e1..a5a36464 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -2102,6 +2102,12 @@ test "a Restore asks again for the ThemeFile the dump names, as a /ctl write of
else => {},
} else return error.NoThemeFileAsked;
try testing.expectEqualStrings(good, pardes.colors.themeFileRequest(restored, asked.generation).?.path);
+ // The file broken since, the load fails: the restored session still
+ // shows the theme the old one did, and names the file it loaded.
+ try testing.expectEqualStrings("restored", restored.theme().name);
+ pardes.colors.failThemeFile(restored, asked.generation, error.ParseZon);
+ try testing.expectEqualStrings("restored", restored.theme().name);
+ try testing.expectEqualStrings(good, restored.theme_file_path.get());
}
test "a ThemeFile that fails to load changes nothing: the root ctl still names the one loaded, or none" {