libexpr: Replace Value::mkPath with constructor calls

The pseudo-constructor `Value::mkPath` would previously be called on an
default-constructed (under-initialized) `Value` to create a properly
initialized `Value` that represents a path. This change
removes mkPath and constructs path `Value`s directly.

Change-Id: I9021de1ff59490828f9fec6866e083996a6a6964
This commit is contained in:
skye
2026-02-23 09:37:40 -05:00
parent d07bbb109e
commit e8f161ead1
6 changed files with 24 additions and 27 deletions
+2 -4
View File
@@ -45,8 +45,7 @@ TEST_F(ValuePrintingTests, tString)
TEST_F(ValuePrintingTests, tPath)
{
Value vPath;
vPath.mkPath("/foo");
Value vPath = {NewValueAs::path, "/foo"};
test(vPath, "/foo");
}
@@ -382,8 +381,7 @@ TEST_F(ValuePrintingTests, ansiColorsStringElided)
TEST_F(ValuePrintingTests, ansiColorsPath)
{
Value v;
v.mkPath(CanonPath("puppy"));
Value v = {NewValueAs::path, CanonPath("puppy")};
test(v,
ANSI_GREEN "/puppy" ANSI_NORMAL,