Skip to content

Commit

Permalink
Update test file and baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-williams committed Jan 25, 2019
1 parent 267e598 commit 1f2338b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 37 deletions.
16 changes: 8 additions & 8 deletions tests/baselines/reference/unknownType2.js
Expand Up @@ -13,7 +13,7 @@ if (u === 5) {
const y = u.toString(10);
}

if (u === true || u === false) {
if (u === true || u === false) {
const someBool: boolean = u;
}

Expand All @@ -25,28 +25,29 @@ if (u === null) {
const someNull: null = u;
}

if(u === symb) {
if (u === symb) {
const symbolAlias: typeof symb = u;
}

if (!(u === 42)) {
u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>

}

if (u !== 42) {
type A = isTrue<isUnknown<typeof u>>
type B = isTrue<isUnknown<typeof u>>
}

if (u == 42) {
type B = isTrue<isUnknown<typeof u>>
type C = isTrue<isUnknown<typeof u>>
}

if (u == true) {
type C = isTrue<isUnknown<typeof u>>
type D = isTrue<isUnknown<typeof u>>
}

if (u == Object) {
type D = isTrue<isUnknown<typeof u>>
type E = isTrue<isUnknown<typeof u>>
}


Expand All @@ -70,7 +71,6 @@ if (u === symb) {
var symbolAlias = u;
}
if (!(u === 42)) {
u; // u should still be `unknown` here
}
if (u !== 42) {
}
Expand Down
26 changes: 15 additions & 11 deletions tests/baselines/reference/unknownType2.symbols
Expand Up @@ -38,7 +38,7 @@ if (u === 5) {
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
}

if (u === true || u === false) {
if (u === true || u === false) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

Expand All @@ -64,7 +64,7 @@ if (u === null) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
}

if(u === symb) {
if (u === symb) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
>symb : Symbol(symb, Decl(unknownType2.ts, 8, 13))

Expand All @@ -77,15 +77,19 @@ if(u === symb) {
if (!(u === 42)) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>
>A : Symbol(A, Decl(unknownType2.ts, 30, 18))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

}

if (u !== 42) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

type A = isTrue<isUnknown<typeof u>>
>A : Symbol(A, Decl(unknownType2.ts, 34, 15))
type B = isTrue<isUnknown<typeof u>>
>B : Symbol(B, Decl(unknownType2.ts, 35, 15))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
Expand All @@ -94,8 +98,8 @@ if (u !== 42) {
if (u == 42) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

type B = isTrue<isUnknown<typeof u>>
>B : Symbol(B, Decl(unknownType2.ts, 38, 14))
type C = isTrue<isUnknown<typeof u>>
>C : Symbol(C, Decl(unknownType2.ts, 39, 14))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
Expand All @@ -104,8 +108,8 @@ if (u == 42) {
if (u == true) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))

type C = isTrue<isUnknown<typeof u>>
>C : Symbol(C, Decl(unknownType2.ts, 42, 16))
type D = isTrue<isUnknown<typeof u>>
>D : Symbol(D, Decl(unknownType2.ts, 43, 16))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
Expand All @@ -115,8 +119,8 @@ if (u == Object) {
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

type D = isTrue<isUnknown<typeof u>>
>D : Symbol(D, Decl(unknownType2.ts, 46, 18))
type E = isTrue<isUnknown<typeof u>>
>E : Symbol(E, Decl(unknownType2.ts, 47, 18))
>isTrue : Symbol(isTrue, Decl(unknownType2.ts, 0, 53))
>isUnknown : Symbol(isUnknown, Decl(unknownType2.ts, 0, 0))
>u : Symbol(u, Decl(unknownType2.ts, 6, 5))
Expand Down
24 changes: 13 additions & 11 deletions tests/baselines/reference/unknownType2.types
Expand Up @@ -49,7 +49,7 @@ if (u === 5) {
>10 : 10
}

if (u === true || u === false) {
if (u === true || u === false) {
>u === true || u === false : boolean
>u === true : boolean
>u : unknown
Expand Down Expand Up @@ -84,7 +84,7 @@ if (u === null) {
>u : null
}

if(u === symb) {
if (u === symb) {
>u === symb : boolean
>u : unknown
>symb : unique symbol
Expand All @@ -102,17 +102,19 @@ if (!(u === 42)) {
>u : unknown
>42 : 42

u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>
>A : true
>u : unknown

}

if (u !== 42) {
>u !== 42 : boolean
>u : unknown
>42 : 42

type A = isTrue<isUnknown<typeof u>>
>A : true
type B = isTrue<isUnknown<typeof u>>
>B : true
>u : unknown
}

Expand All @@ -121,8 +123,8 @@ if (u == 42) {
>u : unknown
>42 : 42

type B = isTrue<isUnknown<typeof u>>
>B : true
type C = isTrue<isUnknown<typeof u>>
>C : true
>u : unknown
}

Expand All @@ -131,8 +133,8 @@ if (u == true) {
>u : unknown
>true : true

type C = isTrue<isUnknown<typeof u>>
>C : true
type D = isTrue<isUnknown<typeof u>>
>D : true
>u : unknown
}

Expand All @@ -141,8 +143,8 @@ if (u == Object) {
>u : unknown
>Object : ObjectConstructor

type D = isTrue<isUnknown<typeof u>>
>D : true
type E = isTrue<isUnknown<typeof u>>
>E : true
>u : unknown
}

15 changes: 8 additions & 7 deletions tests/cases/conformance/types/unknown/unknownType2.ts
Expand Up @@ -14,7 +14,7 @@ if (u === 5) {
const y = u.toString(10);
}

if (u === true || u === false) {
if (u === true || u === false) {
const someBool: boolean = u;
}

Expand All @@ -26,26 +26,27 @@ if (u === null) {
const someNull: null = u;
}

if(u === symb) {
if (u === symb) {
const symbolAlias: typeof symb = u;
}

if (!(u === 42)) {
u // u should still be `unknown` here
type A = isTrue<isUnknown<typeof u>>

}

if (u !== 42) {
type A = isTrue<isUnknown<typeof u>>
type B = isTrue<isUnknown<typeof u>>
}

if (u == 42) {
type B = isTrue<isUnknown<typeof u>>
type C = isTrue<isUnknown<typeof u>>
}

if (u == true) {
type C = isTrue<isUnknown<typeof u>>
type D = isTrue<isUnknown<typeof u>>
}

if (u == Object) {
type D = isTrue<isUnknown<typeof u>>
type E = isTrue<isUnknown<typeof u>>
}

0 comments on commit 1f2338b

Please sign in to comment.