Skip to content

Commit 0cbfc79

Browse files
author
Yui T
committed
Rename test files to be more consistent and move them into jsdoc folder
1 parent bcf84f4 commit 0cbfc79

File tree

8 files changed

+100
-11
lines changed

8 files changed

+100
-11
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// @allowJS: true
2+
// @suppressOutputPathCheck: true
3+
4+
// @filename: 0.js
5+
// @ts-check
6+
/**
7+
* @param {number=} n
8+
* @param {string} [s]
9+
*/
10+
function foo(n, s) {}
11+
12+
foo();
13+
foo(1);
14+
foo(1, "hi");
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// @allowJs: true
2+
// @out: dummy.js
3+
4+
// @filename: returns.js
5+
// @ts-check
6+
/**
7+
* @returns {string} This comment is not currently exposed
8+
*/
9+
function f() {
10+
return "hello";
11+
}
12+
13+
/**
14+
* @returns {string=} This comment is not currently exposed
15+
*/
16+
function f1() {
17+
return "hello world";
18+
}
19+
20+
/**
21+
* @returns {string|number} This comment is not currently exposed
22+
*/
23+
function f2() {
24+
return 5 || "hello";
25+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// @allowJs: true
2+
// @out: dummy.js
3+
4+
// @filename: returns.js
5+
// @ts-check
6+
/**
7+
* @returns {string} This comment is not currently exposed
8+
*/
9+
function f() {
10+
return 5;
11+
}
12+
13+
/**
14+
* @returns {string | number} This comment is not currently exposed
15+
*/
16+
function f1() {
17+
return 5 || true;
18+
}

tests/cases/conformance/salsa/jsDocTypes2.ts renamed to tests/cases/conformance/jsdoc/checkJsdocTypeTag1.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33

44
// @filename: 0.js
55
// @ts-check
6+
/** @type {String} */
7+
var S = "hello world";
8+
9+
/** @type {number} */
10+
var n = 10;
11+
612
/** @type {*} */
713
var anyT = 2;
14+
anyT = "hello";
815

916
/** @type {?} */
1017
var anyT1 = 2;

tests/cases/conformance/salsa/jsDocTypes3.ts renamed to tests/cases/conformance/jsdoc/checkJsdocTypeTag2.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
// @filename: 0.js
55
// @ts-check
6+
/** @type {String} */
7+
var S = true;
8+
9+
/** @type {number} */
10+
var n = "hello";
611

712
/** @type {function (number)} */
813
const x1 = (a) => a + 1;
@@ -13,4 +18,8 @@ const x2 = (a) => a + 1;
1318

1419
/** @type {string} */
1520
var a;
16-
a = x2(0);
21+
a = x2(0);
22+
23+
/** @type {function (number): number} */
24+
const x2 = (a) => a.concat("hi");
25+
x2(0);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// @allowJs: true
2+
// @filename: returns.js
3+
// @out: dummy.js
4+
/**
5+
* @returns {string} This comment is not currently exposed
6+
*/
7+
function f() {
8+
return 5;
9+
}
10+
11+
/**
12+
* @returns {string=} This comment is not currently exposed
13+
*/
14+
function f1() {
15+
return 5;
16+
}
17+
18+
/**
19+
* @returns {string|number} This comment is not currently exposed
20+
*/
21+
function f2() {
22+
return 5 || "hello";
23+
}

tests/cases/conformance/salsa/jsDocTypes.ts renamed to tests/cases/conformance/jsdoc/jsdocTypeTag.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ var nullable;
5757
/** @type {Object} */
5858
var Obj;
5959

60-
60+
/** @type {Function} */
61+
var Func;
6162

6263
// @filename: b.ts
6364
var S: string;
@@ -78,3 +79,4 @@ var P: Promise<any>;
7879
var p: Promise<any>;
7980
var nullable: number | null;
8081
var Obj: any;
82+
var Func: Function;

tests/cases/conformance/jsdoc/returns.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)