Skip to content

Commit

Permalink
add new snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
branberry committed Oct 21, 2024
1 parent 1b348f4 commit 026a97e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub(crate) struct FormatGritListPatternList;
impl FormatRule<GritListPatternList> for FormatGritListPatternList {
type Context = GritFormatContext;
fn fmt(&self, node: &GritListPatternList, f: &mut GritFormatter) -> FormatResult<()> {
let separator = soft_line_break_or_space();
let mut joiner = f.join_with(&separator);
format_verbatim_node(node.syntax()).fmt(f)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`var $x = [$numbers]` => `var firstPrimes = [$numbers]` where {
$numbers <: [ `2`, `3`, `5` ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
assertion_line: 212
info: grit/patterns/list_pattern.grit
---
# Input

```grit
`var $x = [$numbers]` => `var firstPrimes = [$numbers]` where {
$numbers <: [ `2`, `3`, `5` ]
}

```


=============================

# Outputs

## Output 1

-----
Indent style: Tab
Indent width: 2
Line ending: LF
Line width: 80
Attribute Position: Auto
-----

```grit
`var $x = [$numbers]` => `var firstPrimes = [$numbers]` where {
$numbers <: [ `2`, `3`, `5` ]
}
```



## Unimplemented nodes/tokens

"`var $x = [$numbers]` => `var firstPrimes = [$numbers]` " => 0..56
"\t$numbers <:" => 64..76
" [ `2`, `3`, `5` " => 76..93

0 comments on commit 026a97e

Please sign in to comment.