File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -473,6 +473,8 @@ code fences have been updated to also include the result of evaluating the Scala
473
473
Another approach consists in embedding fragments of Scala source files that are part of a module which
474
474
is compiled by your build. For instance, given the following test in file ` src/test/ch/epfl/scala/Usage.scala ` :
475
475
476
+ {% tabs usage-definition class=tabs-scala-version %}
477
+ {% tab 'Scala 2' %}
476
478
~~~ scala
477
479
package ch .epfl .scala
478
480
@@ -489,6 +491,25 @@ object Usage extends Scalaprops {
489
491
490
492
}
491
493
~~~
494
+ {% endtab %}
495
+ {% tab 'Scala 3' %}
496
+ ~~~ scala
497
+ package ch .epfl .scala
498
+
499
+ import scalaprops .{Property , Scalaprops }
500
+
501
+ object Usage extends Scalaprops :
502
+
503
+ val testDoNothing =
504
+ // #do-nothing
505
+ Property .forAll: (x : Int ) =>
506
+ Example .doNothing(x) == x
507
+ // #do-nothing
508
+
509
+ end Usage
510
+ ~~~
511
+ {% endtab %}
512
+ {% endtabs %}
492
513
493
514
You can embed the fragment surrounded by the ` #do-nothing ` identifiers with the ` @@snip ` Paradox directive,
494
515
as shown in the ` src/documentation/reference.md ` file:
You can’t perform that action at this time.
0 commit comments