alpha
Login
or
Join now
nandi.uk
/
gleam
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Fork of daniellemaywood.uk/gleam — Wasm codegen work
Star
2
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
add tests
parentheses -> curly braces
author
Andrey
committer
Louis Pilfold
date
1 month ago
(Jun 22, 2026, 3:20 PM +0100)
commit
f329be72
f329be72533848f8e692e2abd6a5553cb1c4bd4a
parent
88644586
886445864d1410806c21bd9c1faad274bbd80d83
+62
1 changed file
Expand all
Collapse all
Unified
Split
format
src
tests
bit_array.rs
+62
format/src/tests/bit_array.rs
View file
Reviewed
···
510
510
"#
511
511
);
512
512
}
513
513
+
514
514
+
// https://github.com/gleam-lang/gleam/issues/5606
515
515
+
#[test]
516
516
+
fn dont_insert_curly_braces_with_binary_operators_when_line_is_short() {
517
517
+
assert_format!(
518
518
+
"pub fn main() {
519
519
+
let wubble = <<bits:bits-size(wibble * wobble)-unit(8)>>
520
520
+
}
521
521
+
"
522
522
+
);
523
523
+
}
524
524
+
525
525
+
// https://github.com/gleam-lang/gleam/issues/5606
526
526
+
#[test]
527
527
+
fn dont_insert_curly_braces_with_binary_operators_when_line_is_long() {
528
528
+
assert_format_rewrite!(
529
529
+
"pub fn main() {
530
530
+
let some_long_variable_name = <<bits:bits-size(some_other_long_variable_name * and_some_other_long_variable_name)-unit(8)>>
531
531
+
}
532
532
+
",
533
533
+
"pub fn main() {
534
534
+
let some_long_variable_name = <<
535
535
+
bits:bits-size({
536
536
+
some_other_long_variable_name
537
537
+
* and_some_other_long_variable_name
538
538
+
}
539
539
+
)-unit(8),
540
540
+
>>
541
541
+
}
542
542
+
"
543
543
+
);
544
544
+
}
545
545
+
546
546
+
// https://github.com/gleam-lang/gleam/issues/5606
547
547
+
#[test]
548
548
+
fn preserve_user_inserted_curly_braces_with_binary_operators_when_line_is_short() {
549
549
+
assert_format!(
550
550
+
"pub fn main() {
551
551
+
let some_variable = <<bits:bits-size({ some * other })>>
552
552
+
}
553
553
+
"
554
554
+
);
555
555
+
}
556
556
+
557
557
+
// https://github.com/gleam-lang/gleam/issues/5606
558
558
+
#[test]
559
559
+
fn preserve_user_inserted_curly_braces_with_binary_operators_when_line_is_long() {
560
560
+
assert_format_rewrite!(
561
561
+
"pub fn main() {
562
562
+
let some_long_variable_name = <<bits:bits-size({ some_other_long_variable_name * and_some_other_long_variable_name })>>
563
563
+
}
564
564
+
",
565
565
+
"pub fn main() {
566
566
+
let some_long_variable_name = <<
567
567
+
bits:bits-size({
568
568
+
some_other_long_variable_name * and_some_other_long_variable_name
569
569
+
}),
570
570
+
>>
571
571
+
}
572
572
+
"
573
573
+
);
574
574
+
}