CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
num.js39 linesDownload Raw Back to test
1'use strict';2 3var parse = require('../');4var test = require('tape');5 6test('nums', function (t) {7	var argv = parse([8		'-x', '1234',9		'-y', '5.67',10		'-z', '1e7',11		'-w', '10f',12		'--hex', '0xdeadbeef',13		'789',14	]);15	t.deepEqual(argv, {16		x: 1234,17		y: 5.67,18		z: 1e7,19		w: '10f',20		hex: 0xdeadbeef,21		_: [789],22	});23	t.deepEqual(typeof argv.x, 'number');24	t.deepEqual(typeof argv.y, 'number');25	t.deepEqual(typeof argv.z, 'number');26	t.deepEqual(typeof argv.w, 'string');27	t.deepEqual(typeof argv.hex, 'number');28	t.deepEqual(typeof argv._[0], 'number');29	t.end();30});31 32test('already a number', function (t) {33	var argv = parse(['-x', 1234, 789]);34	t.deepEqual(argv, { x: 1234, _: [789] });35	t.deepEqual(typeof argv.x, 'number');36	t.deepEqual(typeof argv._[0], 'number');37	t.end();38});39 
basant307/AI_Governance_Project · CoolFace