45 const char* json_str = js.ToCString();
49 "{\"type\":\"SourceReport\",\"ranges\":"
52 "[{\"scriptIndex\":0,\"startPos\":0,\"endPos\":9,\"compiled\":true,"
53 "\"coverage\":{\"hits\":[0],\"misses\":[]}}],"
56 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
57 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
79 const char* json_str = js.ToCString();
83 "{\"type\":\"SourceReport\",\"ranges\":"
86 "[{\"scriptIndex\":0,\"startPos\":0,\"endPos\":9,\"compiled\":true,"
87 "\"coverage\":{\"hits\":[0],\"misses\":[]}}],"
90 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
91 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
113 const char* json_str = js.ToCString();
117 "{\"type\":\"SourceReport\",\"ranges\":"
131 const char* kScript =
151 const char* json_str = js.ToCString();
156 "{\"type\":\"SourceReport\",\"ranges\":["
159 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
160 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
163 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":24,\"compiled\":false},"
166 "{\"scriptIndex\":0,\"startPos\":26,\"endPos\":94,\"compiled\":true,"
167 "\"coverage\":{\"hits\":[26,53],\"misses\":[79]}}],"
170 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
171 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
179 const char* kScript =
199 const char* json_str = js.ToCString();
205 "{\"type\":\"SourceReport\",\"ranges\":["
208 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
209 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
212 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":24,\"compiled\":true,"
213 "\"coverage\":{\"hits\":[],\"misses\":[13]}},"
216 "{\"scriptIndex\":0,\"startPos\":26,\"endPos\":94,\"compiled\":true,"
217 "\"coverage\":{\"hits\":[26,53],\"misses\":[79]}}],"
220 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
221 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
229 const char* kScript =
232 " helper1() { helper0(); }\n"
247 const char* json_str = js.ToCString();
252 "{\"type\":\"SourceReport\",\"ranges\":["
255 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":55,\"compiled\":false},"
258 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
259 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
262 "{\"scriptIndex\":0,\"startPos\":57,\"endPos\":79,\"compiled\":true,"
263 "\"coverage\":{\"hits\":[57,68],\"misses\":[]}}],"
266 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
267 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
275 const char* kScript =
278 " helper1() { helper0(); }\n"
293 const char* json_str = js.ToCString();
298 "{\"type\":\"SourceReport\",\"ranges\":["
301 "{\"scriptIndex\":0,\"startPos\":30,\"endPos\":53,\"compiled\":true,"
302 "\"coverage\":{\"hits\":[],\"misses\":[30,42]}},"
305 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
306 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
309 "{\"scriptIndex\":0,\"startPos\":57,\"endPos\":79,\"compiled\":true,"
310 "\"coverage\":{\"hits\":[57,68],\"misses\":[]}}],"
313 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
314 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
322 const char* kScript =
325 " helper1() { helper0()+ }\n"
340 const char* json_str = js.ToCString();
345 "{\"type\":\"SourceReport\",\"ranges\":["
348 "{\"scriptIndex\":0,\"startPos\":30,\"endPos\":53,\"compiled\":false,"
349 "\"error\":{\"type\":\"@Error\",\"_vmType\":\"LanguageError\","
350 "\"kind\":\"LanguageError\",\"id\":\"objects\\/0\","
351 "\"message\":\"'file:\\/\\/\\/test-lib': error: "
353 "Error: This couldn't be parsed.\\n"
354 " helper1() { helper0()+ }\\n ^\"}},"
357 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
358 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
361 "{\"scriptIndex\":0,\"startPos\":57,\"endPos\":79,\"compiled\":true,"
362 "\"coverage\":{\"hits\":[57,68],\"misses\":[]}}],"
365 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
366 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
374 const char* kScript =
377 " helper1() { helper0(); }\n"
389 Zone* zone = thread->zone();
396 const char* json_str = js.ToCString();
401 "{\"type\":\"SourceReport\",\"ranges\":["
404 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":55,\"compiled\":false},"
407 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
408 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
411 "{\"scriptIndex\":0,\"startPos\":57,\"endPos\":79,\"compiled\":true,"
412 "\"coverage\":{\"hits\":[57,68],\"misses\":[]}}],"
415 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
416 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
424 const char* kScript =
426 " nestedHelper0() {}\n"
427 " nestedHelper1() {}\n"
428 " nestedHelper0();\n"
448 const char* json_str = js.ToCString();
454 "{\"type\":\"SourceReport\",\"ranges\":["
457 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":73,\"compiled\":true,"
458 "\"coverage\":{\"hits\":[0,56],\"misses\":[]}},"
461 "{\"scriptIndex\":0,\"startPos\":75,\"endPos\":86,\"compiled\":false},"
464 "{\"scriptIndex\":0,\"startPos\":88,\"endPos\":156,\"compiled\":true,"
465 "\"coverage\":{\"hits\":[88,115],\"misses\":[141]}},"
468 "{\"scriptIndex\":0,\"startPos\":14,\"endPos\":31,\"compiled\":true,"
469 "\"coverage\":{\"hits\":[14],\"misses\":[]}},"
472 "{\"scriptIndex\":0,\"startPos\":35,\"endPos\":52,\"compiled\":false}],"
475 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
476 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
484 const char* kScript =
486 " nestedHelper0() {}\n"
487 " nestedHelper1() {}\n"
488 " nestedHelper0();\n"
511 const char* json_str = js.ToCString();
517 "{\"type\":\"SourceReport\",\"ranges\":["
520 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":73,\"compiled\":true,"
521 "\"coverage\":{\"hits\":[0,56],\"misses\":[]}},"
524 "{\"scriptIndex\":0,\"startPos\":14,\"endPos\":31,\"compiled\":true,"
525 "\"coverage\":{\"hits\":[14],\"misses\":[]}},"
528 "{\"scriptIndex\":0,\"startPos\":35,\"endPos\":52,\"compiled\":false}],"
531 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
532 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
537 const char* kScript =
558 const char*
result = js.ToCString();
561 EXPECT_SUBSTRING(
"{\"type\":\"SourceReport\",\"ranges\":[",
result);
565 "\"startPos\":26,\"endPos\":94,\"compiled\":true,"
566 "\"coverage\":{\"hits\":[26,53],\"misses\":[79]}",
570 EXPECT_SUBSTRING(
"\"scriptIndex\":0",
result);
571 EXPECT_SUBSTRING(
"\"scriptIndex\":1",
result);
572 EXPECT_SUBSTRING(
"\"scriptIndex\":2",
result);
576 const char* kScript =
597 const char*
result = js.ToCString();
600 EXPECT_SUBSTRING(
"{\"type\":\"SourceReport\",\"ranges\":[",
result);
604 "\"startPos\":26,\"endPos\":94,\"compiled\":true,"
605 "\"coverage\":{\"hits\":[26,53],\"misses\":[79]}",
609 EXPECT_SUBSTRING(
"\"scriptIndex\":0",
result);
610 EXPECT_SUBSTRING(
"\"scriptIndex\":1",
result);
611 EXPECT_SUBSTRING(
"\"scriptIndex\":2",
result);
618 const char* kScript =
634 const char* json_str = js.ToCString();
639 "{\"type\":\"SourceReport\",\"ranges\":["
642 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
646 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":24,\"compiled\":false},"
649 "{\"scriptIndex\":0,\"startPos\":26,\"endPos\":48,\"compiled\":true,"
651 "{\"name\":\"helper0\",\"tokenPos\":37,\"cacheEntries\":["
652 "{\"target\":{\"type\":\"@Function\",\"fixedId\":true,\"id\":\"\","
653 "\"name\":\"helper0\",\"owner\":{\"type\":\"@Library\",\"fixedId\":true,"
654 "\"id\":\"\",\"name\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\"},"
655 "\"_kind\":\"RegularFunction\",\"static\":true,\"const\":false,"
656 "\"implicit\":false,\"abstract\":false,"
657 "\"_intrinsic\":false,\"_native\":false,\"isGetter\":false,"
658 "\"isSetter\":false,\"location\":{\"type\":"
659 "\"SourceLocation\",\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
660 "\"id\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"},"
661 "\"tokenPos\":0,\"endTokenPos\":11,\"line\":1,\"column\":1}},\"count\":1}"
665 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
666 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
674 const char* kScript =
685 " Common common = new Common();\n"
686 " Uncommon uncommon = new Uncommon();\n"
689 " helper(uncommon);\n"
703 const char* json_str = js.ToCString();
708 "{\"type\":\"SourceReport\",\"ranges\":["
711 "{\"scriptIndex\":0,\"startPos\":60,\"endPos\":88,\"compiled\":true,"
714 "\"callSites\":[{\"name\":\"dyn:func\",\"tokenPos\":80,\"cacheEntries\":["
717 "{\"receiver\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
718 "\"name\":\"Common\","
719 "\"location\":{\"type\":\"SourceLocation\","
720 "\"script\":{\"type\":\"@Script\","
721 "\"fixedId\":true,\"id\":\"\","
722 "\"uri\":\"file:\\/\\/\\/test-lib\","
723 "\"_kind\":\"kernel\"},\"tokenPos\":0,\"endTokenPos\":27,\"line\":1,"
725 "\"library\":{\"type\":\"@Library\",\"fixedId\":true,"
726 "\"id\":\"\",\"name\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\"}},"
728 "\"target\":{\"type\":\"@Function\",\"fixedId\":true,\"id\":\"\","
730 "\"owner\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
731 "\"name\":\"Common\","
732 "\"location\":{\"type\":\"SourceLocation\","
733 "\"script\":{\"type\":\"@Script\","
734 "\"fixedId\":true,\"id\":\"\","
735 "\"uri\":\"file:\\/\\/\\/test-lib\","
736 "\"_kind\":\"kernel\"},\"tokenPos\":0,\"endTokenPos\":27,\"line\":1,"
738 "\"library\":{\"type\":\"@Library\",\"fixedId\":true,"
739 "\"id\":\"\",\"name\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\"}"
740 "},\"_kind\":\"RegularFunction\","
741 "\"static\":false,\"const\":false,\"implicit\":false,\"abstract\":"
742 "false,\"_intrinsic\":false,"
743 "\"_native\":false,\"isGetter\":false,\"isSetter\":false,"
744 "\"location\":{\"type\":\"SourceLocation\","
745 "\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
746 "\"id\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\","
747 "\"_kind\":\"kernel\"},\"tokenPos\":17,\"endTokenPos\":25,\"line\":2,"
753 "{\"receiver\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
754 "\"name\":\"Uncommon\","
755 "\"location\":{\"type\":\"SourceLocation\","
756 "\"script\":{\"type\":\"@Script\","
757 "\"fixedId\":true,\"id\":\"\","
758 "\"uri\":\"file:\\/\\/\\/test-lib\","
759 "\"_kind\":\"kernel\"},\"tokenPos\":29,\"endTokenPos\":58,\"line\":4,"
761 "\"library\":{\"type\":\"@Library\",\"fixedId\":true,"
762 "\"id\":\"\",\"name\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\"}},"
764 "\"target\":{\"type\":\"@Function\",\"fixedId\":true,\"id\":\"\","
766 "\"owner\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
767 "\"name\":\"Uncommon\","
768 "\"location\":{\"type\":\"SourceLocation\","
769 "\"script\":{\"type\":\"@Script\","
770 "\"fixedId\":true,\"id\":\"\","
771 "\"uri\":\"file:\\/\\/\\/test-lib\","
772 "\"_kind\":\"kernel\"},\"tokenPos\":29,\"endTokenPos\":58,\"line\":4,"
774 "\"library\":{\"type\":\"@Library\",\"fixedId\":true,"
775 "\"id\":\"\",\"name\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\"}"
776 "},\"_kind\":\"RegularFunction\","
777 "\"static\":false,\"const\":false,\"implicit\":false,\"abstract\":"
778 "false,\"_intrinsic\":false,"
779 "\"_native\":false,\"isGetter\":false,\"isSetter\":false,"
780 "\"location\":{\"type\":\"SourceLocation\","
781 "\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
782 "\"id\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\","
783 "\"_kind\":\"kernel\"},\"tokenPos\":48,\"endTokenPos\":56,\"line\":5,"
789 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
790 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
798 const char* kScript =
814 const char* json_str = js.ToCString();
819 "{\"type\":\"SourceReport\",\"ranges\":["
822 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
824 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
827 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":24,\"compiled\":false},"
830 "{\"scriptIndex\":0,\"startPos\":26,\"endPos\":48,\"compiled\":true,"
831 "\"callSites\":[{\"name\":\"helper0\",\"tokenPos\":37,\"cacheEntries\":[{"
832 "\"target\":{\"type\":\"@Function\",\"fixedId\":true,\"id\":\"\","
833 "\"name\":\"helper0\",\"owner\":{\"type\":\"@Library\",\"fixedId\":true,"
834 "\"id\":\"\",\"name\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\"},\"_"
835 "kind\":\"RegularFunction\",\"static\":true,\"const\":false,\"implicit\":"
836 "false,\"abstract\":false,\"_"
837 "intrinsic\":false,\"_native\":false,\"isGetter\":false,"
838 "\"isSetter\":false,\"location\":{\"type\":"
839 "\"SourceLocation\",\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
840 "\"id\":\"\",\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"},"
841 "\"tokenPos\":0,\"endTokenPos\":11,\"line\":1,\"column\":1}},\"count\":1}"
843 "\"hits\":[26,37],\"misses\":[]}}],"
846 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
847 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
855 const char* kScript =
875 const char* json_str = js.ToCString();
880 "{\"type\":\"SourceReport\",\"ranges\":["
883 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":11,\"compiled\":true,"
884 "\"possibleBreakpoints\":[7,11]},"
887 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":24,\"compiled\":false},"
890 "{\"scriptIndex\":0,\"startPos\":26,\"endPos\":94,\"compiled\":true,"
891 "\"possibleBreakpoints\":[30,53,79,94]}],"
894 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
895 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
903 const char* kScript =
907 "class Unused implements Foo {\n"
908 " dynamic noSuchMethod(_) {}\n"
923 const char* json_str = js.ToCString();
928 "{\"type\":\"SourceReport\",\"ranges\":["
931 "{\"scriptIndex\":0,\"startPos\":14,\"endPos\":26,\"compiled\":true,"
932 "\"coverage\":{\"hits\":[14],\"misses\":[]}},"
935 "{\"scriptIndex\":0,\"startPos\":62,\"endPos\":87,\"compiled\":true,"
936 "\"coverage\":{\"hits\":[],\"misses\":[62]}},"
939 "{\"scriptIndex\":0,\"startPos\":91,\"endPos\":120,\"compiled\":true,"
940 "\"coverage\":{\"hits\":[91,107,113],\"misses\":[]}}],"
943 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
944 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
952 const char* kScript =
953 "void foo(Object? bar) {\n"
954 " assert(bar == null);\n"
972 const char* json_str = js.ToCString();
977 "{\"type\":\"SourceReport\",\"ranges\":["
980 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":47,\"compiled\":true,"
981 "\"coverage\":{\"hits\":[0,33],\"misses\":[]}},"
984 "{\"scriptIndex\":0,\"startPos\":49,\"endPos\":76,\"compiled\":true,"
985 "\"coverage\":{\"hits\":[49,65],\"misses\":[]}}],"
988 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
989 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
997 const char* kScript =
998 "abstract class AllStatic {\n"
1000 " static int test() => 123;\n"
1001 " static int foo = 456;\n"
1003 "class NotAbstract {\n"
1004 " NotAbstract._();\n"
1005 " static int test() => 123;\n"
1006 " static int foo = 456;\n"
1008 "abstract class NotConstructor {\n"
1010 " static int test() => 123;\n"
1012 "abstract class NotPrivate {\n"
1014 " static int test() => 123;\n"
1016 "abstract class HasParams {\n"
1017 " HasParams._(int i);\n"
1018 " static int test() => 123;\n"
1020 "abstract class HasFields {\n"
1022 " static int test() => 123;\n"
1025 "abstract class HasNonStaticFunction {\n"
1026 " HasNonStaticFunction._();\n"
1027 " static int test() => 123;\n"
1028 " int foo() => 456;\n"
1030 "abstract class HasSubclass {\n"
1031 " HasSubclass._();\n"
1032 " static int test() => 123;\n"
1033 " static int foo = 456;\n"
1035 "abstract class Subclass extends HasSubclass {\n"
1036 " Subclass() : super._();\n"
1039 " AllStatic.test();\n"
1040 " NotAbstract.test();\n"
1041 " NotConstructor.test();\n"
1042 " NotPrivate.test();\n"
1043 " HasParams.test();\n"
1044 " HasFields.test();\n"
1045 " HasNonStaticFunction.test();\n"
1046 " HasSubclass.test();\n"
1058 const char* json_str = js.ToCString();
1063 "{\"type\":\"SourceReport\",\"ranges\":["
1066 "{\"scriptIndex\":0,\"startPos\":775,\"endPos\":797,\"compiled\":true,"
1067 "\"coverage\":{\"hits\":[],\"misses\":[775,794]}},"
1070 "{\"scriptIndex\":0,\"startPos\":46,\"endPos\":70,\"compiled\":true,"
1071 "\"coverage\":{\"hits\":[46],\"misses\":[]}},"
1074 "{\"scriptIndex\":0,\"startPos\":656,\"endPos\":671,\"compiled\":true,"
1075 "\"coverage\":{\"hits\":[],\"misses\":[656]}},"
1078 "{\"scriptIndex\":0,\"startPos\":675,\"endPos\":699,\"compiled\":true,"
1079 "\"coverage\":{\"hits\":[675],\"misses\":[]}},"
1082 "{\"scriptIndex\":0,\"startPos\":370,\"endPos\":388,\"compiled\":true,"
1083 "\"coverage\":{\"hits\":[],\"misses\":[370]}},"
1086 "{\"scriptIndex\":0,\"startPos\":392,\"endPos\":416,\"compiled\":true,"
1087 "\"coverage\":{\"hits\":[392],\"misses\":[]}},"
1090 "{\"scriptIndex\":0,\"startPos\":120,\"endPos\":135,\"compiled\":true,"
1091 "\"coverage\":{\"hits\":[],\"misses\":[120]}},"
1094 "{\"scriptIndex\":0,\"startPos\":139,\"endPos\":163,\"compiled\":true,"
1095 "\"coverage\":{\"hits\":[139],\"misses\":[]}},"
1098 "{\"scriptIndex\":0,\"startPos\":449,\"endPos\":462,\"compiled\":true,"
1099 "\"coverage\":{\"hits\":[],\"misses\":[449]}},"
1102 "{\"scriptIndex\":0,\"startPos\":466,\"endPos\":490,\"compiled\":true,"
1103 "\"coverage\":{\"hits\":[466],\"misses\":[]}},"
1106 "{\"scriptIndex\":0,\"startPos\":297,\"endPos\":309,\"compiled\":true,"
1107 "\"coverage\":{\"hits\":[],\"misses\":[297]}},"
1110 "{\"scriptIndex\":0,\"startPos\":313,\"endPos\":337,\"compiled\":true,"
1111 "\"coverage\":{\"hits\":[313],\"misses\":[]}},"
1114 "{\"scriptIndex\":0,\"startPos\":549,\"endPos\":573,\"compiled\":true,"
1115 "\"coverage\":{\"hits\":[],\"misses\":[549]}},"
1118 "{\"scriptIndex\":0,\"startPos\":577,\"endPos\":601,\"compiled\":true,"
1119 "\"coverage\":{\"hits\":[577],\"misses\":[]}},"
1122 "{\"scriptIndex\":0,\"startPos\":605,\"endPos\":621,\"compiled\":true,"
1123 "\"coverage\":{\"hits\":[],\"misses\":[605]}},"
1126 "{\"scriptIndex\":0,\"startPos\":225,\"endPos\":235,\"compiled\":true,"
1127 "\"coverage\":{\"hits\":[],\"misses\":[225]}},"
1130 "{\"scriptIndex\":0,\"startPos\":239,\"endPos\":263,\"compiled\":true,"
1131 "\"coverage\":{\"hits\":[239],\"misses\":[]}},"
1134 "{\"scriptIndex\":0,\"startPos\":801,\"endPos\":996,\"compiled\":true,"
1135 "\"coverage\":{\"hits\":"
1136 "[801,827,849,874,895,915,935,966,988],\"misses\":[]}}],"
1139 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1140 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1149 const char* kScript =
1150 "int foo(bool bar) {\n"
1151 " late final int baz;\n"
1173 const char* json_str = js.ToCString();
1178 "{\"type\":\"SourceReport\",\"ranges\":["
1181 "{\"scriptIndex\":0,\"startPos\":0,\"endPos\":114,\"compiled\":true,"
1182 "\"coverage\":{\"hits\":[0],\"misses\":[]}},"
1185 "{\"scriptIndex\":0,\"startPos\":116,\"endPos\":152,\"compiled\":true,\""
1186 "coverage\":{\"hits\":[116,127,140],\"misses\":[]}}],"
1189 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1190 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1200 const char* kScript =
1203 " const FoodType();\n"
1204 " factory FoodType.candyFactory() => candy;\n"
1207 " final food = FoodType.candyFactory();\n"
1219 const char* json_str = js.ToCString();
1224 "{\"type\":\"SourceReport\",\"ranges\":["
1227 "{\"scriptIndex\":0,\"startPos\":49,\"endPos\":89,\"compiled\":true,"
1228 "\"coverage\":{\"hits\":[49],\"misses\":[]}},"
1232 "{\"scriptIndex\":0,\"startPos\":93,\"endPos\":147,\"compiled\":true,"
1233 "\"coverage\":{\"hits\":[93,131],\"misses\":[]}}],"
1236 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1237 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1245 const char* kScript = R
"(
1248 factory A.foo(int i) = B; // LINE_A
1253 B(this.i); // LINE_B
1270 const char* json_str = js.ToCString();
1275 "{\"type\":\"SourceReport\",\"ranges\":["
1278 "{\"scriptIndex\":0,\"startPos\":13,\"endPos\":16,\"compiled\":true,"
1279 "\"coverage\":{\"hits\":[13],\"misses\":[]}},"
1282 "{\"scriptIndex\":0,\"startPos\":90,\"endPos\":99,\"compiled\":true,"
1283 "\"coverage\":{\"hits\":[90],\"misses\":[]}},"
1286 "{\"scriptIndex\":0,\"startPos\":114,\"endPos\":136,\"compiled\":true,"
1287 "\"coverage\":{\"hits\":[114,127],\"misses\":[]}}],"
1290 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1291 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1299 const char* kScript = R
"(
1307String destructure(Map<String, dynamic> map) {
1308 final {'hello': world, 'count': count} = map;
1309 return 'Hello $world, count: $count';
1322 const char* json_str = js.ToCString();
1327 "{\"type\":\"SourceReport\",\"ranges\":["
1330 "{\"scriptIndex\":0,\"startPos\":1,\"endPos\":78,\"compiled\":true,"
1331 "\"coverage\":{\"hits\":[1,12,24,61],\"misses\":[]}},"
1334 "{\"scriptIndex\":0,\"startPos\":81,\"endPos\":216,\"compiled\":true,"
1335 "\"coverage\":{\"hits\":[81,144,160,214],\"misses\":[]}}],"
1338 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1339 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1347 const char* kScript = R
"(
1377 const char* json_str = js.ToCString();
1382 "{\"type\":\"SourceReport\",\"ranges\":["
1386 "{\"scriptIndex\":0,\"startPos\":1,\"endPos\":135,\"compiled\":true,"
1387 "\"branchCoverage\":{\"hits\":[1,34,82],\"misses\":[52,115]}},"
1390 "{\"scriptIndex\":0,\"startPos\":138,\"endPos\":160,\"compiled\":true,"
1391 "\"branchCoverage\":{\"hits\":[138],\"misses\":[]}}],"
1394 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1395 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1403 const char* kScript = R
"(
1415 for (int i = 0; i < 10; ++i) {
1419 for (final i in [1, 2, 3]) {
1443 const char* json_str = js.ToCString();
1448 "{\"type\":\"SourceReport\",\"ranges\":["
1452 "{\"scriptIndex\":0,\"startPos\":1,\"endPos\":205,\"compiled\":true,"
1453 "\"branchCoverage\":{\"hits\":[1,49,70,132,177],\"misses\":[]}},"
1456 "{\"scriptIndex\":0,\"startPos\":208,\"endPos\":231,\"compiled\":true,"
1457 "\"branchCoverage\":{\"hits\":[208],\"misses\":[]}}],"
1460 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1461 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1469 const char* kScript = R
"(
1470int switchTest(int x) {
1498 const char* json_str = js.ToCString();
1503 "{\"type\":\"SourceReport\",\"ranges\":["
1506 "{\"scriptIndex\":0,\"startPos\":1,\"endPos\":132,\"compiled\":true,"
1507 "\"branchCoverage\":{\"hits\":[1,73],\"misses\":[44,102]}},"
1510 "{\"scriptIndex\":0,\"startPos\":135,\"endPos\":161,\"compiled\":true,"
1511 "\"branchCoverage\":{\"hits\":[135],\"misses\":[]}}],"
1514 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1515 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
1523 const char* kScript = R
"(
1524void tryTestInner() {
1537void tryTestOuter() {
1561 const char* json_str = js.ToCString();
1566 "{\"type\":\"SourceReport\",\"ranges\":["
1570 "{\"scriptIndex\":0,\"startPos\":1,\"endPos\":126,\"compiled\":true,"
1571 "\"branchCoverage\":{\"hits\":[1,29,62,76,89,120],\"misses\":[]}},"
1575 "{\"scriptIndex\":0,\"startPos\":129,\"endPos\":199,\"compiled\":true,"
1576 "\"branchCoverage\":{\"hits\":[129,157,193],\"misses\":[]}},"
1579 "{\"scriptIndex\":0,\"startPos\":202,\"endPos\":229,\"compiled\":true,"
1580 "\"branchCoverage\":{\"hits\":[202],\"misses\":[]}}],"
1583 "\"scripts\":[{\"type\":\"@Script\",\"fixedId\":true,\"id\":\"\","
1584 "\"uri\":\"file:\\/\\/\\/test-lib\",\"_kind\":\"kernel\"}]}",
static const size_t kBufferSize
static ObjectPtr UnwrapHandle(Dart_Handle object)
void Insert(typename KeyValueTrait::Pair kv)
TokenPosition token_pos() const
TokenPosition end_token_pos() const
void Add(const Object &value, Heap::Space space=Heap::kNew) const
static GrowableObjectArrayPtr New(Heap::Space space=Heap::kNew)
static IsolateGroup * Current()
void set_branch_coverage(bool value)
void set_asserts(bool value)
ScriptPtr LookupScript(const String &url, bool useResolvedUri=false) const
FunctionPtr LookupFunctionAllowPrivate(const String &name) const
void PrintJSON(JSONStream *js, const Script &script, TokenPosition start_pos=TokenPosition::kMinSource, TokenPosition end_pos=TokenPosition::kMaxSource)
static StringPtr New(const char *cstr, Heap::Space space=Heap::kNew)
static Dart_Handle LoadTestScript(const char *script, Dart_NativeEntryResolver resolver, const char *lib_uri=RESOLVED_USER_TEST_URI, bool finalize=true, bool allow_compile_errors=false)
static Dart_Handle LoadTestScriptWithErrors(const char *script, Dart_NativeEntryResolver resolver=nullptr, const char *lib_uri=RESOLVED_USER_TEST_URI, bool finalize=true)
static Thread * Current()
struct _Dart_Handle * Dart_Handle
static const uint8_t buffer[]
void ElideJSONSubstring(const char *prefix, const char *in, char *out, const char *postfix)
DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target, Dart_Handle name, int number_of_arguments, Dart_Handle *arguments)
Dart_Handle NewString(const char *str)
static ObjectPtr ExecuteScript(const char *script, bool allow_errors=false)
#define ISOLATE_UNIT_TEST_CASE(name)
#define RESOLVED_USER_TEST_URI
#define EXPECT_VALID(handle)