@@ -27,7 +27,7 @@ If you just wanted to wrap a single object. You can create a printable wrapper b
2727Printable<Integer > one = new Printable (1 , " one" );
2828assertEquals(" one" , one. toString());
2929```
30- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L18-L21 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_single_label ' title =' Start of snippet ' >anchor</a ></sup >
30+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L14-L17 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_single_label ' title =' Start of snippet ' >anchor</a ></sup >
3131<!-- endSnippet -->
3232
3333to access the value, simply call
@@ -38,7 +38,7 @@ to access the value, simply call
3838Integer value = one. get();
3939assertEquals(1 , value);
4040```
41- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L22-L25 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_access ' title =' Start of snippet ' >anchor</a ></sup >
41+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L18-L21 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_access ' title =' Start of snippet ' >anchor</a ></sup >
4242<!-- endSnippet -->
4343
4444#### Alternative ` toString() ` Function
@@ -51,7 +51,7 @@ You can also write a different function(lambda) to create the `toString()` and t
5151Printable<Integer > two = new Printable (2 , i - > " #" + i + " )" );
5252assertEquals(" #2)" , two. toString());
5353```
54- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L26-L29 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_single_lambda ' title =' Start of snippet ' >anchor</a ></sup >
54+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L22-L25 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_single_lambda ' title =' Start of snippet ' >anchor</a ></sup >
5555<!-- endSnippet -->
5656
5757### Wrap an array of objects
@@ -64,7 +64,7 @@ For convenience, if you want to do this to a whole list of items we have
6464Printable<Integer > numbers[] = Printable . create(n - > " #" + n, 1 , 2 , 3 , 4 , 5 );
6565Approvals . verifyAll(" Custom toString method" , numbers, p - > String . format(" %s -> %s" , p, p. get()));
6666```
67- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L40-L43 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_array_lambda ' title =' Start of snippet ' >anchor</a ></sup >
67+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L36-L39 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_array_lambda ' title =' Start of snippet ' >anchor</a ></sup >
6868<!-- endSnippet -->
6969
7070would produce
@@ -95,7 +95,7 @@ Printable<Integer> labeled[] = Printable.with().label(1, "first").label(2, "seco
9595 .label(4 , " forth" ). label(5 , " fifth" ). toArray();
9696Approvals . verifyAll(" Labeled" , labeled, p - > String . format(" %s -> %s" , p, p. get()));
9797```
98- <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L48-L52 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_array_labels ' title =' Start of snippet ' >anchor</a ></sup >
98+ <sup ><a href =' /approvaltests-tests/src/test/java/org/approvaltests/combinations/PrintableTest.java#L44-L48 ' title =' Snippet source file ' >snippet source</a > | <a href =' #snippet-printable_array_labels ' title =' Start of snippet ' >anchor</a ></sup >
9999<!-- endSnippet -->
100100
101101would produce:
0 commit comments