Lines Matching refs:verifyFormat
49 static void verifyFormat(
58 verifyFormat("a == = b;");
59 verifyFormat("a != = b;");
61 verifyFormat("a === b;");
62 verifyFormat("aaaaaaa ===\n b;", getGoogleJSStyleWithColumns(10));
63 verifyFormat("a !== b;");
64 verifyFormat("aaaaaaa !==\n b;", getGoogleJSStyleWithColumns(10));
65 verifyFormat("if (a + b + c +\n"
71 verifyFormat("a >> >= b;");
73 verifyFormat("a >>> b;");
74 verifyFormat("aaaaaaa >>>\n b;", getGoogleJSStyleWithColumns(10));
75 verifyFormat("a >>>= b;");
76 verifyFormat("aaaaaaa >>>=\n b;", getGoogleJSStyleWithColumns(10));
77 verifyFormat("if (a + b + c +\n"
82 verifyFormat("var x = aaaaaaaaaa ?\n"
87 verifyFormat("var b = a.map((x) => x + 1);");
88 verifyFormat("return ('aaa') in bbbb;");
91 verifyFormat("someFunction(...a);");
92 verifyFormat("var x = [1, ...a, 2];");
96 verifyFormat("e && e.SomeFunction();");
100 verifyFormat("not.and.or.not_eq = 1;");
106 verifyFormat("x.class.struct = 1;");
107 verifyFormat("x.case = 1;");
108 verifyFormat("x.interface = 1;");
109 verifyFormat("x = {\n"
114 verifyFormat("var struct = 2;");
115 verifyFormat("var union = 2;");
119 verifyFormat("var [a, b, c] = [1, 2, 3];");
120 verifyFormat("let [a, b, c] = [1, 2, 3];");
121 verifyFormat("var {a, b} = {a: 1, b: 2};");
122 verifyFormat("let {a, b} = {a: 1, b: 2};");
126 verifyFormat("var x = {y: function(a) { return a; }};");
127 verifyFormat("return {\n"
132 verifyFormat("return {\n"
138 verifyFormat("return {\n"
147 verifyFormat("var stuff = {\n"
155 verifyFormat("return {\n"
160 verifyFormat("var obj = {\n"
166 verifyFormat("var obj = {a: 123};");
168 verifyFormat("X = {\n a: 123\n};");
169 verifyFormat("X.Y = {\n a: 123\n};");
171 verifyFormat("function x() {\n"
174 verifyFormat("x = foo && {a: 123};");
177 verifyFormat("var x = {y: (a) => { return a; }};");
178 verifyFormat("var x = {y: (a) => a};");
181 verifyFormat("var x = {[a]: 1, b: 2, [c]: 3};");
182 verifyFormat("var x = {\n"
190 verifyFormat("var o = {\n"
196 verifyFormat("var o = {\n"
202 verifyFormat("var o = {\n"
208 verifyFormat("var o = {\n"
219 verifyFormat("var arr = [1, 2, 3];");
220 verifyFormat("f({a: 1, b: 2, c: 3});");
222 verifyFormat("var object_literal_with_long_name = {\n"
227 verifyFormat("f({a: 1, b: 2, c: 3});",
229 verifyFormat("f({'a': [{}]});");
233 verifyFormat("this.function('', true);");
237 verifyFormat("goog.scope(function() {\n"
241 verifyFormat("goog.scope(function() {\n"
249 verifyFormat("goog.module('this.is.really.absurdly.long');",
251 verifyFormat("goog.require('this.is.really.absurdly.long');",
253 verifyFormat("goog.provide('this.is.really.absurdly.long');",
255 verifyFormat("var long = goog.require('this.is.really.absurdly.long');",
257 verifyFormat("goog.setTestOnly('this.is.really.absurdly.long');",
261 verifyFormat(
267 verifyFormat("function outer1(a, b) {\n"
275 verifyFormat("function f() {}");
279 verifyFormat("var aaaaa: List<SomeThing> =\n"
281 verifyFormat("return [\n"
286 verifyFormat("var someVariable = SomeFunction([\n"
291 verifyFormat("var someVariable = SomeFunction([\n"
295 verifyFormat("var someVariable = SomeFunction(aaaa, [\n"
300 verifyFormat("var someVariable = SomeFunction(\n"
309 verifyFormat("someFunction([], {a: a});");
313 verifyFormat("doFoo(function() {});");
314 verifyFormat("doFoo(function() { return 1; });");
315 verifyFormat("var func = function() {\n"
318 verifyFormat("var func = //\n"
322 verifyFormat("return {\n"
329 verifyFormat("abc = xyz ? function() {\n"
335 verifyFormat("var closure = goog.bind(\n"
342 verifyFormat("var closure = goog.bind(function() { // comment\n"
346 verifyFormat("return {\n"
354 verifyFormat("{\n"
359 verifyFormat("someLooooooooongFunction(\n"
366 verifyFormat("f({a: function() { return 1; }});",
368 verifyFormat("f({\n"
373 verifyFormat("return {\n"
379 verifyFormat("this.someObject.doSomething(aaaaaaaaaaaaaaaaaaaaaaaaaa)\n"
385 verifyFormat("someFunction(goog.bind(function() {\n"
394 verifyFormat("someFunction(function() {\n"
405 verifyFormat("var func = function() {\n"
409 verifyFormat("var func = doSomething(function() { return 1; });", Style);
410 verifyFormat("var outer = function() {\n"
414 verifyFormat("function outer1(a, b) {\n"
420 verifyFormat("var func = function() { return 1; };", Style);
421 verifyFormat("var func = doSomething(function() { return 1; });", Style);
422 verifyFormat(
425 verifyFormat("function outer1(a, b) {\n"
431 verifyFormat("var func = function() {\n"
435 verifyFormat("var func = doSomething(function() {\n"
439 verifyFormat("var outer = function() {\n"
445 verifyFormat("function outer1(a, b) {\n"
453 verifyFormat("var func = function() {\n"
460 verifyFormat("promise.then(\n"
470 verifyFormat("promise.then(\n"
480 verifyFormat("promise.then(\n"
491 verifyFormat("getSomeLongPromise()\n"
497 verifyFormat("getSomeLongPromise()\n"
507 verifyFormat("getSomeLongPromise()\n"
513 verifyFormat("var x = (a) => {\n"
516 verifyFormat("var x = (a) => {\n"
520 verifyFormat("var x = (a: type): {some: type} => {\n"
523 verifyFormat("var x = (a) => a;");
524 verifyFormat("return () => [];");
525 verifyFormat("var aaaaaaaaaaaaaaaaaaaa = {\n"
531 verifyFormat("var a = a.aaaaaaa(\n"
534 verifyFormat("var a = a.aaaaaaa(\n"
540 verifyFormat("someFunction(() => {\n"
549 verifyFormat("function() {\n"
555 verifyFormat("for (var i in [2, 3]) {\n"
563 verifyFormat("return aaaaa;", getGoogleJSStyleWithColumns(10));
564 verifyFormat("continue aaaaa;", getGoogleJSStyleWithColumns(10));
565 verifyFormat("break aaaaa;", getGoogleJSStyleWithColumns(10));
566 verifyFormat("throw aaaaa;", getGoogleJSStyleWithColumns(10));
567 verifyFormat("aaaaaaaaa++;", getGoogleJSStyleWithColumns(10));
568 verifyFormat("aaaaaaaaa--;", getGoogleJSStyleWithColumns(10));
572 verifyFormat("var x = /** @type {foo} */ (bar);");
576 verifyFormat("try {\n"
585 verifyFormat("someObject.catch();");
586 verifyFormat("someObject.new();");
587 verifyFormat("someObject.delete();");
591 verifyFormat("var literal = 'hello ' +\n"
597 verifyFormat("var regex = /abc/;");
598 verifyFormat("f(/abc/);");
599 verifyFormat("f(abc, /abc/);");
600 verifyFormat("some_map[/abc/];");
601 verifyFormat("var x = a ? /abc/ : /abc/;");
602 verifyFormat("for (var i = 0; /abc/.test(s[i]); i++) {\n}");
603 verifyFormat("var x = !/abc/.test(y);");
604 verifyFormat("var x = a && /abc/.test(y);");
605 verifyFormat("var x = a || /abc/.test(y);");
606 verifyFormat("var x = a + /abc/.search(y);");
607 verifyFormat("/abc/.search(y);");
608 verifyFormat("var regexs = {/abc/, /abc/};");
609 verifyFormat("return /abc/;");
612 verifyFormat("var a = a / 2 + b / 3;");
613 verifyFormat("var a = a++ / 2;");
615 verifyFormat("var a = ++/a/;");
619 verifyFormat("if (foo) / bar /.exec(baz);");
623 verifyFormat("var regex = /=/;");
624 verifyFormat("var regex = /a*/;");
625 verifyFormat("var regex = /a+/;");
626 verifyFormat("var regex = /a?/;");
627 verifyFormat("var regex = /.a./;");
628 verifyFormat("var regex = /a\\*/;");
629 verifyFormat("var regex = /^a$/;");
630 verifyFormat("var regex = /\\/a/;");
631 verifyFormat("var regex = /(?:x)/;");
632 verifyFormat("var regex = /x(?=y)/;");
633 verifyFormat("var regex = /x(?!y)/;");
634 verifyFormat("var regex = /x|y/;");
635 verifyFormat("var regex = /a{2}/;");
636 verifyFormat("var regex = /a{1,3}/;");
638 verifyFormat("var regex = /[abc]/;");
639 verifyFormat("var regex = /[^abc]/;");
640 verifyFormat("var regex = /[\\b]/;");
641 verifyFormat("var regex = /[/]/;");
642 verifyFormat("var regex = /[\\/]/;");
643 verifyFormat("var regex = /\\[/;");
644 verifyFormat("var regex = /\\\\[/]/;");
645 verifyFormat("var regex = /}[\"]/;");
646 verifyFormat("var regex = /}[/\"]/;");
647 verifyFormat("var regex = /}[\"/]/;");
649 verifyFormat("var regex = /\\b/;");
650 verifyFormat("var regex = /\\B/;");
651 verifyFormat("var regex = /\\d/;");
652 verifyFormat("var regex = /\\D/;");
653 verifyFormat("var regex = /\\f/;");
654 verifyFormat("var regex = /\\n/;");
655 verifyFormat("var regex = /\\r/;");
656 verifyFormat("var regex = /\\s/;");
657 verifyFormat("var regex = /\\S/;");
658 verifyFormat("var regex = /\\t/;");
659 verifyFormat("var regex = /\\v/;");
660 verifyFormat("var regex = /\\w/;");
661 verifyFormat("var regex = /\\W/;");
662 verifyFormat("var regex = /a(a)\\1/;");
663 verifyFormat("var regex = /\\0/;");
664 verifyFormat("var regex = /\\\\/g;");
665 verifyFormat("var regex = /\\a\\\\/g;");
666 verifyFormat("var regex = /\a\\//g;");
667 verifyFormat("var regex = /a\\//;\n"
676 verifyFormat("var regex = /\"/;", getGoogleJSStyleWithColumns(16));
677 verifyFormat("var regex =\n"
680 verifyFormat("var regex = //\n"
682 verifyFormat("var regexs = [\n"
689 verifyFormat("var regex = /abc/g;");
690 verifyFormat("var regex = /abc/i;");
691 verifyFormat("var regex = /abc/m;");
692 verifyFormat("var regex = /abc/y;");
696 verifyFormat("var regex = /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/;",
698 verifyFormat("var regex =\n"
701 verifyFormat("var regex = /\\xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/;",
706 verifyFormat("var regex = search.match(/(?:\?|&)times=([^?&]+)/i);");
710 verifyFormat("var x: string;");
711 verifyFormat("function x(): string {\n return 'x';\n}");
712 verifyFormat("function x(): {x: string} {\n return {x: 'x'};\n}");
713 verifyFormat("function x(y: string): string {\n return 'x';\n}");
714 verifyFormat("for (var y: string in x) {\n x();\n}");
715 verifyFormat("((a: string, b: number): string => a + b);");
716 verifyFormat("var x: (y: number) => string;");
717 verifyFormat("var x: P<string, (a: number) => string>;");
718 verifyFormat("var x = {y: function(): z { return 1; }};");
719 verifyFormat("var x = {y: function(): {a: number} { return 1; }};");
723 verifyFormat("class C {\n x: string = 12;\n}");
724 verifyFormat("class C {\n x(): string => 12;\n}");
725 verifyFormat("class C {\n ['x' + 2]: string = 12;\n}");
726 verifyFormat("class C {\n private x: string = 12;\n}");
727 verifyFormat("class C {\n private static x: string = 12;\n}");
728 verifyFormat("class C {\n static x(): string { return 'asd'; }\n}");
729 verifyFormat("class C extends P implements I {}");
730 verifyFormat("class C extends p.P implements i.I {}");
731 verifyFormat("class Test {\n"
737 verifyFormat("class X {\n"
747 verifyFormat("interface I {\n"
752 verifyFormat("interface a {}\n"
758 verifyFormat("enum Foo {\n"
762 verifyFormat("export /* somecomment*/ enum Foo {\n"
766 verifyFormat("enum Foo {\n"
774 verifyFormat("@A\nclass C {\n}");
775 verifyFormat("@A({arg: 'value'})\nclass C {\n}");
776 verifyFormat("@A\n@B\nclass C {\n}");
777 verifyFormat("class C {\n @A x: string;\n}");
778 verifyFormat("class C {\n"
784 verifyFormat("class X {}\n"
789 verifyFormat("import SomeThing from 'some/module.js';");
790 verifyFormat("import {X, Y} from 'some/module.js';");
791 verifyFormat("import {\n"
797 verifyFormat("import {\n"
801 verifyFormat("import {\n"
806 verifyFormat("import {X as myLocalX, Y as myLocalY} from 'some/module.js';");
807 verifyFormat("import * as lib from 'some/module.js';");
808 verifyFormat("var x = {import: 1};\nx.import = 2;");
810 verifyFormat("export function fn() {\n"
813 verifyFormat("export function A() {}\n"
816 verifyFormat("export const x = 12;");
817 verifyFormat("export default class X {}");
818 verifyFormat("export {X, Y} from 'some/module.js';");
819 verifyFormat("export {\n"
823 verifyFormat("export class C {\n"
827 verifyFormat("export class X { y: number; }");
828 verifyFormat("export default class X { y: number }");
829 verifyFormat("export default function() {\n return 1;\n}");
830 verifyFormat("export var x = 12;");
831 verifyFormat("class C {}\n"
834 verifyFormat("export var x: number = 12;");
835 verifyFormat("export const y = {\n"
839 verifyFormat("export enum Foo {\n"
855 verifyFormat("var x =\n"
858 verifyFormat("var x = `hello ${world}` >= some();",
874 verifyFormat("var x =\n"
880 verifyFormat("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(\n"
885 verifyFormat(
890 verifyFormat("var x = `hello` == `hello`;");
902 verifyFormat("var x = `'`; // comment with matching quote '\n"
904 verifyFormat("var x = `\"`; // comment with matching quote \"\n"
925 verifyFormat("var x = <type>foo;"); }
928 verifyFormat("class X<Y> {}");
929 verifyFormat("new X<Y>();");
930 verifyFormat("foo<Y>(a);");
931 verifyFormat("var x: X<Y>[];");
932 verifyFormat("class C extends D<E> implements F<G>, H<I> {}");
933 verifyFormat("function f(a: List<any> = null) {}");
934 verifyFormat("function f(): List<any> {}");
935 verifyFormat("function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa():\n"
937 verifyFormat("function aaaaaaaaaa(\n"
944 verifyFormat("function x(a?: b, c?, d?) {}");
945 verifyFormat("class X {\n"
949 verifyFormat("interface X {\n"
952 verifyFormat("x ? 1 : 2;");
953 verifyFormat("constructor({aa}: {\n"
962 verifyFormat("var x: {[k: string]: v};");
966 verifyFormat("xxxxxxxxxxx(\n"
969 verifyFormat("xxxxxxxxxxx(\n"
973 verifyFormat("xxxxxxxxxxx(\n"
979 verifyFormat("while (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&\n"