Commit 246b1cb
authored
Support partial unit systems (#1690)
Extracted from #1544 because representing a unit system for only the
dimensions an application uses is useful independently of QuantityValue.
Moving it out gives the API change focused review and reduces the
original PR's scope.
Changes:
- Allow UnitSystem to be constructed from any BaseUnits value defining
at least one dimension.
- Continue rejecting null and fully undefined base-unit sets.
- Clarify the constructor documentation and exception message.
Tests:
- Change the seven previously rejected one-dimension-missing cases to
assert successful construction.
- Add a single-dimension UnitSystem case.
- Add a dedicated assertion that BaseUnits.Undefined remains invalid.1 parent d761370 commit 246b1cb
2 files changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
0 commit comments