mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-11-22 07:13:13 +01:00
9f22e53a3b
This allows to add new kinds of keys that need more data without making KeyValue's footprint bigger for common keys. This changes the [_symbol] field into [_payload], which holds the same as the previous field for more common keys but can hold bigger objects for keys of the new "Complex" kind. This also adds a complex key: String keys with a symbol different than the outputted string. Unit tests are added as the Java language is not helpful in making robust code.
17 lines
340 B
Java
17 lines
340 B
Java
package juloo.keyboard2;
|
|
|
|
import juloo.keyboard2.KeyValue;
|
|
import org.junit.Test;
|
|
import static org.junit.Assert.*;
|
|
|
|
public class KeyValueTest
|
|
{
|
|
public KeyValueTest() {}
|
|
|
|
@Test
|
|
public void equals()
|
|
{
|
|
assertEquals(KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0), KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0));
|
|
}
|
|
}
|