@@ -20,6 +20,7 @@ struct RatomlTest {
2020 urls : Vec < Url > ,
2121 server : Server ,
2222 tmp_path : Utf8PathBuf ,
23+ config_locked : bool ,
2324}
2425
2526impl RatomlTest {
@@ -65,13 +66,14 @@ impl RatomlTest {
6566
6667 let server = project. server_with_lock ( prelock) . wait_until_workspace_is_loaded ( ) ;
6768
68- let mut case = Self { urls : vec ! [ ] , server, tmp_path } ;
69- let urls = fixtures. iter ( ) . map ( |fixture| case. fixture_path ( fixture) ) . collect :: < Vec < _ > > ( ) ;
69+ let mut case = Self { urls : vec ! [ ] , server, tmp_path, config_locked : prelock } ;
70+ let urls =
71+ fixtures. iter ( ) . map ( |fixture| case. fixture_path ( fixture, prelock) ) . collect :: < Vec < _ > > ( ) ;
7072 case. urls = urls;
7173 case
7274 }
7375
74- fn fixture_path ( & self , fixture : & str ) -> Url {
76+ fn fixture_path ( & self , fixture : & str , prelock : bool ) -> Url {
7577 let mut lines = fixture. trim ( ) . split ( '\n' ) ;
7678
7779 let mut path =
@@ -89,6 +91,7 @@ impl RatomlTest {
8991 let mut spl = spl. into_iter ( ) ;
9092 if let Some ( first) = spl. next ( ) {
9193 if first == "$$CONFIG_DIR$$" {
94+ assert ! ( prelock, "this test requires prelock to be set" ) ;
9295 path = Config :: user_config_dir_path ( ) . unwrap ( ) . to_path_buf ( ) . into ( ) ;
9396 } else {
9497 path = path. join ( first) ;
@@ -109,7 +112,7 @@ impl RatomlTest {
109112 }
110113
111114 fn create ( & mut self , fixture_path : & str , text : String ) {
112- let url = self . fixture_path ( fixture_path) ;
115+ let url = self . fixture_path ( fixture_path, self . config_locked ) ;
113116
114117 self . server . notification :: < DidOpenTextDocument > ( DidOpenTextDocumentParams {
115118 text_document : TextDocumentItem {
0 commit comments