module cli import os import src.history import src.snapshot import src.storage fn test_doctor_reports_unsafe_save_paths_with_a_quoted_strip_command() { dir := os.join_path(os.temp_dir(), 'koh3_doctor_paths_${os.getpid()}') os.rmdir_all(dir) or {} os.mkdir_all(dir)! defer { os.rmdir_all(dir) or {} } store := storage.create(dir)! defer { store.close() } hash := store.put_object('unsafe'.bytes())! store.begin()! history.import_save(store, history.Save{ id: 'badbadbadbad' }, [snapshot.FileEntry{ path: "../June's file" hash: hash }])! history.set_head(store, 'badbadbadbad')! store.end()! assert unsafe_save_paths(store)! == [ "save [badbadbadbad] has unsafe path ../June's file — koh strip '../June'\\''s file'", ] }