3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-20 02:00:23 +00:00

Add tests for dynamic precision and with with an int parameter

This commit is contained in:
Robert O'Callahan 2025-08-15 23:58:58 +00:00
parent 4a324e1da8
commit e906ea3f1b

View file

@ -69,4 +69,14 @@ TEST(KernelStringfTest, dynamicWidthAndPrecision)
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