Skip to content

Commit

Permalink
rename to FlagEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Dec 2, 2016
1 parent 150f25a commit be747da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export
Dims,
EachLine,
Enum,
EnumSet,
Enumerate,
Factorization,
FileMonitor,
FlagEnum,
FloatRange,
Future,
Hermitian,
Expand Down Expand Up @@ -1409,7 +1409,7 @@ export

@assert,
@enum,
@enumset,
@flagenum,
@label,
@goto,
@view,
Expand Down
6 changes: 3 additions & 3 deletions base/libgit2/consts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module Consts
const REF_LISTALL = REF_OID | REF_SYMBOLIC

# checkout
@enumset(CHECKOUT,
@flagenum(CHECKOUT,
CHECKOUT_SAFE = 1 << 0,
CHECKOUT_FORCE = 1 << 1,
CHECKOUT_RECREATE_MISSING = 1 << 2,
Expand All @@ -51,7 +51,7 @@ module Consts
const CHECKOUT_UPDATE_SUBMODULES = Cuint(1 << 16)
const CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = Cuint(1 << 17)

@enumset(CHECKOUT_NOTIFY,
@flagenum(CHECKOUT_NOTIFY,
CHECKOUT_NOTIFY_CONFLICT = 1 << 0,
CHECKOUT_NOTIFY_DIRTY = 1 << 1,
CHECKOUT_NOTIFY_UPDATED = 1 << 2,
Expand Down Expand Up @@ -224,7 +224,7 @@ module Consts
const STATUS_SHOW_WORKDIR_ONLY = Cint(2)

# status options
@enumset(STATUS_OPT,
@flagenum(STATUS_OPT,
STATUS_OPT_INCLUDE_UNTRACKED = 1 << 0,
STATUS_OPT_INCLUDE_IGNORED = 1 << 1,
STATUS_OPT_INCLUDE_UNMODIFIED = 1 << 2,
Expand Down
17 changes: 9 additions & 8 deletions test/enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ let b = IOBuffer()
end


@enumset VegetableSet carrot potato broccoli
@flagenum VegetableSet carrot potato broccoli
@test typeof(VegetableSet) == DataType
@test isbits(VegetableSet)
@test typeof(carrot) <: VegetableSet <: EnumSet
@test typeof(carrot) <: VegetableSet <: FlagEnum
@test Int(carrot) == 1
@test Int(potato) == 2
@test Int(broccoli) == 4
Expand All @@ -198,9 +198,10 @@ end
@test convert(UInt128,broccoli) === 0x00000000000000000000000000000004
@test typeof(convert(BigInt,carrot)) <: BigInt
@test convert(BigInt,carrot) == 1
@test carrot carrot
@test carrot carrot potato
@test carrot potato
@test VegetableSet() carrot
@test carrot VegetableSet()
@test setdiff(carrot potato, carrot) == potato
@test carrot carrot
@test carrot carrot | potato
@test carrot potato
@test VegetableSet() carrot
@test carrot VegetableSet()
@test carrot ~VegetableSet()
@test ~carrot == potato|broccoli

0 comments on commit be747da

Please sign in to comment.