21#define BOOST_TEST_NO_MAIN
22#include <boost/test/unit_test.hpp>
30 std::string
name =
"valid_filename-123._ok";
31 std::string original =
name;
43 std::string
name = R
"(bad\name/with?illegal*chars|"<>.txt)";
66 std::string
name = R
"(a*bad?name|file)";
76 wxString
name =
"valid_filename-123._ok";
77 wxString original =
name;
88 wxString
name =
"bad\\name/with?illegal*chars|\"<>.txt";
111 wxString
name =
"a*bad?name|file";
143 == wxString(
"/nonexistent/file.pdf" ) );
155static wxString
JoinPins(
const std::vector<wxString>& aPins )
159 for(
const wxString& p : aPins )
160 out <<
'<' << p <<
'>';
175 BOOST_REQUIRE_EQUAL( expanded.size(), 1u );
176 BOOST_TEST( expanded[0] == wxString(
"1,foo,bar,buz" ) );
187 const wxString raw = wxS(
"1,foo" );
190 BOOST_TEST( escaped == wxString(
"1\\,foo" ) );
192 const wxString notation = wxS(
"[" ) + escaped + wxS(
",2]" );
199 BOOST_REQUIRE_EQUAL( expanded.size(), 2u );
211 const wxString notation = wxS(
"[A\\-B,C]" );
218 BOOST_REQUIRE_EQUAL( expanded.size(), 2u );
219 BOOST_TEST( expanded[0] == wxString(
"A-B" ) );
225 BOOST_REQUIRE_EQUAL( expanded.size(), 3u );
250 BOOST_REQUIRE_EQUAL( expanded.size(), 5u );
254 BOOST_TEST( expanded[3] == wxString(
"10" ) );
255 BOOST_TEST( expanded[4] == wxString(
"11" ) );
268 BOOST_REQUIRE_EQUAL( items.size(), 3u );
284 BOOST_REQUIRE_EQUAL( expanded.size(), 2u );
285 BOOST_TEST( expanded[0] == wxString(
"A\\B" ) );
305 BOOST_REQUIRE_EQUAL( expanded.size(), 1u );
std::vector< wxString > ExpandStackedPinNotation(const wxString &aPinName, bool *aValid)
Expand stacked pin notation like [1,2,3], [1-4], [A1-A4], or [AA1-AA3,AB4,CD12-CD14] into individual ...
wxString ConvertPathToFileUri(const wxString &aPath, const PROJECT *aProject)
Convert a file path to a file:// URI.
std::vector< wxString > SplitStackedPinDisplayItems(const wxString &aInner)
Split the inner part of a stacked notation string (the text between the brackets) into its individual...
bool ReplaceIllegalFileNameChars(std::string &aName, int aReplaceChar)
Checks aName for illegal file name characters.
wxString EscapeStackedPinItem(const wxString &aPinNumber)
Escape the characters that carry structural meaning inside stacked pin notation ('[',...
int CountStackedPinNotation(const wxString &aPinName, bool *aValid)
Count the number of pins represented by stacked pin notation.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST(netlist.find("R_G1 ARM_OUT1 DIE_B R='0.001 / ((SW_STATE)") !=std::string::npos)
BOOST_TEST_INFO("Two-port Series .op current = "<< iDevice)
BOOST_AUTO_TEST_CASE(ReplaceIllegalFileNameChars_StdString_NoChange)
static wxString JoinPins(const std::vector< wxString > &aPins)