Skip to content

Commit a918d61

Browse files
committed
Add unapply pattern completion test
1 parent b8fb81b commit a918d61

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

presentation-compiler/test/dotty/tools/pc/tests/completion/CompletionSuite.scala

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,39 @@ class CompletionSuite extends BaseCompletionSuite:
623623
|""".stripMargin
624624
)
625625

626+
@Test def patRecursive =
627+
check(
628+
s"""|object Main {
629+
| Option(List(Option(1))) match {
630+
| case Some(List(None, Som@@))
631+
|}
632+
|""".stripMargin,
633+
"""|Some(value) scala
634+
|Some scala
635+
|Some[A](value: A): Some[A]
636+
|""".stripMargin
637+
)
638+
check(
639+
s"""|object Main {
640+
| Option(Option(1)) match {
641+
| case Some(Som@@)
642+
|}
643+
|""".stripMargin,
644+
"""|Some(value) scala
645+
|Some scala
646+
|Some[A](value: A): Some[A]
647+
|""".stripMargin
648+
)
649+
626650
@Test def pat1 =
627651
check(
628652
s"""|object Main {
629653
| Option(1) match {
630654
| case List(Som@@)
631655
|}
632656
|""".stripMargin,
633-
"""|Some scala
657+
"""|Some(value) scala
658+
|Some scala
634659
|Some[A](value: A): Some[A]
635660
|""".stripMargin
636661
)

0 commit comments

Comments
 (0)