Skip to content

Commit

Permalink
Merge pull request #2 from JuliaInterop/patch
Browse files Browse the repository at this point in the history
Follow the standard
  • Loading branch information
Gnimuc authored Jul 18, 2019
2 parents c6e3c5e + c8f879a commit 851bc67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/CEnum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ macro cenum(name, args...)
sym = arg
elseif arg.head == :(=) || arg.head == :kw
sym,val = arg.args
lastval = val
else
error("Expression of type $arg not supported. Try only symbol or name = value")
end
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ using Test

@cenum(Boolean{Bool}, alternativefact, fact)
@test alternativefact == false

@cenum(Day, Mon=1, Tue, Wed=3, suiyoubi=3, Fri=5, Sat)
@test Mon == 1
@test Tue == 2
@test Wed == 3 == suiyoubi
@test Fri == 5
@test Sat == 6

0 comments on commit 851bc67

Please sign in to comment.