11
11
async def test_apply_full_change_should_work () -> None :
12
12
text = """first"""
13
13
new_text = """changed"""
14
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
14
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
15
15
assert document .text () == text
16
16
17
17
document .apply_full_change (1 , new_text )
@@ -23,7 +23,7 @@ async def test_apply_full_change_should_work() -> None:
23
23
async def test_apply_apply_incremental_change_at_begining_should_work () -> None :
24
24
text = """first"""
25
25
new_text = """changed"""
26
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
26
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
27
27
assert document .text () == text
28
28
29
29
document .apply_incremental_change (
@@ -38,7 +38,7 @@ async def test_apply_apply_incremental_change_at_end_should_work() -> None:
38
38
text = """first"""
39
39
new_text = """changed"""
40
40
41
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
41
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
42
42
assert document .text () == text
43
43
44
44
document .apply_incremental_change (
@@ -53,7 +53,7 @@ async def test_save_and_revert_should_work() -> None:
53
53
text = """first"""
54
54
new_text = """changed"""
55
55
56
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
56
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
57
57
assert document .text () == text
58
58
59
59
assert not document .revert (None )
@@ -93,7 +93,7 @@ async def test_apply_apply_incremental_change_in_the_middle_should_work() -> Non
93
93
second changed line
94
94
third"""
95
95
96
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
96
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
97
97
assert document .text () == text
98
98
99
99
document .apply_incremental_change (
@@ -111,7 +111,7 @@ async def test_apply_apply_incremental_change_with_start_line_eq_len_lines_shoul
111
111
third"""
112
112
new_text = """changed """
113
113
114
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
114
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
115
115
assert document .text () == text
116
116
117
117
document .apply_incremental_change (
@@ -126,7 +126,7 @@ async def test_apply_apply_incremental_change_with_wrong_range_should_raise_inva
126
126
text = """first"""
127
127
new_text = """changed"""
128
128
129
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
129
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
130
130
assert document .text () == text
131
131
132
132
with pytest .raises (InvalidRangeError ):
@@ -139,7 +139,7 @@ async def test_apply_apply_incremental_change_with_wrong_range_should_raise_inva
139
139
async def test_apply_none_change_should_work () -> None :
140
140
text = """first"""
141
141
142
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
142
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
143
143
assert document .text () == text
144
144
145
145
document .apply_none_change ()
@@ -155,7 +155,7 @@ async def test_lines_should_give_the_lines_of_the_document() -> None:
155
155
third
156
156
"""
157
157
158
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
158
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
159
159
assert document .text () == text
160
160
161
161
document .apply_none_change ()
@@ -177,7 +177,7 @@ class WeakReferencable:
177
177
key = WeakReferencable ()
178
178
data = "some data"
179
179
180
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
180
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
181
181
document .set_data (key , data )
182
182
183
183
assert document .get_data (key ) == data
@@ -202,7 +202,7 @@ async def test_document_get_set_cache_with_function_should_work() -> None:
202
202
async def get_data (document : TextDocument , data : str ) -> str :
203
203
return prefix + data
204
204
205
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
205
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
206
206
207
207
assert await document .get_cache (get_data , "data" ) == "1data"
208
208
@@ -228,7 +228,7 @@ async def test_document_get_set_cache_with_method_should_work() -> None:
228
228
second
229
229
third
230
230
"""
231
- document = TextDocument (document_uri = "file://test.robot" , language_id = "robotframework" , version = 1 , text = text )
231
+ document = TextDocument (document_uri = "file:/// test.robot" , language_id = "robotframework" , version = 1 , text = text )
232
232
233
233
prefix = "1"
234
234
0 commit comments