Skip to content

Commit

Permalink
update numbers test, add NEWS entry for JuliaLang#11130
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed May 6, 2015
1 parent b6904b6 commit 07bb567
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ New language features
Language changes
----------------

* Unsigned `BigInt` literal syntax has been removed ([#11105]).
Unsigned literals larger than `UInt128` now throw a syntax error.

* Tuple types are now written as `Tuple{A, B}` instead of as `(A, B)`.
Tuples of bits types are inlined into structs and arrays, like other
immutable types.
Expand Down
23 changes: 9 additions & 14 deletions test/numbers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ end
@test isa(0b0000000000000000000000000000000000000000000000000000000000000000,UInt64)
@test isa(0b00000000000000000000000000000000000000000000000000000000000000000,UInt128)
@test isa(0b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,UInt128)
#@test isa(0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
@test isa(0b11111111,UInt8)
@test isa(0b111111111,UInt16)
Expand All @@ -1663,7 +1663,7 @@ end
@test isa(0b1111111111111111111111111111111111111111111111111111111111111111,UInt64)
@test isa(0b11111111111111111111111111111111111111111111111111111111111111111,UInt128)
@test isa(0b11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111,UInt128)
#@test isa(0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")

# octal literals
Expand All @@ -1682,7 +1682,7 @@ end
@test isa(0o000000000000000000000,UInt64)
@test isa(0o0000000000000000000000,UInt128)
@test isa(0o000000000000000000000000000000000000000000,UInt128)
#@test isa(0o0000000000000000000000000000000000000000000,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("0o0000000000000000000000000000000000000000000")
@test isa(0o11,UInt8)
@test isa(0o111,UInt8)
Expand All @@ -1694,10 +1694,9 @@ end
@test isa(0o1111111111111111111111,UInt64)
@test isa(0o111111111111111111111111111111111111111111,UInt128)
@test isa(0o1111111111111111111111111111111111111111111,UInt128)
#@test isa(0o11111111111111111111111111111111111111111111,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("0o11111111111111111111111111111111111111111111")
#@test 0o4000000000000000000000000000000000000000000 ==
# 340282366920938463463374607431768211456

# hexadecimal literals

@test isa(0x00,UInt8)
Expand All @@ -1709,8 +1708,9 @@ end
@test isa(0x0000000000000000,UInt64)
@test isa(0x00000000000000000,UInt128)
@test isa(0x00000000000000000000000000000000,UInt128)
#@test isa(0x000000000000000000000000000000000,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("0x000000000000000000000000000000000")

@test isa(0x11,UInt8)
@test isa(0x111,UInt16)
@test isa(0x1111,UInt16)
Expand All @@ -1720,7 +1720,7 @@ end
@test isa(0x1111111111111111,UInt64)
@test isa(0x11111111111111111,UInt128)
@test isa(0x11111111111111111111111111111111,UInt128)
#@test isa(0x111111111111111111111111111111111,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("0x111111111111111111111111111111111")

# "-" is not part of unsigned literals
Expand All @@ -1734,17 +1734,12 @@ end
@test -0o0000000000000000000001 == -(0o0000000000000000000001)
@test -0b00000000000000000000000000000000000000000000000000000000000000001 ==
-(0b00000000000000000000000000000000000000000000000000000000000000001)
#@test -0x000000000000000000000000000000001 == -(0x000000000000000000000000000000001)
#@test -0o0000000000000000000000000000000000000000001 ==
# -(0o0000000000000000000000000000000000000000001)
#@test -0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 ==
# -(0b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001)

@test isa(-0x00,UInt8)
@test isa(-0x0000000000000000,UInt64)
@test isa(-0x00000000000000000,UInt128)
@test isa(-0x00000000000000000000000000000000,UInt128)
#@test isa(-0x000000000000000000000000000000000,BigInt)
# remove BigInt unsigned integer literals #11105
@test_throws ParseError parse("-0x000000000000000000000000000000000")

# Float32 literals
Expand Down

0 comments on commit 07bb567

Please sign in to comment.