keinos / tmc-tests Goto Github PK
View Code? Open in Web Editor NEW✅ TMC-Data format regulation check commands.
License: GNU General Public License v3.0
✅ TMC-Data format regulation check commands.
License: GNU General Public License v3.0
2月30日などの存在しない無効な日付でもパスします。
$ ./REG-002 TMC-20190230.json
$ echo $?
0
有効な放送日は検知できなくても、少なくとも実在する日付であるかのチェックは必要かと思われます。
function validateDate($date, $format = 'Ymd')
{
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
引数なしの確認コマンド呼び出しの場合は、ヘルプを表示しないといけないのですが、REG-001, REG-002, REG-003 には実装されていません。
エラーのみで、必要な引数(入力)情報がわかりません。
$ ./REG-001 || echo $?
Argument missing.
1
$ ./REG-002 || echo $?
Argument missing.
2
$ ./REG-003 || echo $?
Argument missing.
3
確認スクリプトのプロトコルの「入力」要件によると、複数の検証データの同時受付は禁止されていますが、REG-002 および REG-003 は複数受付も処理しています。
確認コマンドによってデータの渡し方が異なることになるので、他の確認コマンドの実装前に統一した方がいいと思われます。
Lines 37 to 46 in 11c8b02
Lines 27 to 33 in 11c8b02
サンプル(テンプレート)の REG-000 が標準入力で検証データを受け付けません。
$ ./REG-000 'Hello World!'
$ echo $?
0
$ echo 'Hello World!' | ./REG-000 -
NG (Bad argument. Must be \'Hello World!\'. Given: \'-\')
$ echo $?
1
テストも検証していません。(引数渡しのみテストしています)
TMC-TESTS/tests/REG-000_Test.php
Lines 6 to 23 in 6ae3b62
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.