Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix string pattern tests #271

Closed
wants to merge 2 commits into from

Conversation

Mingun
Copy link
Contributor

@Mingun Mingun commented Mar 8, 2024

This PR fixes the following errors:


[info] - csharp:f"abc{1}%def" *** FAILED ***
[info]   ""abc" + [(1).ToString(]) + "%def"" was not equal to ""abc" + [Convert.ToString((long) (1), 10]) + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   ""abc" + [(1).ToString(]) + "%def"" -> ""abc" + [Convert.ToString((long) (1), 10]) + "%def""
[info] - java:f"abc{1}%def" *** FAILED ***
[info]   "...c" + Long.toString(1[]) + "%def"" was not equal to "...c" + Long.toString(1[, 10]) + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   "...c" + Long.toString(1[]) + "%def"" -> "...c" + Long.toString(1[, 10]) + "%def""
[info] - javascript:f"abc{1}%def" *** FAILED ***
[info]   "...abc" + (1).toString([]) + "%def"" was not equal to "...abc" + (1).toString([10]) + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   "...abc" + (1).toString([]) + "%def"" -> "...abc" + (1).toString([10]) + "%def""
[info] - lua:f"abc{1}%def" *** FAILED ***
[info]   ""abc" [.. tostring(1) ..] "%def"" was not equal to ""abc" [+ tostring(1) +] "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   ""abc" [.. tostring(1) ..] "%def"" -> ""abc" [+ tostring(1) +] "%def""
[info] - ruby:f"abc{1}%def" *** FAILED ***
[info]   ""abc" + 1.to_s[] + "%def"" was not equal to ""abc" + 1.to_s[(10)] + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   ""abc" + 1.to_s[] + "%def"" -> ""abc" + 1.to_s[(10)] + "%def""

One of it is using wrong concatenation operator for Lua -- is should be .., not +.
The others is a change in to_string translation, explicit base 10 was removed in 7be4a2b.

Mingun added 2 commits March 8, 2024 12:15
Fixes

[info] - lua:f"abc{1}%def" *** FAILED ***
[info]   ""abc" [.. tostring(1) ..] "%def"" was not equal to ""abc" [+ tostring(1) +] "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   ""abc" [.. tostring(1) ..] "%def"" -> ""abc" [+ tostring(1) +] "%def""
Affected languages:
- C# (also usage of Convert.ToString() was replaced by ordinal .ToString() in the same commit)
- Java
- JavaScript
- Ruby

Fixes

[info] - csharp:f"abc{1}%def" *** FAILED ***
[info]   ""abc" + [(1).ToString(]) + "%def"" was not equal to ""abc" + [Convert.ToString((long) (1), 10]) + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   ""abc" + [(1).ToString(]) + "%def"" -> ""abc" + [Convert.ToString((long) (1), 10]) + "%def""
[info] - java:f"abc{1}%def" *** FAILED ***
[info]   "...c" + Long.toString(1[]) + "%def"" was not equal to "...c" + Long.toString(1[, 10]) + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   "...c" + Long.toString(1[]) + "%def"" -> "...c" + Long.toString(1[, 10]) + "%def""
[info] - javascript:f"abc{1}%def" *** FAILED ***
[info]   "...abc" + (1).toString([]) + "%def"" was not equal to "...abc" + (1).toString([10]) + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   "...abc" + (1).toString([]) + "%def"" -> "...abc" + (1).toString([10]) + "%def""
[info] - ruby:f"abc{1}%def" *** FAILED ***
[info]   ""abc" + 1.to_s[] + "%def"" was not equal to ""abc" + 1.to_s[(10)] + "%def"" (TranslatorSpec.scala:686)
[info]   Analysis:
[info]   ""abc" + 1.to_s[] + "%def"" -> ""abc" + 1.to_s[(10)] + "%def""
@Mingun Mingun force-pushed the fix-string-pattern-tests branch from bfff572 to 23de295 Compare March 8, 2024 07:31
@Mingun
Copy link
Contributor Author

Mingun commented Mar 8, 2024

Implemented in 324f658

@Mingun Mingun closed this Mar 8, 2024
@Mingun Mingun deleted the fix-string-pattern-tests branch March 8, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant