Added tests for more features

This commit is contained in:
Matthias Koefferlein 2025-08-02 22:23:03 +02:00
parent a224c11833
commit 61aa08cd64
4 changed files with 14 additions and 2 deletions

View File

@ -385,8 +385,8 @@ public:
virtual void execute (const tl::ExpressionParserContext &context, tl::Variant &out, const std::vector<tl::Variant> &args, const std::map<std::string, tl::Variant> * /*kwargs*/) const
{
if (args.size () != 1) {
throw tl::EvalError (tl::to_string (tr ("'net' function does not take and argument")), context);
if (args.size () != 0) {
throw tl::EvalError (tl::to_string (tr ("'net' function does not take any argument")), context);
}
out = mp_eval->net_func ();
}

View File

@ -3451,6 +3451,18 @@ TEST(15_MeasureNet)
unsigned int l100 = ly.get_layer (db::LayerProperties (100, 0));
l1_measured.insert_into (&ly, tc.cell_index (), l100);
std::map<std::string, tl::Variant> vars;
vars["athr"] = 40.0;
db::Region l2_skipped = l2n.measure_net (*rl1, secondary, "skip(area < athr)", vars);
unsigned int l101 = ly.get_layer (db::LayerProperties (101, 0));
l2_skipped.insert_into (&ly, tc.cell_index (), l101);
db::Region l3_net_func = l2n.measure_net (*rl1, secondary, "put('NAME', net.name)", std::map<std::string, tl::Variant> ());
unsigned int l102 = ly.get_layer (db::LayerProperties (102, 0));
l3_net_func.insert_into (&ly, tc.cell_index (), l102);
// compare the collected test data
std::string au = tl::testdata ();

Binary file not shown.

Binary file not shown.