@@ -256,6 +256,18 @@ pub fn main() {
256256 ) ;
257257}
258258
259+ // https://github.com/gleam-lang/gleam/issues/5459
260+ #[ test]
261+ fn many_preceeding_zeros_int ( ) {
262+ assert_js ! (
263+ r#"
264+ pub fn main() {
265+ 0000_000_00_9_179
266+ }
267+ "#
268+ ) ;
269+ }
270+
259271// https://github.com/gleam-lang/gleam/issues/2412
260272#[ test]
261273fn preceeding_zeros_float ( ) {
@@ -268,6 +280,18 @@ pub fn main() {
268280 ) ;
269281}
270282
283+ // https://github.com/gleam-lang/gleam/issues/5459
284+ #[ test]
285+ fn many_preceeding_zeros_float ( ) {
286+ assert_js ! (
287+ r#"
288+ pub fn main() {
289+ 0000_000_00_9_179.1
290+ }
291+ "#
292+ ) ;
293+ }
294+
271295// https://github.com/gleam-lang/gleam/issues/2412
272296#[ test]
273297fn preceeding_zeros_int_const ( ) {
@@ -278,6 +302,16 @@ pub const x = 09_179
278302 ) ;
279303}
280304
305+ // https://github.com/gleam-lang/gleam/issues/5459
306+ #[ test]
307+ fn many_preceeding_zeros_int_const ( ) {
308+ assert_js ! (
309+ r#"
310+ pub const x = 0000_000_00_9_179
311+ "#
312+ ) ;
313+ }
314+
281315// https://github.com/gleam-lang/gleam/issues/2412
282316#[ test]
283317fn preceeding_zeros_float_const ( ) {
@@ -288,6 +322,16 @@ pub const x = 09_179.1
288322 ) ;
289323}
290324
325+ // https://github.com/gleam-lang/gleam/issues/5459
326+ #[ test]
327+ fn many_preceeding_zeros_float_const ( ) {
328+ assert_js ! (
329+ r#"
330+ pub const x = 0000_000_00_9_179.1
331+ "#
332+ ) ;
333+ }
334+
291335// https://github.com/gleam-lang/gleam/issues/2412
292336#[ test]
293337fn preceeding_zeros_int_pattern ( ) {
@@ -300,6 +344,18 @@ pub fn main(x) {
300344 ) ;
301345}
302346
347+ // https://github.com/gleam-lang/gleam/issues/5459
348+ #[ test]
349+ fn many_preceeding_zeros_int_pattern ( ) {
350+ assert_js ! (
351+ r#"
352+ pub fn main(x) {
353+ let assert 0000_000_00_9_179 = x
354+ }
355+ "#
356+ ) ;
357+ }
358+
303359// https://github.com/gleam-lang/gleam/issues/2412
304360#[ test]
305361fn preceeding_zeros_float_pattern ( ) {
@@ -312,6 +368,18 @@ pub fn main(x) {
312368 ) ;
313369}
314370
371+ // https://github.com/gleam-lang/gleam/issues/5459
372+ #[ test]
373+ fn many_preceeding_zeros_float_pattern ( ) {
374+ assert_js ! (
375+ r#"
376+ pub fn main(x) {
377+ let assert 0000_000_00_9_179.1 = x
378+ }
379+ "#
380+ ) ;
381+ }
382+
315383// https://github.com/gleam-lang/gleam/issues/4459
316384#[ test]
317385fn underscore_after_hexadecimal_prefix ( ) {
0 commit comments