Search Issue Tracker
Fixed
Fixed in 1.4.5
Votes
1
Found in [Package]
1.4.4
2.0.1-pre.18
Issue ID
DSTR-1054
Regression
No
"ArgumentException: An item with the same key has already been added" is thrown on Script Reload when an emoji is used as a test case
Reproduction steps:
1. Open the attached “BugRepro” project
2. Place the attached “BrokenCharTest.cs” script in the “Assets/Tests” folder
3. Open the “Assets/Tests/BrokenCharTest” script using a code editor
4. Make any changes to the code, e.g. add a comment
5. Return to the Editor and open the Test Runner window (Window > General > Test Runner)
6. Observe the Console window
Expected result: No errors are logged in the Console
Actual result: "ArgumentException: An item with the same key has already been added…" error is logged in the Console
Reproducible with: 1.1.33, 1.4.4, 2.0.1-pre.18 (2021.3.39f1, 2022.3.34f1)
Not reproducible with: 1.4.4 (6000.0.7f1)
Couldn't test with: 1.4.4 (2023.2.0a5), 2.0.1-pre.18 (2023.2.0a5, 6000.0.7f1) (Package compilation errors)
Fixed in: 1.3.3 (2023.2.0a5)
Reproducible on: Windows 11, macOS 14.5 (M3 Pro) (By user)
Not reproducible on: No other environments tested
Note: In 1.1.33 and 1.3.3 in step 5, the error is constantly logged and the tests disappear from the Test Runner window
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note (fix version 1.4.5):
In UTF 1.4.5 we are improving the error message for non unique test ids, so that it no longer gives an Argument exception about the same key already being added.
After this, it is easier to see what issues at play here:
* This case hits a bug in Nunit, where TestFixtureSource does not work on a class without a namespace.
* The emoji (\uD83D) in the this case is invalid unicode, that gives an error when transformed. It would normally have more components to it (e.g. \ud83d\ude00).
Changing to a simpler emoji (e.g. \u26f2 ) and moving the test into a namespace makes it work again.