Test::MasterData::Declare - It's testing tool for CSV (and other structures) by DSL.
use Test::MasterData::Declare;
master_data {
load_csv item => "master-data/item.csv";
subtest "item.type must be like a number and between 1 to 3" => sub {
table item => "type",
like_number => 1 => 3;
};
subtest "item.effect is json structure. effect.energy must be between 1 to 100" => sub {
table item => "effect",
if_column type => 1,
json energy =>
like_number 1 => 100;
}
};
Test::MasterData::Declare
is a testing tool for row like structures.
THE SOFTWARE IS IT'S IN ALPHA QUALITY. IT MAY CHANGE THE API WITHOUT NOTICE.
There functions are working only in this scope.
Load csv from $csv_path
. Loaded rows were referenced from table
.
Check column value. $filters_or_expects
is a filter functions (ex. if_column
), expections (ex. $like_number
), scalar value, regexp reference, Test2::Compare::*
, etc...
Filter checking rows. $column_condition
is a scalar or Test2::Compare::*.
Check value that like a number and between $begin
to $end
or equals $expects
.
Inflate column to structure data by json.
Declare relation the $drom_table
to $to_table
.
Copyright (C) mackee.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
mackee a.k.a macopy macopy123@gmail.com