12
12
13
13
// This test file has been translated from swift/test/Parse/move_expr.swift
14
14
15
+ @_spi ( ExperimentalLanguageFeatures) import SwiftParser
16
+ import SwiftSyntax
15
17
import XCTest
16
18
17
19
final class MoveExprTests : ParserTestCase {
@@ -22,7 +24,8 @@ final class MoveExprTests: ParserTestCase {
22
24
func testGlobal() {
23
25
let _ = _move global
24
26
}
25
- """
27
+ """ ,
28
+ experimentalFeatures: [ . oldOwnershipOperatorSpellings]
26
29
)
27
30
}
28
31
@@ -33,7 +36,9 @@ final class MoveExprTests: ParserTestCase {
33
36
let t = String()
34
37
let _ = _move t
35
38
}
36
- """
39
+ """ ,
40
+ experimentalFeatures: [ . oldOwnershipOperatorSpellings]
41
+
37
42
)
38
43
}
39
44
@@ -45,7 +50,58 @@ final class MoveExprTests: ParserTestCase {
45
50
t = String()
46
51
let _ = _move t
47
52
}
53
+ """ ,
54
+ experimentalFeatures: [ . oldOwnershipOperatorSpellings]
55
+ )
56
+ }
57
+
58
+ func testMoveExpr4( ) {
59
+ assertParse (
60
+ """
61
+ _move(t)
62
+ """ ,
63
+ substructure: FunctionCallExprSyntax (
64
+ calledExpression: DeclReferenceExprSyntax ( baseName: . identifier( " _move " ) ) ,
65
+ leftParen: . leftParenToken( ) ,
66
+ arguments: [ . init( expression: DeclReferenceExprSyntax ( baseName: . identifier( " t " ) ) ) ] ,
67
+ rightParen: . rightParenToken( )
68
+ ) ,
69
+ experimentalFeatures: [ . oldOwnershipOperatorSpellings]
70
+ )
71
+ }
72
+
73
+ func testMoveExpr5( ) {
74
+ assertParse (
75
+ """
76
+ _move(t)
77
+ """ ,
78
+ substructure: FunctionCallExprSyntax (
79
+ calledExpression: DeclReferenceExprSyntax ( baseName: . identifier( " _move " ) ) ,
80
+ leftParen: . leftParenToken( ) ,
81
+ arguments: [ . init( expression: DeclReferenceExprSyntax ( baseName: . identifier( " t " ) ) ) ] ,
82
+ rightParen: . rightParenToken( )
83
+ ) ,
84
+ experimentalFeatures: [ ]
85
+ )
86
+ }
87
+
88
+ func testMoveExpr6( ) {
89
+ assertParse (
48
90
"""
91
+ _move1️⃣ t
92
+ """ ,
93
+ diagnostics: [
94
+ DiagnosticSpec (
95
+ message: " consecutive statements on a line must be separated by newline or ';' " ,
96
+ fixIts: [ " insert newline " , " insert ';' " ]
97
+ )
98
+ ] ,
99
+ fixedSource:
100
+ """
101
+ _move
102
+ t
103
+ """ ,
104
+ experimentalFeatures: [ ]
49
105
)
50
106
}
51
107
0 commit comments