diff --git a/test/rules/control-flow-typed/assertion.ts.lint b/test/rules/control-flow-typed/assertion.ts.lint index b8d69ae..b7a4d1b 100644 --- a/test/rules/control-flow-typed/assertion.ts.lint +++ b/test/rules/control-flow-typed/assertion.ts.lint @@ -1,5 +1,6 @@ export {} declare function returnNever(): never; +declare function assert(v: any): asserts v; function test() { ~ [0] @@ -7,4 +8,16 @@ function test() { ~~~~~~~~~~~ [0] } +function test2(v: boolean) { + assert(v); +} + +function test3() { + try { + ~ [0] + returnNever(); + ~~~~~~~~~~~ [0] + } catch {} +} + [0]: control flow end diff --git a/test/rules/exhaustive-switch/test.ts.lint b/test/rules/exhaustive-switch/test.ts.lint index 4d28e62..e53e8e8 100644 --- a/test/rules/exhaustive-switch/test.ts.lint +++ b/test/rules/exhaustive-switch/test.ts.lint @@ -278,3 +278,39 @@ declare function get(): T; } debugger; }; + +() => { + switch (get()) { + ~~~~~~ [not exhaustive] + case get(): + return; + } + debugger; +}; + +() => { + switch (get()) { + ~~~~~~ [not exhaustive] + case get(): + return; + } + debugger; +}; + +() => { + switch (get()) { + ~~~~~~ [not exhaustive] + case get<1>(): + return; + } + debugger; +}; + +() => { + switch (get<1>()) { + ~~~~~~ [not exhaustive] + case get(): + return; + } + debugger; +};