Skip to content

Commit

Permalink
(erlang) numeric literals underscore separators - add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seriyps committed May 13, 2020
1 parent 9309bd8 commit 8c52ada
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -34,6 +34,7 @@ Language Improvements:
- fix(yaml) Fix tags to include non-word characters (#2486) [Peter Plantinga][]
- fix(swift) `@objcMembers` was being partially highlighted (#2543) [Nick Randall][]
- enh(dart) Add `late` and `required` keywords, and `Never` built-in type (#2550) [Sam Rawlins][]
- enh(erlang) Add underscore separators to numeric literals (#2554) [Sergey Prokhorov][]

[Josh Goebel]: https://github.com/yyyc514
[Peter Plantinga]: https://github.com/pplantinga
Expand All @@ -42,6 +43,7 @@ Language Improvements:
[Hankun Lin]: https://github.com/Linhk1606
[Nick Randall]: https://github.com/nicked
[Sam Rawlins]: https://github.com/srawlins
[Sergey Prokhorov]: https://github.com/seriyps


## Version 10.0.2
Expand Down
14 changes: 14 additions & 0 deletions test/markup/erlang/numbers.expect.txt
@@ -0,0 +1,14 @@
Integer = <span class="hljs-number">1234</span>
BigInteger = <span class="hljs-number">1_234_000</span>
NegInteger = <span class="hljs-number">-20_000</span>
Float = <span class="hljs-number">2.34</span>
BigFloat = <span class="hljs-number">3_333.14159_26535_89793</span>
SciFloat = <span class="hljs-number">2.4e23</span>
PlusSciFloat = <span class="hljs-number">2.4e+23</span>
SmallSciFloat = <span class="hljs-number">2.4e-23</span>
Binary = <span class="hljs-number">2#1010</span>
StrangeBinary = <span class="hljs-number">2#1010_1010_1010</span>
Octal = <span class="hljs-number">8#777</span>
StrangeOctal = <span class="hljs-number">8#777_666_555</span>
Hex = <span class="hljs-number">0x1ABEF</span>
StrangeHex = <span class="hljs-number">16#1234_D0GE_FACE</span>
14 changes: 14 additions & 0 deletions test/markup/erlang/numbers.txt
@@ -0,0 +1,14 @@
Integer = 1234
BigInteger = 1_234_000
NegInteger = -20_000
Float = 2.34
BigFloat = 3_333.14159_26535_89793
SciFloat = 2.4e23
PlusSciFloat = 2.4e+23
SmallSciFloat = 2.4e-23
Binary = 2#1010
StrangeBinary = 2#1010_1010_1010
Octal = 8#777
StrangeOctal = 8#777_666_555
Hex = 16#1ABEF
StrangeHex = 16#1234_D0GE_FACE

0 comments on commit 8c52ada

Please sign in to comment.