-
Notifications
You must be signed in to change notification settings - Fork 385
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
CLDR-15954 Add test of unit preferences test #3571
Merged
macchiati
merged 1 commit into
unicode-org:main
from
macchiati:CLDR-15954-add-test-of-unit-preferences-test
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Test data for unit locale preferences | ||
# Copyright © 1991-2024 Unicode, Inc. | ||
# For terms of use, see http://www.unicode.org/copyright.html | ||
# SPDX-License-Identifier: Unicode-3.0 | ||
# CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) | ||
# | ||
# Format: | ||
# input-unit; amount; usage; languageTag; expected-unit; expected-amount # comment | ||
# | ||
# • The amounts are both rationals | ||
# • The comment is optional (if it isn't present the # can be omitted) | ||
# | ||
# Use: Convert the Input amount & unit according to the Usage and Locale. | ||
# The result should match the Expected amount and unit. | ||
# | ||
# The input and expected output units are unit identifers; in particular, the output does not have further processing: | ||
# • no localization | ||
# | ||
fahrenheit; 1; default; en-u-rg-uszzzz-ms-ussystem-mu-celsius; celsius; -155/9 # mu > ms > rg > (likely) region | ||
fahrenheit; 1; default; en-u-rg-uszzzz-ms-ussystem-mu-celsius; celsius; -155/9 | ||
fahrenheit; 1; default; en-u-rg-uszzzz-ms-metric; celsius; -155/9 | ||
fahrenheit; 1; default; en-u-rg-dezzzz; celsius; -155/9 | ||
fahrenheit; 1; default; en-DE; celsius; -155/9 # explicit region > likely region | ||
fahrenheit; 1; default; en-US; fahrenheit; 1 | ||
fahrenheit; 1; default; en; fahrenheit; 1 # likely region = US | ||
gallon-imperial; 2.5; fluid; en-u-rg-uszzzz-ms-metric; liter; 11.365225 | ||
gallon-imperial; 2.5; fluid; en-u-rg-dezzzz; liter; 11.365225 | ||
gallon-imperial; 2.5; fluid; en-DE; liter; 11.365225 | ||
gallon-imperial; 2.5; fluid; en-US-u-rg-uszzzz-ms-uksystem; gallon-imperial; 2.5 # ms-uksystem should behave like GB | ||
gallon-imperial; 2.5; fluid; en-u-rg-gbzzzz; gallon-imperial; 2.5 | ||
gallon-imperial; 2.5; fluid; en-GB; gallon-imperial; 2.5 | ||
gallon-imperial; 2.5; fluid; en-u-rg-uszzzz-ms-ussystem; gallon; 1,420,653,125/473176473 | ||
gallon-imperial; 2.5; fluid; en-u-rg-uszzzz; gallon; 1,420,653,125/473176473 | ||
gallon-imperial; 2.5; fluid; en-US; gallon; 1,420,653,125/473176473 | ||
gallon-imperial; 2.5; fluid; en; gallon; 1,420,653,125/473176473 # likely region = US | ||
ampere; 2.5; default; en; ampere; 2.5 # an input unit whose quantity has no preference data should get base units | ||
pound-force-foot; 12,345; default; en; kilowatt-hour; 0.004649325714486427205 | ||
kilocandela; 1; default; en; candela; 1,000 # an input unit whose quantity has no preference data should get base units | ||
candela-per-byte; 1; default; en; candela-per-bit; 0.125 # an input unit that has no quantity should get base units | ||
candela-per-cubic-foot; 1; default; en; candela-per-cubic-meter; 1,953,125,000/55306341 # an input unit that has no quantity should get base units | ||
foot; 1; default; de-u-mu-celsius; centimeter; 30.48 # a -mu unit that is not convertible from the input unit should get ignored | ||
#pound; 28; default; en-u-mu-stone; stone; 2 # only temperature units are supported |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Test data for unit conversions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment, "DO NOT EDIT THIS FILE, it is autogenerated by GenerateUnitTestData.java"? |
||
# Copyright © 1991-2024 Unicode, Inc. | ||
# For terms of use, see http://www.unicode.org/copyright.html | ||
# SPDX-License-Identifier: Unicode-DFS-2016 | ||
# SPDX-License-Identifier: Unicode-3.0 | ||
# CLDR data files are interpreted according to the LDML specification (http://unicode.org/reports/tr35/) | ||
# | ||
# Format: | ||
|
@@ -12,7 +12,7 @@ | |
# round to 4 decimal digits before comparing. | ||
# Note that certain conversions are approximate, such as degrees to radians | ||
# | ||
# Generation: Set GENERATE_TESTS in TestUnits.java to regenerate unitsTest.txt. | ||
# Generation: Use GenerateUnitTestData.java to regenerate unitsTest.txt. | ||
|
||
acceleration ; meter-per-square-second ; meter-per-square-second ; 1 * x ; 1,000.00 | ||
acceleration ; g-force ; meter-per-square-second ; 9.80665 * x ; 9806.65 | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment, "DO NOT EDIT THIS FILE, it is autogenerated by GenerateUnitTestData.java"?