Skip to content

Commit ed1e40b

Browse files
committed
Chore: improve coverage
1 parent 8dedaf0 commit ed1e40b

File tree

4 files changed

+229
-22
lines changed

4 files changed

+229
-22
lines changed

.vscode/settings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
{"language": "html", "autoFix": true},
55
{"language": "vue", "autoFix": true},
66
{"language": "typescript", "autoFix": true}
7-
],
8-
"files.insertFinalNewline": false
7+
]
98
}

test/fixtures/ast/textarea/ast.json

Lines changed: 221 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
"type": "VElement",
2525
"range": [
2626
0,
27-
150
27+
178
2828
],
2929
"loc": {
3030
"start": {
3131
"line": 1,
3232
"column": 0
3333
},
3434
"end": {
35-
"line": 6,
35+
"line": 7,
3636
"column": 11
3737
}
3838
},
@@ -505,7 +505,7 @@
505505
"type": "VText",
506506
"range": [
507507
138,
508-
139
508+
143
509509
],
510510
"loc": {
511511
"start": {
@@ -514,6 +514,99 @@
514514
},
515515
"end": {
516516
"line": 6,
517+
"column": 4
518+
}
519+
},
520+
"value": "\n "
521+
},
522+
{
523+
"type": "VElement",
524+
"range": [
525+
143,
526+
166
527+
],
528+
"loc": {
529+
"start": {
530+
"line": 6,
531+
"column": 4
532+
},
533+
"end": {
534+
"line": 6,
535+
"column": 27
536+
}
537+
},
538+
"name": "textarea",
539+
"namespace": "http://www.w3.org/1999/xhtml",
540+
"startTag": {
541+
"type": "VStartTag",
542+
"range": [
543+
143,
544+
153
545+
],
546+
"loc": {
547+
"start": {
548+
"line": 6,
549+
"column": 4
550+
},
551+
"end": {
552+
"line": 6,
553+
"column": 14
554+
}
555+
},
556+
"attributes": []
557+
},
558+
"children": [
559+
{
560+
"type": "VText",
561+
"range": [
562+
153,
563+
155
564+
],
565+
"loc": {
566+
"start": {
567+
"line": 6,
568+
"column": 14
569+
},
570+
"end": {
571+
"line": 6,
572+
"column": 16
573+
}
574+
},
575+
"value": "</"
576+
}
577+
],
578+
"endTag": {
579+
"type": "VEndTag",
580+
"range": [
581+
155,
582+
166
583+
],
584+
"loc": {
585+
"start": {
586+
"line": 6,
587+
"column": 16
588+
},
589+
"end": {
590+
"line": 6,
591+
"column": 27
592+
}
593+
}
594+
},
595+
"variables": []
596+
},
597+
{
598+
"type": "VText",
599+
"range": [
600+
166,
601+
167
602+
],
603+
"loc": {
604+
"start": {
605+
"line": 6,
606+
"column": 27
607+
},
608+
"end": {
609+
"line": 7,
517610
"column": 0
518611
}
519612
},
@@ -523,16 +616,16 @@
523616
"endTag": {
524617
"type": "VEndTag",
525618
"range": [
526-
139,
527-
150
619+
167,
620+
178
528621
],
529622
"loc": {
530623
"start": {
531-
"line": 6,
624+
"line": 7,
532625
"column": 0
533626
},
534627
"end": {
535-
"line": 6,
628+
"line": 7,
536629
"column": 11
537630
}
538631
}
@@ -1107,7 +1200,7 @@
11071200
"type": "HTMLWhitespace",
11081201
"range": [
11091202
138,
1110-
139
1203+
143
11111204
],
11121205
"loc": {
11131206
"start": {
@@ -1116,6 +1209,114 @@
11161209
},
11171210
"end": {
11181211
"line": 6,
1212+
"column": 4
1213+
}
1214+
},
1215+
"value": "\n "
1216+
},
1217+
{
1218+
"type": "HTMLTagOpen",
1219+
"range": [
1220+
143,
1221+
152
1222+
],
1223+
"loc": {
1224+
"start": {
1225+
"line": 6,
1226+
"column": 4
1227+
},
1228+
"end": {
1229+
"line": 6,
1230+
"column": 13
1231+
}
1232+
},
1233+
"value": "textarea"
1234+
},
1235+
{
1236+
"type": "HTMLTagClose",
1237+
"range": [
1238+
152,
1239+
153
1240+
],
1241+
"loc": {
1242+
"start": {
1243+
"line": 6,
1244+
"column": 13
1245+
},
1246+
"end": {
1247+
"line": 6,
1248+
"column": 14
1249+
}
1250+
},
1251+
"value": ""
1252+
},
1253+
{
1254+
"type": "HTMLRCDataText",
1255+
"range": [
1256+
153,
1257+
155
1258+
],
1259+
"loc": {
1260+
"start": {
1261+
"line": 6,
1262+
"column": 14
1263+
},
1264+
"end": {
1265+
"line": 6,
1266+
"column": 16
1267+
}
1268+
},
1269+
"value": "</"
1270+
},
1271+
{
1272+
"type": "HTMLEndTagOpen",
1273+
"range": [
1274+
155,
1275+
165
1276+
],
1277+
"loc": {
1278+
"start": {
1279+
"line": 6,
1280+
"column": 16
1281+
},
1282+
"end": {
1283+
"line": 6,
1284+
"column": 26
1285+
}
1286+
},
1287+
"value": "textarea"
1288+
},
1289+
{
1290+
"type": "HTMLTagClose",
1291+
"range": [
1292+
165,
1293+
166
1294+
],
1295+
"loc": {
1296+
"start": {
1297+
"line": 6,
1298+
"column": 26
1299+
},
1300+
"end": {
1301+
"line": 6,
1302+
"column": 27
1303+
}
1304+
},
1305+
"value": ""
1306+
},
1307+
{
1308+
"type": "HTMLWhitespace",
1309+
"range": [
1310+
166,
1311+
167
1312+
],
1313+
"loc": {
1314+
"start": {
1315+
"line": 6,
1316+
"column": 27
1317+
},
1318+
"end": {
1319+
"line": 7,
11191320
"column": 0
11201321
}
11211322
},
@@ -1124,16 +1325,16 @@
11241325
{
11251326
"type": "HTMLEndTagOpen",
11261327
"range": [
1127-
139,
1128-
149
1328+
167,
1329+
177
11291330
],
11301331
"loc": {
11311332
"start": {
1132-
"line": 6,
1333+
"line": 7,
11331334
"column": 0
11341335
},
11351336
"end": {
1136-
"line": 6,
1337+
"line": 7,
11371338
"column": 10
11381339
}
11391340
},
@@ -1142,16 +1343,16 @@
11421343
{
11431344
"type": "HTMLTagClose",
11441345
"range": [
1145-
149,
1146-
150
1346+
177,
1347+
178
11471348
],
11481349
"loc": {
11491350
"start": {
1150-
"line": 6,
1351+
"line": 7,
11511352
"column": 10
11521353
},
11531354
"end": {
1154-
"line": 6,
1355+
"line": 7,
11551356
"column": 11
11561357
}
11571358
},
@@ -1160,16 +1361,16 @@
11601361
{
11611362
"type": "HTMLWhitespace",
11621363
"range": [
1163-
150,
1164-
151
1364+
178,
1365+
179
11651366
],
11661367
"loc": {
11671368
"start": {
1168-
"line": 6,
1369+
"line": 7,
11691370
"column": 11
11701371
},
11711372
"end": {
1172-
"line": 7,
1373+
"line": 8,
11731374
"column": 0
11741375
}
11751376
},

test/fixtures/ast/textarea/source.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
<textarea>Ran &amp; Chen</textarea>
44
<textarea><foo></foo></textarea>
55
<textarea>{{a + b}}</textarea>
6+
<textarea></</textarea>
67
</template>

test/fixtures/ast/textarea/token-ranges.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@
3030
"}}",
3131
"</textarea",
3232
">",
33+
"\n ",
34+
"<textarea",
35+
">",
36+
"</",
37+
"</textarea",
38+
">",
3339
"\n",
3440
"</template",
3541
">",

0 commit comments

Comments
 (0)