Skip to content

Commit 323f2e7

Browse files
authored
Merge pull request #112 from BSnelling/bes/relax_group_types
Relaxing UInt types in Group
2 parents 3c14fa4 + 20ab75f commit 323f2e7

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "FilePathsBase"
22
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
33
authors = ["Rory Finnegan"]
4-
version = "0.9.8"
4+
version = "0.9.9"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/libc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Base.show(io::IO, group::Group) = print(io, "$(group.gid) ($(group.name))")
123123
return Group(gr)
124124
end
125125

126-
Group() = Group(UInt64(ccall(:getegid, Cint, ())))
126+
Group() = Group(UInt(ccall(:getegid, Cint, ())))
127127
else
128128
Group(name::String) = Group(Cgroup())
129129
Group(uid::UInt) = Group(Cgroup())

test/system.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,19 @@ ps = PathSet(; symlink=true)
279279
compare_stats(stat(fp), stat(string(fp)))
280280
compare_stats(lstat(fp), lstat(string(fp)))
281281
end
282+
283+
@testset "User/Group constructors" begin
284+
my_user = FilePathsBase.User()
285+
my_group = FilePathsBase.Group()
286+
287+
u_int = FilePathsBase.User(UInt(my_user.uid))
288+
g_int = FilePathsBase.Group(UInt(my_group.gid))
289+
290+
@test u_int isa FilePathsBase.User
291+
@test g_int isa FilePathsBase.Group
292+
@test u_int.uid isa Unsigned
293+
@test g_int.gid isa Unsigned
294+
end
282295
end
283296

284297
# We aren't going to do all the `isfifo`, `ischardev`, etc.

0 commit comments

Comments
 (0)