/** * Copyright - See the COPYRIGHT that is included with this distribution. * pvxs is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ #include #include #include #include #include #include #include #include "utilpvt.h" namespace { using namespace pvxs; struct TestBuilder : client::detail::CommonBuilder { TestBuilder() :client::detail::CommonBuilder(nullptr, "") {} Value makeReq() const { return _build(); } }; void testEmpty() { testShow()<<__func__; auto req = TestBuilder().makeReq(); testShow()< valid({ "field()", "field(a,b,a.b)field(x)", "a", // short-hand "field(a,b,a.b)field(x)", // should these be valid? "field(,)", "field(foo,)", "record[foo=bar,]", }); for(auto& pvr : valid) { try { testCase(true)< errors({ "field(", "field(value", "field(value,alarm", "field[]", "record()", "field(!@#)", "record[", "record[key", "record[key=", "record[key=]", "record[,]", }); for(auto& pvr : errors) { testThrows([&pvr](){ auto req = TestBuilder() .pvRequest(pvr) .makeReq(); testShow()<