Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions appdirs/_test.pony
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ primitive \nodoc\ _AppDirsTestUtil
h: TestHelper,
loc: SourceLoc = __loc) ?
=>
match expected.home_dir
match \exhaustive\ expected.home_dir
| _ExpectError =>
h.assert_error(
{()? => app_dirs.user_home_dir()? }
Expand All @@ -65,7 +65,7 @@ primitive \nodoc\ _AppDirsTestUtil
app_dirs.user_home_dir()?
where loc = loc)
end
match expected.user_data_dir
match \exhaustive\ expected.user_data_dir
| _ExpectError =>
h.assert_error(
{()? => app_dirs.user_data_dir()? }
Expand All @@ -76,7 +76,7 @@ primitive \nodoc\ _AppDirsTestUtil
app_dirs.user_data_dir()?
where loc = loc)
end
match expected.site_data_dirs
match \exhaustive\ expected.site_data_dirs
| _ExpectError =>
h.assert_error(
{()? => app_dirs.site_data_dirs()? }
Expand All @@ -88,7 +88,7 @@ primitive \nodoc\ _AppDirsTestUtil
where loc = loc)
end

match expected.user_config_dir
match \exhaustive\ expected.user_config_dir
| _ExpectError =>
h.assert_error(
{()? => app_dirs.user_config_dir()? }
Expand All @@ -99,7 +99,7 @@ primitive \nodoc\ _AppDirsTestUtil
app_dirs.user_config_dir()?
where loc = loc)
end
match expected.site_config_dirs
match \exhaustive\ expected.site_config_dirs
| _ExpectError =>
h.assert_error(
{()? => app_dirs.site_config_dirs()? }
Expand All @@ -111,7 +111,7 @@ primitive \nodoc\ _AppDirsTestUtil
where loc = loc)
end

match expected.user_cache_dir
match \exhaustive\ expected.user_cache_dir
| _ExpectError =>
h.assert_error(
{()? => app_dirs.user_cache_dir()? }
Expand All @@ -123,7 +123,7 @@ primitive \nodoc\ _AppDirsTestUtil
where loc = loc)
end

match expected.user_state_dir
match \exhaustive\ expected.user_state_dir
| _ExpectError =>
h.assert_error(
{()? => app_dirs.user_state_dir()? }
Expand All @@ -135,7 +135,7 @@ primitive \nodoc\ _AppDirsTestUtil
where loc = loc)
end

match expected.user_log_dir
match \exhaustive\ expected.user_log_dir
| _ExpectError =>
h.assert_error(
{()? => app_dirs.user_log_dir()? }
Expand Down
22 changes: 11 additions & 11 deletions appdirs/appdirs.pony
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type _Maybe[T] is (T | None)

primitive _Opt
fun get[T](s: _Maybe[T], or_else: T): T =>
match consume s
match \exhaustive\ consume s
| let value: T => consume value
| None => consume or_else
end
Expand Down Expand Up @@ -126,7 +126,7 @@ class AppDirs
dir for this application.
"""
let os_specific_dir =
match _platform
match \exhaustive\ _platform
| _Osx =>
Paths.join(
[ _home as String
Expand All @@ -153,7 +153,7 @@ class AppDirs
""
end
end
match _app_version
match \exhaustive\ _app_version
| None => os_specific_dir
| let v: String => Path.join(os_specific_dir, v)
end
Expand All @@ -175,7 +175,7 @@ class AppDirs
data dirs for this application.
"""
let os_specific_dirs: Array[String] iso =
match _platform
match \exhaustive\ _platform
| _Osx =>
recover
[ Path.join(
Expand Down Expand Up @@ -239,7 +239,7 @@ class AppDirs
for this application.
"""
let os_specific_dir =
match _platform
match \exhaustive\ _platform
| _Osx =>
Paths.join(
[ _home as String
Expand All @@ -254,7 +254,7 @@ class AppDirs
end

// apply version
match _app_version
match \exhaustive\ _app_version
| None => os_specific_dir
| let v: String =>
Path.join(os_specific_dir, v)
Expand All @@ -275,7 +275,7 @@ class AppDirs
for this application.
"""
let os_specific_dirs: Array[String] iso =
match _platform
match \exhaustive\ _platform
| _Osx =>
recover
[ Path.join(
Expand Down Expand Up @@ -326,7 +326,7 @@ class AppDirs
for this application.
"""
let os_specific_dir =
match _platform
match \exhaustive\ _platform
| _Osx =>
Paths.join(
[ _home as String
Expand All @@ -351,7 +351,7 @@ class AppDirs
""
end
end
match _app_version
match \exhaustive\ _app_version
| None => os_specific_dir
| let v: String => Path.join(os_specific_dir, v)
end
Expand All @@ -371,7 +371,7 @@ class AppDirs
See:
https://wiki.debian.org/XDGBaseDirectorySpecification#state
"""
match _platform
match \exhaustive\ _platform
| _Osx | _Windows =>
user_data_dir()?
| _OsxAsUnix | _Unix =>
Expand All @@ -393,7 +393,7 @@ class AppDirs
Return full path to the user-specific log dir
for this application.
"""
match _platform
match \exhaustive\ _platform
| _Osx =>
Paths.join(
[ _home as String
Expand Down