22const assert = require ( "assert" ) ;
33const getLocFromIndex = require ( "../../../lib/utils/get-loc-from-index" ) ;
44
5- describe ( "getLocFromIndex()" , function ( ) {
6- describe ( "when end-of-file === newline" , function ( ) {
7- it ( "should compute the location (simplest case)" , function ( ) {
5+ describe ( "getLocFromIndex()" , function ( ) {
6+ describe ( "when end-of-file === newline" , function ( ) {
7+ it ( "should compute the location (simplest case)" , function ( ) {
88 const index = 6 ;
99 const lines = [ "hey\n" , "how\n" , "are\n" , "you\n" , "" ] ;
1010
@@ -14,7 +14,7 @@ describe("getLocFromIndex()", function() {
1414 assert . equal ( column , 2 , "right column" ) ;
1515 } ) ;
1616
17- it ( "should compute location (on first line)" , function ( ) {
17+ it ( "should compute location (on first line)" , function ( ) {
1818 const index = 2 ;
1919 const lines = [ "hey\n" , "how\n" , "are\n" , "you\n" , "" ] ;
2020
@@ -24,7 +24,7 @@ describe("getLocFromIndex()", function() {
2424 assert . equal ( column , 2 , "right column" ) ;
2525 } ) ;
2626
27- it ( "should compute location (on first line's newline)" , function ( ) {
27+ it ( "should compute location (on first line's newline)" , function ( ) {
2828 const index = 4 ;
2929 const lines = [ "hey\n" , "how\n" , "are\n" , "you\n" , "" ] ;
3030
@@ -34,7 +34,7 @@ describe("getLocFromIndex()", function() {
3434 assert . equal ( column , 4 , "right column" ) ;
3535 } ) ;
3636
37- it ( "should compute location (on last line)" , function ( ) {
37+ it ( "should compute location (on last line)" , function ( ) {
3838 const index = 13 ;
3939 const lines = [ "hey\n" , "how\n" , "are\n" , "you\n" , "" ] ;
4040
@@ -44,7 +44,7 @@ describe("getLocFromIndex()", function() {
4444 assert . equal ( column , 1 , "right column" ) ;
4545 } ) ;
4646
47- it ( "should compute location (on last line's newline)" , function ( ) {
47+ it ( "should compute location (on last line's newline)" , function ( ) {
4848 const index = 16 ;
4949 const lines = [ "hey\n" , "how\n" , "are\n" , "you\n" , "" ] ;
5050
@@ -55,8 +55,8 @@ describe("getLocFromIndex()", function() {
5555 } ) ;
5656 } ) ;
5757
58- describe ( "when end-of-file !== newline" , function ( ) {
59- it ( "should compute the location (simplest case)" , function ( ) {
58+ describe ( "when end-of-file !== newline" , function ( ) {
59+ it ( "should compute the location (simplest case)" , function ( ) {
6060 const index = 6 ;
6161 const lines = [ "hey\n" , "how\n" , "are\n" , "you" ] ;
6262
@@ -66,7 +66,7 @@ describe("getLocFromIndex()", function() {
6666 assert . equal ( column , 2 , "right column" ) ;
6767 } ) ;
6868
69- it ( "should compute location (on first line)" , function ( ) {
69+ it ( "should compute location (on first line)" , function ( ) {
7070 const index = 2 ;
7171 const lines = [ "hey\n" , "how\n" , "are\n" , "you" ] ;
7272
@@ -76,7 +76,7 @@ describe("getLocFromIndex()", function() {
7676 assert . equal ( column , 2 , "right column" ) ;
7777 } ) ;
7878
79- it ( "should compute location (on first line's newline)" , function ( ) {
79+ it ( "should compute location (on first line's newline)" , function ( ) {
8080 const index = 4 ;
8181 const lines = [ "hey\n" , "how\n" , "are\n" , "you" ] ;
8282
@@ -86,7 +86,7 @@ describe("getLocFromIndex()", function() {
8686 assert . equal ( column , 4 , "right column" ) ;
8787 } ) ;
8888
89- it ( "should compute location (on last line)" , function ( ) {
89+ it ( "should compute location (on last line)" , function ( ) {
9090 const index = 13 ;
9191 const lines = [ "hey\n" , "how\n" , "are\n" , "you" ] ;
9292
@@ -96,7 +96,7 @@ describe("getLocFromIndex()", function() {
9696 assert . equal ( column , 1 , "right column" ) ;
9797 } ) ;
9898
99- it ( "should fallback on last character if index is out of range" , function ( ) {
99+ it ( "should fallback on last character if index is out of range" , function ( ) {
100100 const index = 50 ;
101101 const lines = [ "hey\n" , "how\n" , "are\n" , "you" ] ;
102102
0 commit comments