Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/fonts/iran-yekan/beflpn/test.zip
Назад
PK ��i[zs�- - tst.basic.jsnu �Iw�� /* * tst.basic.js: tests various valid invocation */ var mod_assert = require('assert'); var mod_extsprintf = require('../lib/extsprintf'); var mod_path = require('path'); var sprintf = mod_extsprintf.sprintf; var testcases = [ { 'name': 'empty string', 'args': [ '' ], 'result': '' }, { 'name': '%s: basic', 'args': [ '%s', 'foo' ], 'result': 'foo' }, { 'name': '%s: not first', 'args': [ 'hello %s\n', 'world' ], 'result': 'hello world\n' }, { 'name': '%s: right-aligned', 'args': [ 'hello %10s\n', 'world' ], 'result': 'hello world\n' }, { 'name': '%s: left-aligned', 'args': [ 'hello %-10sagain\n', 'world' ], 'result': 'hello world again\n' }, { 'name': '%d: basic, positive', 'args': [ '%d', 17 ], 'result': '17' }, { 'name': '%d: basic, zero', 'args': [ '%d', 0 ], 'result': '0' }, { 'name': '%d: basic, floating point value', 'args': [ '%d', 17.3 ], 'result': '17' }, { 'name': '%d: basic, negative', 'args': [ '%d', -3 ], 'result': '-3' }, { 'name': '%d: right-aligned', 'args': [ '%4d', 17 ], 'result': ' 17' }, { 'name': '%d: right-aligned, zero-padded', 'args': [ '%04d', 17 ], 'result': '0017' }, { 'name': '%d: left-aligned', 'args': [ '%-4d', 17 ], 'result': '17 ' }, { 'name': '%x: basic', 'args': [ '%x', 18], 'result': '12' }, { 'name': '%x: zero-padded, right-aligned', 'args': [ '%08x', 0xfeedface ], 'result': 'feedface' }, { 'name': '%d: with plus sign', 'args': [ '%+d', 17 ], 'result': '+17' }, { 'name': '%f: basic', 'args': [ '%f', 3.2 ], 'result': '3.2' }, { 'name': '%f: right-aligned', 'args': [ '%5f', 3.2 ], 'result': ' 3.2' }, { 'name': '%%: basic', 'args': [ '%%' ], 'result': '%' }, { 'name': 'complex', 'args': [ 'one %s %8s %-3d bytes past 0x%04x, which was %6f%%%s%5s', 'program', 'wrote', -2, 0x30, 3.7, ' plus', 'over' ], 'result': 'one program wrote -2 bytes past 0x0030, which was ' + '3.7% plus over' } ]; function main(verbose) { /* * Create one test case with a very large input string. */ var input = '1234'; while (input.length < 100 * 1024) { input += input; } testcases.push({ 'name': 'long string argument (' + input.length + ' characters)', 'args': [ '%s', input ], 'result': input }); testcases.forEach(function (tc) { var result; console.error('test case: %s', tc.name); result = sprintf.apply(null, tc.args); if (verbose) { console.error(' args: %s', JSON.stringify(tc.args)); console.error(' result: %s', result); } mod_assert.equal(tc.result, result); }); console.log('%s tests passed', mod_path.basename(__filename)); } main(process.argv.length > 2 && process.argv[2] == '-v'); PK ��i[3�� � tst.invalid.jsnu �Iw�� /* * tst.invalid.js: tests invalid invocations */ var mod_assert = require('assert'); var mod_extsprintf = require('../lib/extsprintf'); var mod_path = require('path'); var sprintf = mod_extsprintf.sprintf; var testcases = [ { 'name': 'missing all arguments', 'args': [], 'errmsg': /first argument must be a format string$/ }, { 'name': 'missing argument for format specifier (first char and specifier)', 'args': [ '%s' ], 'errmsg': new RegExp( 'format string "%s": conversion specifier "%s" at character 1 ' + 'has no matching argument \\(too few arguments passed\\)') }, { 'name': 'missing argument for format specifier (later in string)', 'args': [ 'hello %s world %13d', 'big' ], 'errmsg': new RegExp( 'format string "hello %s world %13d": conversion specifier "%13d" at ' + 'character 16 has no matching argument \\(too few arguments passed\\)') }, { 'name': 'printing null as string', 'args': [ '%d cookies %3s', 15, null ], 'errmsg': new RegExp( 'format string "%d cookies %3s": conversion specifier "%3s" at ' + 'character 12 attempted to print undefined or null as a string ' + '\\(argument 3 to sprintf\\)') }, { 'name': 'printing undefined as string', 'args': [ '%d cookies %3s ah %d', 15, undefined, 7 ], 'errmsg': new RegExp( 'format string "%d cookies %3s ah %d": conversion specifier "%3s" at ' + 'character 12 attempted to print undefined or null as a string ' + '\\(argument 3 to sprintf\\)') }, { 'name': 'unsupported format character', 'args': [ 'do not use %X', 13 ], 'errmsg': new RegExp( 'format string "do not use %X": conversion ' + 'specifier "%X" at character 12 is not supported$') }, { 'name': 'unsupported flags', 'args': [ '%#x', 13 ], 'errmsg': new RegExp( 'format string "%#x": conversion ' + 'specifier "%#x" at character 1 uses unsupported flags$') } ]; function main(verbose) { testcases.forEach(function (tc) { var error; console.error('test case: %s', tc.name); if (verbose) { console.error(' args: %s', JSON.stringify(tc.args)); } mod_assert.throws(function () { try { sprintf.apply(null, tc.args); } catch (ex) { error = ex; throw (ex); } }, tc.errmsg); if (verbose && error) { console.error(' error: %s', error.message); } }); console.log('%s tests passed', mod_path.basename(__filename)); } main(process.argv.length > 2 && process.argv[2] == '-v'); PK ��j[aP�� � index.jsnu �Iw�� 'use strict'; var test = require('tape'); var getSideChannel = require('../'); test('export', function (t) { t.equal(typeof getSideChannel, 'function', 'is a function'); t.equal(getSideChannel.length, 0, 'takes no arguments'); var channel = getSideChannel(); t.ok(channel, 'is truthy'); t.equal(typeof channel, 'object', 'is an object'); t.end(); }); test('assert', function (t) { var channel = getSideChannel(); t['throws']( function () { channel.assert({}); }, TypeError, 'nonexistent value throws' ); var o = {}; channel.set(o, 'data'); t.doesNotThrow(function () { channel.assert(o); }, 'existent value noops'); t.end(); }); test('has', function (t) { var channel = getSideChannel(); var o = []; t.equal(channel.has(o), false, 'nonexistent value yields false'); channel.set(o, 'foo'); t.equal(channel.has(o), true, 'existent value yields true'); t.end(); }); test('get', function (t) { var channel = getSideChannel(); var o = {}; t.equal(channel.get(o), undefined, 'nonexistent value yields undefined'); var data = {}; channel.set(o, data); t.equal(channel.get(o), data, '"get" yields data set by "set"'); t.end(); }); test('set', function (t) { var channel = getSideChannel(); var o = function () {}; t.equal(channel.get(o), undefined, 'value not set'); channel.set(o, 42); t.equal(channel.get(o), 42, 'value was set'); channel.set(o, Infinity); t.equal(channel.get(o), Infinity, 'value was set again'); var o2 = {}; channel.set(o2, 17); t.equal(channel.get(o), Infinity, 'o is not modified'); t.equal(channel.get(o2), 17, 'o2 is set'); channel.set(o, 14); t.equal(channel.get(o), 14, 'o is modified'); t.equal(channel.get(o2), 17, 'o2 is not modified'); t.end(); }); PK ��i[zs�- - tst.basic.jsnu �Iw�� PK ��i[3�� � i tst.invalid.jsnu �Iw�� PK ��j[aP�� � d index.jsnu �Iw�� PK � i
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка