Rename test files to be more consistent and move them into jsdoc folder

This commit is contained in:
Yui T 2017-05-26 11:20:57 -07:00
parent bcf84f4958
commit 0cbfc79ca7
8 changed files with 100 additions and 11 deletions

View File

@ -0,0 +1,14 @@
// @allowJS: true
// @suppressOutputPathCheck: true
// @filename: 0.js
// @ts-check
/**
* @param {number=} n
* @param {string} [s]
*/
function foo(n, s) {}
foo();
foo(1);
foo(1, "hi");

View File

@ -0,0 +1,25 @@
// @allowJs: true
// @out: dummy.js
// @filename: returns.js
// @ts-check
/**
* @returns {string} This comment is not currently exposed
*/
function f() {
return "hello";
}
/**
* @returns {string=} This comment is not currently exposed
*/
function f1() {
return "hello world";
}
/**
* @returns {string|number} This comment is not currently exposed
*/
function f2() {
return 5 || "hello";
}

View File

@ -0,0 +1,18 @@
// @allowJs: true
// @out: dummy.js
// @filename: returns.js
// @ts-check
/**
* @returns {string} This comment is not currently exposed
*/
function f() {
return 5;
}
/**
* @returns {string | number} This comment is not currently exposed
*/
function f1() {
return 5 || true;
}

View File

@ -3,8 +3,15 @@
// @filename: 0.js
// @ts-check
/** @type {String} */
var S = "hello world";
/** @type {number} */
var n = 10;
/** @type {*} */
var anyT = 2;
anyT = "hello";
/** @type {?} */
var anyT1 = 2;

View File

@ -3,6 +3,11 @@
// @filename: 0.js
// @ts-check
/** @type {String} */
var S = true;
/** @type {number} */
var n = "hello";
/** @type {function (number)} */
const x1 = (a) => a + 1;
@ -13,4 +18,8 @@ const x2 = (a) => a + 1;
/** @type {string} */
var a;
a = x2(0);
a = x2(0);
/** @type {function (number): number} */
const x2 = (a) => a.concat("hi");
x2(0);

View File

@ -0,0 +1,23 @@
// @allowJs: true
// @filename: returns.js
// @out: dummy.js
/**
* @returns {string} This comment is not currently exposed
*/
function f() {
return 5;
}
/**
* @returns {string=} This comment is not currently exposed
*/
function f1() {
return 5;
}
/**
* @returns {string|number} This comment is not currently exposed
*/
function f2() {
return 5 || "hello";
}

View File

@ -57,7 +57,8 @@ var nullable;
/** @type {Object} */
var Obj;
/** @type {Function} */
var Func;
// @filename: b.ts
var S: string;
@ -78,3 +79,4 @@ var P: Promise<any>;
var p: Promise<any>;
var nullable: number | null;
var Obj: any;
var Func: Function;

View File

@ -1,9 +0,0 @@
// @allowJs: true
// @filename: returns.js
// @out: dummy.js
/**
* @returns {string} This comment is not currently exposed
*/
function f() {
return "";
}