<feed xmlns='http://www.w3.org/2005/Atom'>
<title>7Units/src/test/java, branch v1.0.0b2</title>
<subtitle>A unit converter made in Java, inspired by GNU Units
</subtitle>
<id>https://git.ahopkins.ca/7units.git/atom?h=v1.0.0b2</id>
<link rel='self' href='https://git.ahopkins.ca/7units.git/atom?h=v1.0.0b2'/>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/'/>
<updated>2025-05-31T01:30:44Z</updated>
<entry>
<title>Ensure LinearUnit&amp;Prefix ==/hash obey contracts</title>
<updated>2025-05-31T01:30:44Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-05-31T01:10:09Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=7db19d307970b73559239ec343c92c7876510c2a'/>
<id>urn:sha1:7db19d307970b73559239ec343c92c7876510c2a</id>
<content type='text'>
Previously, these classes' equals() and hashCode() methods did not obey
the contracts:

For equals(), I considered two values equal even if there was a very
small deviation, in order to avoid floating-point error.  This equals
relation is not transitive (i.e. it is possible that a = b &amp;&amp; b = c but
a ≠ c), violating the contract of equals.

This also makes it impossible to properly implement hashCode, as if two
values are equal, they must have the same hash code.  The solution I had
provided is an ineffective hack, which could mess with hash maps and
sets.

I have changed the implementation to demand exact equality.  I have also
provided equalsApproximately() methods to both classes that use the old
behaviour.  Hash codes are only really used for hash maps, and the old
implementation doesn't even achieve its purpose, so I did not add a
method to return the old hash behaviour.
</content>
</entry>
<entry>
<title>Allow prefix search toString to be in any order</title>
<updated>2025-05-31T01:01:53Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-05-31T01:01:53Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=4ff3a48a659aec957c5496923a79c4487d9062ec'/>
<id>urn:sha1:4ff3a48a659aec957c5496923a79c4487d9062ec</id>
<content type='text'>
The order will be determined by hashes, but it doesn't matter which one
goes where.
</content>
</entry>
<entry>
<title>Remove Unitlike/MultiUnit</title>
<updated>2025-05-31T00:54:19Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-05-31T00:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=e86fb71e1665cb9e8511bafd54df0fb8cbca5adc'/>
<id>urn:sha1:e86fb71e1665cb9e8511bafd54df0fb8cbca5adc</id>
<content type='text'>
I ended up never using this code - it was simpler to just use lists of
units and values.  Making a whole new object for lists of units, and an
abstract class for things that convert things other than doubles, is
needlessly complicated, and doesn't solve any major issues.  For
example, I still need to store each Unitlike type in a different
collection, because it will have a different type.
</content>
</entry>
<entry>
<title>ExpressionParser: use correct operand order</title>
<updated>2025-05-31T00:54:17Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-05-21T23:23:35Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=4cb7e4eb4a9213304ee5b83c9aaa0427e9a8fe31'/>
<id>urn:sha1:4cb7e4eb4a9213304ee5b83c9aaa0427e9a8fe31</id>
<content type='text'>
Most of the internal problems with the expression parser happened
because I was accepting the arguments for binary operators in the wrong
order.  For example, '2 - 1' became '1 2 -', not '2 1 -'.

The likely cause of this error is the following sequence of events:
- In commit 6dbd32cd, I created the code for interpreting RPN.  I
  accepted two arguments from the stack (o1 and o2), then performed o1
  &lt;op&gt; o2.  However, because stacks are in LIFO order, I should have
  actually done o2 &lt;op&gt; o1.
- Later, in commit 94349688, I created the code for converting an infix
  expression to RPN.  Creating the expressions in the correct order did
  not work, because my interpreter used the incorrect order.  To 'fix'
  this problem, I created the expressions in the incorrect order.  I did
  not notice any discrepancy, probably because I was not testing the
  individual methods, only the two-step whole (which found no errors).
</content>
</entry>
<entry>
<title>Add tests for submethods of ExpressionParser</title>
<updated>2025-05-21T23:20:44Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-05-21T22:59:40Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=779bf983226f9799dc19d84a3f2cb9a3e26cd540'/>
<id>urn:sha1:779bf983226f9799dc19d84a3f2cb9a3e26cd540</id>
<content type='text'>
These tests fail right now, because ExpressionParser has a bug.  They
should help me fix it.
</content>
</entry>
<entry>
<title>Add tests for Presenter</title>
<updated>2025-05-10T02:20:00Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-05-10T02:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=06bd0e63f1b7bc83009ec3f4d7b048dea015529f'/>
<id>urn:sha1:06bd0e63f1b7bc83009ec3f4d7b048dea015529f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add more UnitDatabase tests</title>
<updated>2025-04-30T21:42:01Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-04-30T21:42:01Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=4910b914392753986526bc28102ddef42e275e6c'/>
<id>urn:sha1:4910b914392753986526bc28102ddef42e275e6c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add tests for NameSymbol</title>
<updated>2025-03-21T20:26:01Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-03-21T20:26:01Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=99ef729b27377b440b15757b789101c7ed87aec1'/>
<id>urn:sha1:99ef729b27377b440b15757b789101c7ed87aec1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add tests for LinearUnitValue</title>
<updated>2025-03-07T16:47:53Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-03-07T16:13:50Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=deb4a650caf9eb49d32810e573f22bbd77f0ca47'/>
<id>urn:sha1:deb4a650caf9eb49d32810e573f22bbd77f0ca47</id>
<content type='text'>
I specifically added tests for the methods that Jacoco says haven't been
tested:
- convertToMultiple
- equals
- equivalent
- hashCode
- operation methods
</content>
</entry>
<entry>
<title>Allow default datafile to be disabled</title>
<updated>2025-02-24T01:36:03Z</updated>
<author>
<name>Adrien Hopkins</name>
<email>adrien.p.hopkins@gmail.com</email>
</author>
<published>2025-02-24T00:20:30Z</published>
<link rel='alternate' type='text/html' href='https://git.ahopkins.ca/7units.git/commit/?id=4436b29053a0b757562ecc1d0a78e22902e6e5ae'/>
<id>urn:sha1:4436b29053a0b757562ecc1d0a78e22902e6e5ae</id>
<content type='text'>
If this option is deselected, the default unit, prefix, dimension and
metric exception data will not be loaded, and only custom data and the
few units that are not provided by files will be available.

The main rationale for this change is so that the data can be localized
by custom unit files.
</content>
</entry>
</feed>
