From a9485b187844cad900bc43c0651406c51a7295c1 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Wed, 28 Aug 2024 19:23:34 -0500 Subject: Bump version number to 1.0.0a1 --- README.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.org') diff --git a/README.org b/README.org index 4e64591..cf8de11 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -* 7Units Version 0.5.0 +* 7Units Version 1.0.0-alpha.1 (this project uses Semantic Versioning) ** What is it? This is a unit converter, which allows you to convert between different units, and includes a GUI which can read unit data from a file (using some unit math) and convert between units that you type in, and has a unit and prefix viewer to check the units that have been loaded in. -- cgit v1.2.3 From dfdcf58c8751db95f024528aa38dd81eb2364f39 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sun, 23 Feb 2025 20:53:06 -0500 Subject: Bump version number to 1.0.0b1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compared to version 0.5.0, this release: - allows conversion to sums of units (e.g. 4/3 ft → 1 ft + 4 in) - allows non-integer exponents in expressions - adds the ability to change the UI language - gracefully handles datafile errors - adds more information to the loading-success message, and adds it to the About tab - allows the user to not use the default datafiles No new features will be added until the release of version 1.0.0. --- CHANGELOG.org | 3 +++ README.org | 2 +- docs/roadmap.org | 9 --------- src/main/java/sevenUnits/ProgramInfo.java | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) (limited to 'README.org') diff --git a/CHANGELOG.org b/CHANGELOG.org index 78bb9a1..0798904 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -5,7 +5,10 @@ All notable changes in this project will be shown in this file. - *Allowed conversion to a sum of units (e.g. 4/3 ft \rightarrow 1 ft + 4 in).* - *Allowed exponents on units to be non-integer numbers.* The resulting exponents are rounded to the nearest integer, and the user is warned if this rounding changes the value by more than normal floating-point error. +- *Added the ability to change the language of 7Units's UI.* + This does not affect the names of units, prefixes and dimensions. - Added more information to the loading-success message, and added it to the about tab. +- Added the ability to not use the default data files. *** Changed - *Errors in unit/dimension files are shown in popups, rather than crashing the program.* *** Fixed diff --git a/README.org b/README.org index cf8de11..279c378 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -* 7Units Version 1.0.0-alpha.1 +* 7Units Version 1.0.0-beta.1 (this project uses Semantic Versioning) ** What is it? This is a unit converter, which allows you to convert between different units, and includes a GUI which can read unit data from a file (using some unit math) and convert between units that you type in, and has a unit and prefix viewer to check the units that have been loaded in. diff --git a/docs/roadmap.org b/docs/roadmap.org index 04ea0a5..963c17d 100644 --- a/docs/roadmap.org +++ b/docs/roadmap.org @@ -3,15 +3,6 @@ Here is a list of the unfinished requirements for version 1.0.0. When everythin These requirements are subject to change. I intend to finish version 1.0.0 by [2025-04-27 Sun]. -Feature Requirements: -- 7Units should be able to parse unit files from [[https://www.gnu.org/software/units/][GNU Units]], the program that inspired it. -- 7Units's expression converter should support most or all of the conversion features supported by GNU Units: - - (/Mostly Done/) Converting to sums of units (it should also be possible to do this in the unit converter with preset combinations) - - (/Optional/) Inverse nonlinear conversion with the tilde prefix - - (/Optional/) Nonlinear units should be specifiable in unit files. - - /Any other feature not listed should be considered optional./ -- (/Optional/) It should be possible to add, edit and remove units and prefixes from the GUI unit and prefix viewers. - Documentation/Testing Requirements: - 7Units should be fully documented. - 7Units should have automated testing with a code coverage of at least 2/3 (ideally at least 5/6). diff --git a/src/main/java/sevenUnits/ProgramInfo.java b/src/main/java/sevenUnits/ProgramInfo.java index 573c5c7..fee3cea 100644 --- a/src/main/java/sevenUnits/ProgramInfo.java +++ b/src/main/java/sevenUnits/ProgramInfo.java @@ -26,9 +26,9 @@ import sevenUnits.utils.SemanticVersionNumber; */ public final class ProgramInfo { - /** The version number (1.0.0-alpha.1) */ + /** The version number (1.0.0-beta.1) */ public static final SemanticVersionNumber VERSION = SemanticVersionNumber - .preRelease(1, 0, 0, "alpha", 1); + .preRelease(1, 0, 0, "beta", 1); private ProgramInfo() { // this class is only for static variables, you shouldn't be able to -- cgit v1.2.3 From 7eb1ce7787c6306321a4db378b1cbd37ce721583 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Fri, 30 May 2025 20:31:09 -0500 Subject: Bump version to 1.0.0b2 All that's left before 1.0.0 is released is the documentation fixes. Unless I find any major issues, 7Units 1.0.0 releases June 8. --- README.org | 2 +- src/main/java/sevenUnits/ProgramInfo.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index 279c378..aaec93b 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -* 7Units Version 1.0.0-beta.1 +* 7Units Version 1.0.0-beta.2 (this project uses Semantic Versioning) ** What is it? This is a unit converter, which allows you to convert between different units, and includes a GUI which can read unit data from a file (using some unit math) and convert between units that you type in, and has a unit and prefix viewer to check the units that have been loaded in. diff --git a/src/main/java/sevenUnits/ProgramInfo.java b/src/main/java/sevenUnits/ProgramInfo.java index fee3cea..4fd4375 100644 --- a/src/main/java/sevenUnits/ProgramInfo.java +++ b/src/main/java/sevenUnits/ProgramInfo.java @@ -26,9 +26,9 @@ import sevenUnits.utils.SemanticVersionNumber; */ public final class ProgramInfo { - /** The version number (1.0.0-beta.1) */ + /** The version number (1.0.0-beta.2) */ public static final SemanticVersionNumber VERSION = SemanticVersionNumber - .preRelease(1, 0, 0, "beta", 1); + .preRelease(1, 0, 0, "beta", 2); private ProgramInfo() { // this class is only for static variables, you shouldn't be able to -- cgit v1.2.3 From 9fae9ea92fafeaade20e0641a768c30c22ca79a4 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sun, 1 Jun 2025 19:37:14 -0500 Subject: Update README --- README.org | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index aaec93b..ff46ae2 100644 --- a/README.org +++ b/README.org @@ -1,18 +1,35 @@ * 7Units Version 1.0.0-beta.2 - (this project uses Semantic Versioning) +(this project uses Semantic Versioning) + +[[http://unmaintained.tech/][http://unmaintained.tech/badge.svg]] ** What is it? - This is a unit converter, which allows you to convert between different units, and includes a GUI which can read unit data from a file (using some unit math) and convert between units that you type in, and has a unit and prefix viewer to check the units that have been loaded in. +This is a unit converter, which allows you to convert between different units, and includes a GUI which can read unit data from a file (using some unit math) and convert between units that you type in, and has a unit and prefix viewer to check the units that have been loaded in. + +7Units started as a high school project, but over my bachelor's degree I continued working on it from time to time to perfect it. - Check the [[./docs/manual.pdf][user manual]] for information on how to use the program. +Check the [[./docs/manual.pdf][user manual]] for information on how to use the program. ** Features - - Convert between units and between expressions of units - - Any linear or base units can use unit prefixes (including non-metric units!) - - Units and prefixes are defined in an editable data file, in a simple and intuitive format. - - Viewer and Prefix Viewer which allow you to search through all of the available units and prefixes and learn details about them. - - All of SI included in default text file - - Customizable rounding rules +- Convert between units and between expressions of units +- Any linear or base units can use unit prefixes (including non-metric units!) +- Units and prefixes are defined in an editable data file, in a simple and intuitive format. +- Viewer and Prefix Viewer which allow you to search through all of the available units and prefixes and learn details about them. +- All of SI included in default text file +- Customizable rounding rules +- Multiple languages, with ability to add additional custom language files ** Screenshots - #+CAPTION: The main conversion interface - [[./screenshots/main-interface-dimension-converter.png]] - #+CAPTION: A secondary, more complicated conversion option - [[./screenshots/main-interface-expression-converter.png]] +#+CAPTION: The main conversion interface +[[./screenshots/main-interface-dimension-converter.png]] +#+CAPTION: A secondary, more complicated conversion option +[[./screenshots/main-interface-expression-converter.png]] +** How to Use 7Units +7Units uses Gradle as its build system. + +- To build 7Units: ~./gradlew build~. + This creates a test report at ~build/reports/tests/test/index.html~ and a Jacoco code coverage report at ~build/reports/jacoco/test/html/index.html~. +- To run 7Units: ~./gradlew run~. +- To generate Javadoc: ~./gradlew javadoc~. + The Javadoc will be at ~build/docs/javadoc/index.html~. +- To create a JAR: ~./gradlew jar~. + The JAR will be at ~build/libs/sevenUnits.jar~. + +Instructions on using the program itself can be found at ~docs/manual.pdf~. -- cgit v1.2.3 From bccb5b5e3452421c81c1fb58f83391ba6584807c Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sun, 15 Jun 2025 19:37:19 -0500 Subject: Bump version number to 1.0.0 --- README.org | 4 ++-- src/main/java/sevenUnits/ProgramInfo.java | 5 ++--- src/main/java/sevenUnits/unit/LinearUnit.java | 6 ++---- src/main/java/sevenUnits/unit/LinearUnitValue.java | 3 +-- src/main/java/sevenUnits/unit/UnitDatabase.java | 13 +++++-------- .../sevenUnits/utils/SemanticVersionNumber.java | 5 +++-- src/main/java/sevenUnits/utils/UncertainDouble.java | 8 ++++---- .../sevenUnitsGUI/DefaultPrefixRepetitionRule.java | 3 ++- src/main/java/sevenUnitsGUI/Presenter.java | 3 +-- src/main/java/sevenUnitsGUI/SearchBoxList.java | 4 ++-- src/test/java/sevenUnits/unit/UnitTest.java | 9 +++------ .../utils/ConditionalExistenceCollectionsTest.java | 3 +-- .../java/sevenUnits/utils/SemanticVersionTest.java | 21 +++++++-------------- .../java/sevenUnits/utils/UncertainDoubleTest.java | 9 +++------ 14 files changed, 38 insertions(+), 58 deletions(-) (limited to 'README.org') diff --git a/README.org b/README.org index ff46ae2..2e3f227 100644 --- a/README.org +++ b/README.org @@ -1,5 +1,5 @@ -* 7Units Version 1.0.0-beta.2 -(this project uses Semantic Versioning) +* 7Units Version 1.0.0 +This project uses Semantic Versioning, and its public API is all public code in ~src/main/java~. [[http://unmaintained.tech/][http://unmaintained.tech/badge.svg]] ** What is it? diff --git a/src/main/java/sevenUnits/ProgramInfo.java b/src/main/java/sevenUnits/ProgramInfo.java index 5ed1309..e74a99b 100644 --- a/src/main/java/sevenUnits/ProgramInfo.java +++ b/src/main/java/sevenUnits/ProgramInfo.java @@ -25,10 +25,9 @@ import sevenUnits.utils.SemanticVersionNumber; * @since v0.3.1 */ public final class ProgramInfo { - - /** The version number (1.0.0-beta.2) */ + /** The version number (1.0.0) */ public static final SemanticVersionNumber VERSION = SemanticVersionNumber - .preRelease(1, 0, 0, "beta", 2); + .stableVersion(1, 0, 0); private ProgramInfo() { // this class is only for static variables, you shouldn't be able to diff --git a/src/main/java/sevenUnits/unit/LinearUnit.java b/src/main/java/sevenUnits/unit/LinearUnit.java index 22105b6..85f6dd9 100644 --- a/src/main/java/sevenUnits/unit/LinearUnit.java +++ b/src/main/java/sevenUnits/unit/LinearUnit.java @@ -220,8 +220,7 @@ public final class LinearUnit extends Unit { Objects.requireNonNull(divisor, "other must not be null"); // divide the units - final var base = this.getBase() - .dividedBy(divisor.getBase()); + final var base = this.getBase().dividedBy(divisor.getBase()); return valueOf(base, this.getConversionFactor() / divisor.getConversionFactor()); } @@ -382,8 +381,7 @@ public final class LinearUnit extends Unit { Objects.requireNonNull(multiplier, "other must not be null"); // multiply the units - final var base = this.getBase() - .times(multiplier.getBase()); + final var base = this.getBase().times(multiplier.getBase()); return valueOf(base, this.getConversionFactor() * multiplier.getConversionFactor()); } diff --git a/src/main/java/sevenUnits/unit/LinearUnitValue.java b/src/main/java/sevenUnits/unit/LinearUnitValue.java index 9a99e00..ce60e3b 100644 --- a/src/main/java/sevenUnits/unit/LinearUnitValue.java +++ b/src/main/java/sevenUnits/unit/LinearUnitValue.java @@ -150,8 +150,7 @@ public final class LinearUnitValue { remaining = remaining.minus(value); } - final var lastValue = remaining - .convertTo(others.get(others.size() - 1)); + final var lastValue = remaining.convertTo(others.get(others.size() - 1)); values.add(lastValue); return values; } diff --git a/src/main/java/sevenUnits/unit/UnitDatabase.java b/src/main/java/sevenUnits/unit/UnitDatabase.java index 05e9cc9..36c225f 100644 --- a/src/main/java/sevenUnits/unit/UnitDatabase.java +++ b/src/main/java/sevenUnits/unit/UnitDatabase.java @@ -1229,12 +1229,10 @@ public final class UnitDatabase { private final ExpressionParser prefixExpressionParser = new ExpressionParser.Builder<>( this::getPrefix).addBinaryOperator("+", UnitPrefix::plus, 0) .addBinaryOperator("-", UnitPrefix::minus, 0) - .addBinaryOperator("*", UnitPrefix::times, 1) - .addSpaceFunction("*") + .addBinaryOperator("*", UnitPrefix::times, 1).addSpaceFunction("*") .addBinaryOperator("/", UnitPrefix::dividedBy, 1) - .addBinaryOperator("|", UnitPrefix::dividedBy, 3) - .addBinaryOperator("^", (o1, o2) -> o1.toExponent(o2.getMultiplier()), - 2) + .addBinaryOperator("|", UnitPrefix::dividedBy, 3).addBinaryOperator( + "^", (o1, o2) -> o1.toExponent(o2.getMultiplier()), 2) .build(); /** @@ -1624,9 +1622,8 @@ public final class UnitDatabase { if (unit instanceof LinearUnit) return (LinearUnit) unit; - else - throw new IllegalArgumentException( - String.format("%s is not a linear unit.", name)); + throw new IllegalArgumentException( + String.format("%s is not a linear unit.", name)); } /** diff --git a/src/main/java/sevenUnits/utils/SemanticVersionNumber.java b/src/main/java/sevenUnits/utils/SemanticVersionNumber.java index c081a25..4bb7ce5 100644 --- a/src/main/java/sevenUnits/utils/SemanticVersionNumber.java +++ b/src/main/java/sevenUnits/utils/SemanticVersionNumber.java @@ -332,7 +332,7 @@ public final class SemanticVersionNumber if (aNumber < bNumber) return -1; - else if (aNumber > bNumber) + if (aNumber > bNumber) return 1; } else if (NUMERIC_IDENTIFER.matcher(bElement).matches()) // aElement is not a number but bElement is @@ -602,7 +602,8 @@ public final class SemanticVersionNumber return false; } else if (!this.buildMetadata.equals(other.buildMetadata)) return false; - if ((this.major != other.major) || (this.minor != other.minor) || (this.patch != other.patch)) + if ((this.major != other.major) || (this.minor != other.minor) + || (this.patch != other.patch)) return false; if (this.preReleaseIdentifiers == null) { if (other.preReleaseIdentifiers != null) diff --git a/src/main/java/sevenUnits/utils/UncertainDouble.java b/src/main/java/sevenUnits/utils/UncertainDouble.java index ecee586..24ada20 100644 --- a/src/main/java/sevenUnits/utils/UncertainDouble.java +++ b/src/main/java/sevenUnits/utils/UncertainDouble.java @@ -207,7 +207,8 @@ public final class UncertainDouble implements Comparable { if (!(obj instanceof UncertainDouble)) return false; final var other = (UncertainDouble) obj; - if ((Double.compare(this.value, other.value) != 0) || (Double.compare(this.uncertainty, other.uncertainty) != 0)) + if ((Double.compare(this.value, other.value) != 0) + || (Double.compare(this.uncertainty, other.uncertainty) != 0)) return false; return true; } @@ -470,10 +471,9 @@ public final class UncertainDouble implements Comparable { final var bigUncertainty = BigDecimal.valueOf(this.uncertainty); final var displayScale = this.getDisplayScale(); - final var roundedUncertainty = bigUncertainty - .setScale(displayScale, roundingMode); - final var roundedValue = bigValue.setScale(displayScale, + final var roundedUncertainty = bigUncertainty.setScale(displayScale, roundingMode); + final var roundedValue = bigValue.setScale(displayScale, roundingMode); valueString = roundedValue.toString(); uncertaintyString = roundedUncertainty.toString(); diff --git a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java index a441911..0e38c67 100644 --- a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java +++ b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java @@ -74,7 +74,8 @@ public enum DefaultPrefixRepetitionRule implements Predicate> { for (final UnitPrefix prefix : prefixes) { // check that the current prefix is metric and appropriately // magnifying/reducing - if (!Metric.DECIMAL_PREFIXES.contains(prefix) || (magnifying != prefix.getMultiplier() > 1)) + if (!Metric.DECIMAL_PREFIXES.contains(prefix) + || (magnifying != prefix.getMultiplier() > 1)) return false; // check if the current prefix is correct diff --git a/src/main/java/sevenUnitsGUI/Presenter.java b/src/main/java/sevenUnitsGUI/Presenter.java index 7fd979a..d258e1f 100644 --- a/src/main/java/sevenUnitsGUI/Presenter.java +++ b/src/main/java/sevenUnitsGUI/Presenter.java @@ -766,8 +766,7 @@ public final class Presenter { } } if (LOCAL_LOCALES.contains(this.userLocale)) { - final var filename = String.format("/about/%s.txt", - this.userLocale); + final var filename = String.format("/about/%s.txt", this.userLocale); return this.formatAboutText( Presenter.getLinesFromResource(filename).stream()); } diff --git a/src/main/java/sevenUnitsGUI/SearchBoxList.java b/src/main/java/sevenUnitsGUI/SearchBoxList.java index bddce04..96f71de 100644 --- a/src/main/java/sevenUnitsGUI/SearchBoxList.java +++ b/src/main/java/sevenUnitsGUI/SearchBoxList.java @@ -237,7 +237,7 @@ final class SearchBoxList extends JPanel { public void reapplyFilter() { final var searchText = this.searchBoxEmpty ? "" : this.searchBox.getText(); - final var comparator = new FilterComparator(searchText, + final var comparator = new FilterComparator<>(searchText, this.defaultOrdering, this.caseSensitive); final var searchFilter = this.getSearchFilter(searchText); @@ -300,7 +300,7 @@ final class SearchBoxList extends JPanel { } final var searchText = this.searchBoxEmpty ? "" : this.searchBox.getText(); - final var comparator = new FilterComparator(searchText, + final var comparator = new FilterComparator<>(searchText, this.defaultOrdering, this.caseSensitive); final var searchFilter = this.getSearchFilter(searchText); diff --git a/src/test/java/sevenUnits/unit/UnitTest.java b/src/test/java/sevenUnits/unit/UnitTest.java index 7ae550f..fb21723 100644 --- a/src/test/java/sevenUnits/unit/UnitTest.java +++ b/src/test/java/sevenUnits/unit/UnitTest.java @@ -60,10 +60,8 @@ class UnitTest { // test with LinearUnitValue final var value1 = LinearUnitValue.getExact(Metric.METRE, 15); final var value2 = LinearUnitValue.getExact(foot, 120); - final var value3 = LinearUnitValue.getExact(Metric.METRE, - 0.5); - final var value4 = LinearUnitValue.getExact(Metric.KILOGRAM, - 60); + final var value3 = LinearUnitValue.getExact(Metric.METRE, 0.5); + final var value4 = LinearUnitValue.getExact(Metric.KILOGRAM, 60); // make sure addition is done correctly assertEquals(51.576, value1.plus(value2).getValueExact(), 0.001); @@ -151,8 +149,7 @@ class UnitTest { @Test public void testPrefixes() { - final var generatedKilometre = Metric.METRE - .withPrefix(Metric.KILO); + final var generatedKilometre = Metric.METRE.withPrefix(Metric.KILO); final var actualKilometre = Metric.METRE.times(1000); assertEquals(generatedKilometre, actualKilometre); diff --git a/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java b/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java index f203fad..8711847 100644 --- a/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java +++ b/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java @@ -120,8 +120,7 @@ class ConditionalExistenceCollectionsTest { /** Test method for the ConditionalExistenceCollection's iterator. */ @Test void testIterator() { - final var testIterator = this - .getTestIterator(); + final var testIterator = this.getTestIterator(); assertTrue(testIterator.hasNext); assertTrue(testIterator.hasNext()); diff --git a/src/test/java/sevenUnits/utils/SemanticVersionTest.java b/src/test/java/sevenUnits/utils/SemanticVersionTest.java index 047f0b5..5b74812 100644 --- a/src/test/java/sevenUnits/utils/SemanticVersionTest.java +++ b/src/test/java/sevenUnits/utils/SemanticVersionTest.java @@ -72,14 +72,12 @@ public final class SemanticVersionTest { */ @Test public void testComplexToString() { - final var v1 = builder(1, 2, 3).preRelease(1, 2, 3) - .build(); + final var v1 = builder(1, 2, 3).preRelease(1, 2, 3).build(); assertEquals("1.2.3-1.2.3", v1.toString()); final var v2 = builder(4, 5, 6).preRelease("abc", 123) .buildMetadata("2022-02-19").build(); assertEquals("4.5.6-abc.123+2022-02-19", v2.toString()); - final var v3 = builder(1, 0, 0) - .preRelease("x-y-z", "--").build(); + final var v3 = builder(1, 0, 0).preRelease("x-y-z", "--").build(); assertEquals("1.0.0-x-y-z.--", v3.toString()); } @@ -91,8 +89,7 @@ public final class SemanticVersionTest { */ @Test public void testComplexVersions() { - final var v1 = builder(1, 2, 3).preRelease(1, 2, 3) - .build(); + final var v1 = builder(1, 2, 3).preRelease(1, 2, 3).build(); assertEquals(1, v1.majorVersion()); assertEquals(2, v1.minorVersion()); assertEquals(3, v1.patchVersion()); @@ -107,8 +104,7 @@ public final class SemanticVersionTest { assertEquals(List.of("abc", "123"), v2.preReleaseIdentifiers()); assertEquals(List.of("2022-02-19"), v2.buildMetadata()); - final var v3 = builder(1, 0, 0) - .preRelease("x-y-z", "--").build(); + final var v3 = builder(1, 0, 0).preRelease("x-y-z", "--").build(); assertEquals(1, v3.majorVersion()); assertEquals(0, v3.minorVersion()); assertEquals(0, v3.patchVersion()); @@ -298,13 +294,10 @@ public final class SemanticVersionTest { */ @Test public void testOrder() { - final var v100a = builder(1, 0, 0).preRelease("alpha") - .build(); // 1.0.0-alpha + final var v100a = builder(1, 0, 0).preRelease("alpha").build(); // 1.0.0-alpha final var v100a1 = preRelease(1, 0, 0, "alpha", 1); // 1.0.0-alpha.1 - final var v100ab = builder(1, 0, 0) - .preRelease("alpha", "beta").build(); // 1.0.0-alpha.beta - final var v100b = builder(1, 0, 0).preRelease("beta") - .build(); // 1.0.0-alpha + final var v100ab = builder(1, 0, 0).preRelease("alpha", "beta").build(); // 1.0.0-alpha.beta + final var v100b = builder(1, 0, 0).preRelease("beta").build(); // 1.0.0-alpha final var v100b2 = preRelease(1, 0, 0, "beta", 2); // 1.0.0-beta.2 final var v100b11 = preRelease(1, 0, 0, "beta", 11); // 1.0.0-beta.11 final var v100rc1 = preRelease(1, 0, 0, "rc", 1); // 1.0.0-rc.1 diff --git a/src/test/java/sevenUnits/utils/UncertainDoubleTest.java b/src/test/java/sevenUnits/utils/UncertainDoubleTest.java index 8dcd595..733a308 100644 --- a/src/test/java/sevenUnits/utils/UncertainDoubleTest.java +++ b/src/test/java/sevenUnits/utils/UncertainDoubleTest.java @@ -49,15 +49,12 @@ class UncertainDoubleTest { final var x = UncertainDouble.of(Math.PI, 0.1); // slightly different because roundoff errors - final var x1 = UncertainDouble.of(Math.PI + Math.E - Math.E, - 0.1); - final var x2 = UncertainDouble.of(Math.PI * Math.E / Math.E, - 0.1); + final var x1 = UncertainDouble.of(Math.PI + Math.E - Math.E, 0.1); + final var x2 = UncertainDouble.of(Math.PI * Math.E / Math.E, 0.1); // get results final var result1 = x.plusExact(Math.E).minusExact(Math.E); - final var result2 = x.timesExact(Math.E) - .dividedByExact(Math.E); + final var result2 = x.timesExact(Math.E).dividedByExact(Math.E); // test that these operations work & don't change uncertainty assertEquals(x1, result1); -- cgit v1.2.3