@@ -2116,7 +2116,7 @@ namespace ts.projectSystem {
21162116
21172117 const scriptInfo = project . getScriptInfo ( file1 . path ) ;
21182118 const snap = scriptInfo . getSnapshot ( ) ;
2119- const actualText = snap . getText ( 0 , snap . getLength ( ) ) ;
2119+ const actualText = getSnapshotText ( snap ) ;
21202120 assert . equal ( actualText , "" , `expected content to be empty string, got "${ actualText } "` ) ;
21212121
21222122 projectService . openClientFile ( file1 . path , `var x = 1;` ) ;
@@ -2128,8 +2128,7 @@ namespace ts.projectSystem {
21282128 projectService . closeClientFile ( file1 . path ) ;
21292129
21302130 const scriptInfo2 = project . getScriptInfo ( file1 . path ) ;
2131- const snap2 = scriptInfo2 . getSnapshot ( ) ;
2132- const actualText2 = snap2 . getText ( 0 , snap . getLength ( ) ) ;
2131+ const actualText2 = getSnapshotText ( scriptInfo2 . getSnapshot ( ) ) ;
21332132 assert . equal ( actualText2 , "" , `expected content to be empty string, got "${ actualText2 } "` ) ;
21342133 } ) ;
21352134
@@ -4178,7 +4177,7 @@ namespace ts.projectSystem {
41784177 // verify content
41794178 const projectServiice = session . getProjectService ( ) ;
41804179 const snap1 = projectServiice . getScriptInfo ( f1 . path ) . getSnapshot ( ) ;
4181- assert . equal ( snap1 . getText ( 0 , snap1 . getLength ( ) ) , tmp . content , "content should be equal to the content of temp file" ) ;
4180+ assert . equal ( getSnapshotText ( snap1 ) , tmp . content , "content should be equal to the content of temp file" ) ;
41824181
41834182 // reload from original file file
41844183 session . executeCommand ( < server . protocol . ReloadRequest > {
@@ -4190,7 +4189,7 @@ namespace ts.projectSystem {
41904189
41914190 // verify content
41924191 const snap2 = projectServiice . getScriptInfo ( f1 . path ) . getSnapshot ( ) ;
4193- assert . equal ( snap2 . getText ( 0 , snap2 . getLength ( ) ) , f1 . content , "content should be equal to the content of original file" ) ;
4192+ assert . equal ( getSnapshotText ( snap2 ) , f1 . content , "content should be equal to the content of original file" ) ;
41944193
41954194 } ) ;
41964195
@@ -4280,7 +4279,7 @@ namespace ts.projectSystem {
42804279
42814280 function checkScriptInfoContents ( contentsOfInfo : string , captionForContents : string ) {
42824281 const snap = info . getSnapshot ( ) ;
4283- assert . equal ( snap . getText ( 0 , snap . getLength ( ) ) , contentsOfInfo , "content should be equal to " + captionForContents ) ;
4282+ assert . equal ( getSnapshotText ( snap ) , contentsOfInfo , "content should be equal to " + captionForContents ) ;
42844283 }
42854284 } ) ;
42864285 } ) ;
0 commit comments