3
0
Fork 0
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:
Emil J 2025-08-19 16:42:49 +02:00 committed by GitHub
commit b0d709f6cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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