mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-13 21:21:27 +00:00
Merge pull request #5304 from rocallahan/idstring-stringf
Support `IdString` parameters in `stringf()` and remove `.c_str()` in a lot of places
This commit is contained in:
commit
c468ee7add
92 changed files with 807 additions and 775 deletions
|
@ -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("%%"), "%");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue