Support IdString parameters in stringf
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "kernel/io.h"
|
||||
#include "kernel/rtlil.h"
|
||||
|
||||
YOSYS_NAMESPACE_BEGIN
|
||||
|
||||
@@ -44,6 +45,12 @@ TEST(KernelStringfTest, stringViewParam)
|
||||
EXPECT_EQ(stringf("%s", std::string_view("hello")), "hello");
|
||||
}
|
||||
|
||||
TEST(KernelStringfTest, idStringParam)
|
||||
{
|
||||
RTLIL::IdString id("$hello");
|
||||
EXPECT_EQ(stringf("%s", id), "$hello");
|
||||
}
|
||||
|
||||
TEST(KernelStringfTest, escapePercent)
|
||||
{
|
||||
EXPECT_EQ(stringf("%%"), "%");
|
||||
|
||||
Reference in New Issue
Block a user