@@ -68,14 +68,19 @@ impl HighScoreTable {
6868
6969pub fn default_storage_path ( ) -> PathBuf {
7070 if let Some ( path) = env:: var_os ( "PACMAN_DATA_DIR" ) {
71- return PathBuf :: from ( path) . join ( "high_score .txt" ) ;
71+ return PathBuf :: from ( path) . join ( "high_scores .txt" ) ;
7272 }
7373
7474 if let Some ( home) = env:: var_os ( "HOME" ) {
75- return PathBuf :: from ( home) . join ( ".pacman" ) . join ( "high_score.txt" ) ;
75+ return PathBuf :: from ( home)
76+ . join ( ".xyzzy" )
77+ . join ( "pacman" )
78+ . join ( "high_scores.txt" ) ;
7679 }
7780
78- PathBuf :: from ( ".pacman-high-score.txt" )
81+ PathBuf :: from ( ".xyzzy" )
82+ . join ( "pacman" )
83+ . join ( "high_scores.txt" )
7984}
8085
8186#[ cfg( test) ]
@@ -127,7 +132,7 @@ mod tests {
127132 #[ test]
128133 fn save_and_load_round_trip_the_top_score ( ) {
129134 let dir = TempDir :: new ( ) ;
130- let path = dir. path ( ) . join ( "high_score .txt" ) ;
135+ let path = dir. path ( ) . join ( "high_scores .txt" ) ;
131136 let mut table = HighScoreTable :: default ( ) ;
132137 table. record ( 23_450 ) ;
133138
@@ -158,7 +163,7 @@ mod tests {
158163 std:: env:: set_var ( "PACMAN_DATA_DIR" , & override_path) ;
159164 }
160165 let path = default_storage_path ( ) ;
161- assert_eq ! ( path, override_path. join( "high_score .txt" ) ) ;
166+ assert_eq ! ( path, override_path. join( "high_scores .txt" ) ) ;
162167
163168 // SAFETY: This test sets process environment variables and restores them before exit.
164169 unsafe {
@@ -168,7 +173,7 @@ mod tests {
168173 let path = default_storage_path ( ) ;
169174 assert_eq ! (
170175 path,
171- PathBuf :: from( "/tmp/pacman-home/.pacman/high_score .txt" )
176+ PathBuf :: from( "/tmp/pacman-home/.xyzzy/ pacman/high_scores .txt" )
172177 ) ;
173178
174179 // SAFETY: This test restores process environment variables modified above.
0 commit comments