tangweijie 5099f2e87e Initial commit: Vue3 + TypeScript 前端项目
- Vue 3 + TypeScript + Element Plus 前端界面
- Pinia 状态管理
- Vue Router 4 路由管理
- Axios HTTP 客户端
- MSW (Mock Service Worker) 开发环境模拟
- 账户管理界面 (列表、详情、三科目余额展示)
- 交易管理界面 (列表、详情)
- 对账管理界面 (三账校验)
- 完善的 API 客户端封装
- Docker 容器化配置
- Nginx 配置用于生产环境
2026-01-05 17:57:11 +08:00

97 lines
2.6 KiB
JavaScript

'use strict';
var tape = require('tape');
var path = require('../');
var slashRE = /\//g;
var pairs = [
[__filename, '.js'],
['', ''],
['/path/to/file', ''],
['/path/to/file.ext', '.ext'],
['/path.to/file.ext', '.ext'],
['/path.to/file', ''],
['/path.to/.file', ''],
['/path.to/.file.ext', '.ext'],
['/path/to/f.ext', '.ext'],
['/path/to/..ext', '.ext'],
['/path/to/..', ''],
['file', ''],
['file.ext', '.ext'],
['.file', ''],
['.file.ext', '.ext'],
['/file', ''],
['/file.ext', '.ext'],
['/.file', ''],
['/.file.ext', '.ext'],
['.path/file.ext', '.ext'],
['file.ext.ext', '.ext'],
['file.', '.'],
['.', ''],
['./', ''],
['.file.ext', '.ext'],
['.file', ''],
['.file.', '.'],
['.file..', '.'],
['..', ''],
['../', ''],
['..file.ext', '.ext'],
['..file', '.file'],
['..file.', '.'],
['..file..', '.'],
['...', '.'],
['...ext', '.ext'],
['....', '.'],
['file.ext/', '.ext'],
['file.ext//', '.ext'],
['file/', ''],
['file//', ''],
['file./', '.'],
['file.//', '.'] ];
tape('path.posix.extname', function (t) {
pairs.forEach(function (p) {
var input = p[0];
var expected = p[1];
t.strictEqual(expected, path.posix.extname(input));
});
t.end();
});
tape('path.win32.extname', { skip: true }, function (t) {
pairs.forEach(function (p) {
var input = p[0].replace(slashRE, '\\');
var expected = p[1];
t.strictEqual(expected, path.win32.extname(input));
t.strictEqual(expected, path.win32.extname("C:" + input));
});
t.end();
});
tape('path.win32.extname backslash', { skip: true }, function (t) {
// On Windows, backslash is a path separator.
t.strictEqual(path.win32.extname('.\\'), '');
t.strictEqual(path.win32.extname('..\\'), '');
t.strictEqual(path.win32.extname('file.ext\\'), '.ext');
t.strictEqual(path.win32.extname('file.ext\\\\'), '.ext');
t.strictEqual(path.win32.extname('file\\'), '');
t.strictEqual(path.win32.extname('file\\\\'), '');
t.strictEqual(path.win32.extname('file.\\'), '.');
t.strictEqual(path.win32.extname('file.\\\\'), '.');
t.end();
});
tape('path.posix.extname backslash', function (t) {
// On *nix, backslash is a valid name component like any other character.
t.strictEqual(path.posix.extname('.\\'), '');
t.strictEqual(path.posix.extname('..\\'), '.\\');
t.strictEqual(path.posix.extname('file.ext\\'), '.ext\\');
t.strictEqual(path.posix.extname('file.ext\\\\'), '.ext\\\\');
t.strictEqual(path.posix.extname('file\\'), '');
t.strictEqual(path.posix.extname('file\\\\'), '');
t.strictEqual(path.posix.extname('file.\\'), '.\\');
t.strictEqual(path.posix.extname('file.\\\\'), '.\\\\');
t.end();
});