mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-20 02:00:23 +00:00
Merge pull request #5294 from rocallahan/precision-tests
Add tests for dynamic precision and with with an int parameter
This commit is contained in:
commit
b0d709f6cf
1 changed files with 10 additions and 0 deletions
|
@ -69,4 +69,14 @@ TEST(KernelStringfTest, dynamicWidthAndPrecision)
|
||||||
EXPECT_EQ(stringf("%*.*f", 8, 4, 1.0), " 1.0000");
|
EXPECT_EQ(stringf("%*.*f", 8, 4, 1.0), " 1.0000");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(KernelStringfTest, dynamicPrecisionInt)
|
||||||
|
{
|
||||||
|
EXPECT_EQ(stringf("%.*d", 4, 7), "0007");
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(KernelStringfTest, dynamicWidthAndPrecisionInt)
|
||||||
|
{
|
||||||
|
EXPECT_EQ(stringf("%*.*d", 8, 4, 7), " 0007");
|
||||||
|
}
|
||||||
|
|
||||||
YOSYS_NAMESPACE_END
|
YOSYS_NAMESPACE_END
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue