Skip to content

Commit f71a5c6

Browse files
committed
d updated markdown snippets
1 parent 2380e38 commit f71a5c6

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

approvaltests/docs/how_to/TestAVarietyOfValues.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
## Contents
77

88
* [When to use Approvals::verifyAll()](#when-to-use-approvalsverifyall)
9-
* [Steps](#steps)<!-- endToc -->
9+
* [Steps](#steps)
10+
* [Tables](#tables)<!-- endToc -->
1011

1112
## When to use Approvals::verifyAll()
1213

@@ -54,11 +55,42 @@ placeholder input.value2
5455
Another way to test a variety of inputs is to use a `MarkdownTable`.
5556
Here's an example:
5657

57-
snippet: markdown_table_example
58+
<!-- snippet: markdown_table_example -->
59+
<a id='snippet-markdown_table_example'></a>
60+
```java
61+
Integer[] inputs = Range.get(1, 20);
62+
MarkdownTable table = MarkdownTable.create(inputs, a -> getModifier(a), "Score", "Modifier");
63+
Approvals.verify(table);
64+
```
65+
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/TableTest.java#L12-L16' title='Snippet source file'>snippet source</a> | <a href='#snippet-markdown_table_example' title='Start of snippet'>anchor</a></sup>
66+
<!-- endSnippet -->
5867

5968
which will produce:
6069

61-
include: TableTest.abilityModifier.approved.md
70+
<!-- include: TableTest.abilityModifier.approved.md -->
71+
| Score | Modifier |
72+
| --- | --- |
73+
| 1 | -5 |
74+
| 2 | -4 |
75+
| 3 | -4 |
76+
| 4 | -3 |
77+
| 5 | -3 |
78+
| 6 | -2 |
79+
| 7 | -2 |
80+
| 8 | -1 |
81+
| 9 | -1 |
82+
| 10 | 0 |
83+
| 11 | 0 |
84+
| 12 | 1 |
85+
| 13 | 1 |
86+
| 14 | 2 |
87+
| 15 | 2 |
88+
| 16 | 3 |
89+
| 17 | 3 |
90+
| 18 | 4 |
91+
| 19 | 4 |
92+
| 20 | 5 |
93+
<!-- endInclude -->
6294

6395

6496
---

0 commit comments

Comments
 (0)