mirror of https://github.com/KLayout/klayout.git
Implemented issue #1656 (Display-->Goto Position dialog should accept + as well as - for number prefixes)
This commit is contained in:
parent
b4d90ef94c
commit
b4d170fa66
|
|
@ -353,9 +353,9 @@ TEST(11)
|
||||||
EXPECT_EQ (x.try_read (tt2), true);
|
EXPECT_EQ (x.try_read (tt2), true);
|
||||||
EXPECT_EQ (x.test ("a"), true);
|
EXPECT_EQ (x.test ("a"), true);
|
||||||
EXPECT_EQ (tt2.to_string (), t2.to_string ());
|
EXPECT_EQ (tt2.to_string (), t2.to_string ());
|
||||||
x = tl::Extractor ("m22.5 *0.55 12.4,-17 ++");
|
x = tl::Extractor ("m22.5 *0.55 12.4,-17 ##");
|
||||||
EXPECT_EQ (x.try_read (tt2), true);
|
EXPECT_EQ (x.try_read (tt2), true);
|
||||||
EXPECT_EQ (x.test ("++"), true);
|
EXPECT_EQ (x.test ("##"), true);
|
||||||
EXPECT_EQ (tt2.to_string (), "m22.5 *0.55 12.4,-17");
|
EXPECT_EQ (tt2.to_string (), "m22.5 *0.55 12.4,-17");
|
||||||
EXPECT_EQ (tt2.to_string (), t3.to_string ());
|
EXPECT_EQ (tt2.to_string (), t3.to_string ());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -322,10 +322,8 @@ static double local_strtod (const char *cp, const char *&cp_new)
|
||||||
if (*cp == '-') {
|
if (*cp == '-') {
|
||||||
s = -1.0;
|
s = -1.0;
|
||||||
++cp;
|
++cp;
|
||||||
/*
|
|
||||||
} else if (*cp == '+') {
|
} else if (*cp == '+') {
|
||||||
++cp;
|
++cp;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract upper digits
|
// Extract upper digits
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,25 @@ TEST(6)
|
||||||
EXPECT_EQ (x3.test (":"), true);
|
EXPECT_EQ (x3.test (":"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(6_double)
|
||||||
|
{
|
||||||
|
Extractor x (" 5.5 -2.5 \n+0.125 (no number)");
|
||||||
|
|
||||||
|
EXPECT_EQ (x.at_end (), false);
|
||||||
|
|
||||||
|
double d = 0.0;
|
||||||
|
|
||||||
|
EXPECT_EQ (x.try_read (d), true);
|
||||||
|
EXPECT_EQ (d, 5.5);
|
||||||
|
|
||||||
|
x.read (d);
|
||||||
|
EXPECT_EQ (d, -2.5);
|
||||||
|
x.read (d);
|
||||||
|
EXPECT_EQ (d, 0.125);
|
||||||
|
|
||||||
|
x.expect ("(");
|
||||||
|
}
|
||||||
|
|
||||||
TEST(7)
|
TEST(7)
|
||||||
{
|
{
|
||||||
EXPECT_EQ (tl::to_quoted_string ("a_word!"), "'a_word!'");
|
EXPECT_EQ (tl::to_quoted_string ("a_word!"), "'a_word!'");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue