* Allowed comment directives to be multiline * Added tests, and perhaps fixed a test runner bug? * I think it's going to need a consistent variable to loop over * Used dynamically computed indexes in verifies * Added multiline tests * Increased flexibility for multiline comment parsing * Undid a couple of formatting changes; removed backslashes from multiline regexp * Added baseline tests for multiline comment skipping Co-authored-by: Orta Therox <orta.therox@gmail.com>
90 lines
2.4 KiB
Plaintext
90 lines
2.4 KiB
Plaintext
=== tests/cases/conformance/directives/a.ts ===
|
|
export const texts: string[] = [];
|
|
>texts : Symbol(texts, Decl(a.ts, 0, 12))
|
|
|
|
/**
|
|
@ts-ignore */
|
|
texts.push(100);
|
|
>texts.push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
>texts : Symbol(texts, Decl(a.ts, 0, 12))
|
|
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
|
|
/**
|
|
@ts-expect-error */
|
|
texts.push(100);
|
|
>texts.push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
>texts : Symbol(texts, Decl(a.ts, 0, 12))
|
|
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
|
|
/**
|
|
@ts-expect-error */
|
|
texts.push("100");
|
|
>texts.push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
>texts : Symbol(texts, Decl(a.ts, 0, 12))
|
|
>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
|
|
|
|
=== tests/cases/conformance/directives/b.tsx ===
|
|
import * as React from "react";
|
|
>React : Symbol(React, Decl(b.tsx, 0, 6))
|
|
|
|
export function MyComponent(props: { foo: string }) {
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>props : Symbol(props, Decl(b.tsx, 2, 28))
|
|
>foo : Symbol(foo, Decl(b.tsx, 2, 36))
|
|
|
|
return <div />;
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
|
}
|
|
|
|
let x = (
|
|
>x : Symbol(x, Decl(b.tsx, 6, 3))
|
|
|
|
<div>
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
|
|
|
{/*
|
|
@ts-ignore */}
|
|
<MyComponent foo={100} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 10, 16))
|
|
|
|
{/*@ts-ignore*/}
|
|
<MyComponent foo={100} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 13, 16))
|
|
|
|
{/*
|
|
@ts-expect-error */}
|
|
<MyComponent foo={100} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 17, 16))
|
|
|
|
{/*
|
|
// @ts-expect-error */}
|
|
<MyComponent foo={100} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 21, 16))
|
|
|
|
{/*
|
|
* @ts-expect-error */}
|
|
<MyComponent foo={100} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 25, 16))
|
|
|
|
{/*@ts-expect-error*/}
|
|
<MyComponent foo={100} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 28, 16))
|
|
|
|
{/*
|
|
@ts-expect-error */}
|
|
<MyComponent foo={"hooray"} />
|
|
>MyComponent : Symbol(MyComponent, Decl(b.tsx, 0, 31))
|
|
>foo : Symbol(foo, Decl(b.tsx, 32, 16))
|
|
|
|
</div>
|
|
>div : Symbol(JSX.IntrinsicElements.div, Decl(react.d.ts, 2400, 45))
|
|
|
|
);
|
|
|