Skip to content

Commit 9c1f8f9

Browse files
committed
more snapshot tests
1 parent 47a13b7 commit 9c1f8f9

File tree

4 files changed

+97
-0
lines changed

4 files changed

+97
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
format: docusaurus-md
3+
code-annotations: true
4+
code-line-numbers: true
5+
---
6+
7+
```r
8+
library(tidyverse)
9+
library(palmerpenguins)
10+
penguins |> # <1>
11+
mutate( # <2>
12+
bill_ratio = bill_depth_mm / bill_length_mm, # <2>
13+
bill_area = bill_depth_mm * bill_length_mm # <2>
14+
) # <2>
15+
```
16+
1. Take `penguins`, and then,
17+
2. add new columns for the bill ratio and bill area.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
format: docusaurus-md
3+
---
4+
5+
::: {.panel-tabset}
6+
## R
7+
8+
``` {.r}
9+
fizz_buzz <- function(fbnums = 1:50) {
10+
output <- dplyr::case_when(
11+
fbnums %% 15 == 0 ~ "FizzBuzz",
12+
fbnums %% 3 == 0 ~ "Fizz",
13+
fbnums %% 5 == 0 ~ "Buzz",
14+
TRUE ~ as.character(fbnums)
15+
)
16+
print(output)
17+
}
18+
```
19+
20+
## Python
21+
22+
``` {.python}
23+
def fizz_buzz(num):
24+
if num % 15 == 0:
25+
print("FizzBuzz")
26+
elif num % 5 == 0:
27+
print("Buzz")
28+
elif num % 3 == 0:
29+
print("Fizz")
30+
else:
31+
print(num)
32+
```
33+
34+
:::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
format: docusaurus-md
3+
code-annotations: true
4+
code-line-numbers: true
5+
---
6+
7+
8+
9+
10+
11+
```r showLineNumbers
12+
library(tidyverse)
13+
library(palmerpenguins)
14+
penguins |>
15+
mutate(
16+
bill_ratio = bill_depth_mm / bill_length_mm,
17+
bill_area = bill_depth_mm * bill_length_mm
18+
)
19+
```
20+
21+
Line 3
22+
Take `penguins`, and then,
23+
24+
Lines 4-7
25+
add new columns for the bill ratio and bill area.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
format: docusaurus-md
3+
code-annotations: true
4+
code-line-numbers: true
5+
_quarto:
6+
tests:
7+
docusaurus-md:
8+
ensureSnapshotMatches: true
9+
---
10+
11+
```r
12+
library(tidyverse)
13+
library(palmerpenguins)
14+
penguins |> # <1>
15+
mutate( # <2>
16+
bill_ratio = bill_depth_mm / bill_length_mm, # <2>
17+
bill_area = bill_depth_mm * bill_length_mm # <2>
18+
) # <2>
19+
```
20+
1. Take `penguins`, and then,
21+
2. add new columns for the bill ratio and bill area.

0 commit comments

Comments
 (0)