Skip to content

Commit f1e4c6c

Browse files
committed
fix failed test
Signed-off-by: aserkes <[email protected]>
1 parent eb88933 commit f1e4c6c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

archetype/engine-v2/src/main/java/io/helidon/build/archetype/engine/v2/util/ArchetypeValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Oracle and/or its affiliates.
2+
* Copyright (c) 2022, 2023 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -171,7 +171,7 @@ public VisitResult visitCondition(Condition condition, Context ctx) {
171171
default:
172172
throw new IllegalStateException("Bad input type");
173173
}
174-
});
174+
}).asBoolean();
175175
} catch (Expression.UnresolvedVariableException ex) {
176176
errors.add(String.format("%s %s: '%s'",
177177
condition.location(),

archetype/engine-v2/src/test/java/io/helidon/build/archetype/engine/v2/ast/ExpressionTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public void testTernaryExpression() {
4343
Expression exp;
4444
Map<String, Value> variables;
4545

46+
exp = Expression.parse("'circle'");
47+
assertThat(exp.eval().asText(), is("circle"));
48+
4649
exp = Expression.parse("${shape} == 'circle' ? 'red' : 'blue'");
4750
variables = Map.of("shape", Value.create("circle"));
4851
assertThat(exp.eval(variables::get).asText(), is("red"));

0 commit comments

Comments
 (0)