Skip to content

Commit

Permalink
RD-14693: String.From(<string>) tries to resolve the string into a lo…
Browse files Browse the repository at this point in the history
…cation (#502)
  • Loading branch information
bgaidioz authored Sep 17, 2024
1 parent f2d53d5 commit 28e8bd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class StringPackageTest extends SnapiTestContext with FailAfterNServer {

test("String.From(true)")(it => it should evaluateTo(""" "true" """))

test("String.From(\"tralala\")")(it => it should evaluateTo(""" "tralala" """))

test("String.From(Date.Build(1975, 6, 23))")(it => it should evaluateTo(""" "1975-06-23" """))

test("String.From(Timestamp.Build(1975, 6, 23, 9, 30))")(it =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class StringFromEntry extends EntryExtension {
SnapiDoubleType(),
SnapiDecimalType(),
SnapiBoolType(),
SnapiStringType(),
SnapiDateType(),
SnapiTimeType(),
SnapiTimestampType(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ protected String fromBoolean(boolean value) {
return String.valueOf(value);
}

@Specialization
@TruffleBoundary
protected String fromString(String value) {
return value;
}

@Specialization
@TruffleBoundary
protected String fromDate(DateObject value) {
Expand Down

0 comments on commit 28e8bd4

Please sign in to comment.