Skip to content

Commit 32c5af4

Browse files
committed
Minor improvments of tests for microsoft#6579
1 parent 70ccfdf commit 32c5af4

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

Diff for: tests/cases/compiler/regexValidatedTypeAssignment.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ email = '[email protected]';
77
88
99
10+
1011
gmail = email;
1112
email = gmail;
12-
1313
gmail = <Gmail>email;
1414
if (Gmail.test(email)) {
1515
gmail = email;
@@ -18,17 +18,23 @@ if (Gmail.test(email)) {
1818
let someEmail = '[email protected]';
1919
let someGmail = '[email protected]';
2020
email = someEmail;
21+
email = someGmail;
22+
gmail = someEmail;
2123
gmail = someGmail;
2224
email = <Email>someEmail;
2325
gmail = <Gmail>someGmail;
2426
if (Email.test(someEmail)) {
2527
email = someEmail;
28+
gmail = someEmail;
2629
}
2730
if (Gmail.test(someGmail)) {
31+
email = someGmail;
2832
gmail = someGmail;
2933
}
3034

3135
let someEmailLiteral: '[email protected]' = '[email protected]';
3236
let someGmailLiteral: '[email protected]' = '[email protected]';
3337
email = someEmailLiteral;
38+
email = someGmailLiteral;
39+
gmail = someEmailLiteral;
3440
gmail = someGmailLiteral;

Diff for: tests/cases/compiler/regexValidatedTypeIndex.ts

+16-2
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,19 @@ collection[<Email>someEmail].usersProperty;
3131
collection[<Email>someEmail].gmailProperty;
3232
collection[<Gmail>someGmail].usersProperty;
3333
collection[<Gmail>someGmail].gmailProperty;
34-
collection[<Email & Gmail> someGmail].usersProperty;
35-
collection[<Email & Gmail> someGmail].gmailProperty;
34+
35+
if (Email.test(someEmail)) {
36+
collection[someEmail].usersProperty;
37+
collection[someEmail].gmailProperty;
38+
}
39+
if (Gmail.test(someGmail)) {
40+
collection[someGmail].usersProperty;
41+
collection[someGmail].gmailProperty;
42+
}
43+
44+
let someEmailLiteral: 'test@example.com' = '[email protected]';
45+
let someGmailLiteral: 'test@gmail.com' = '[email protected]';
46+
collection[someEmailLiteral].usersProperty;
47+
collection[someEmailLiteral].gmailProperty;
48+
collection[someGmailLiteral].usersProperty;
49+
collection[someGmailLiteral].gmailProperty;

0 commit comments

Comments
 (0)