Skip to content

Commit

Permalink
🚀 1.3.0 yaaay!
Browse files Browse the repository at this point in the history
  • Loading branch information
XyperCode committed Mar 21, 2024
1 parent f018f57 commit e1b7eaa
Show file tree
Hide file tree
Showing 24 changed files with 59 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
455f6122a7108cc3d51ab0adf222c881
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6d589bb9ff8e54c445e1cfcd83055d0b9f69bb46
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5bf04486137d7a63c4ebf40e6ed9b0c7471535c7dfcbd7b732a531223257eeda
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9f30ee52c4d041bb9c620417649dcf45febac2ea6cad256dd05bc2a54e349f051383756cb1554f9b5d8e4f518359c03073c349ebdcd2ab467ba0504ae84691b2
Binary file not shown.
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.jar.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
771e4eb866a22c6fab4fecf6e8dfe4c0
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2e324952b0f790166642724bec4078c14ce411d2
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.jar.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9bbcf8bab6e81a3d3703bed92f17a81d014a50277f97dd8a87ec7e7ca9dc8cec
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.jar.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
488137a92fc072cd510c4297535c2ba842bcca7baf2757f2c87b451475131ecbbde54b922f62d0dfb610a32d2b814d0dbfe0fcf71d1c9aa10440bfe53205a5ba
8 changes: 8 additions & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.ultreon</groupId>
<artifactId>ubo</artifactId>
<version>1.3.0</version>
</project>
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.pom.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
978fb10b328964e32d4f2f60b888addf
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.pom.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1919ad0c4071bdb56e54f85bbe0d7166afeb993f
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.pom.sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cbc134ea17c83324d2f759793781cad2c9d4bd00f73c02d961b9422151f3da73
1 change: 1 addition & 0 deletions .mvnrepo/io/github/ultreon/ubo/1.3.0/ubo-1.3.0.pom.sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b3543804bf974cc1452eed287f897058331f0573c52b52bdb7342be424f0379f59069b3a3b5b2dbec6ba719df07389dc0c30873bf905faa4b7e60ae3129cb644
7 changes: 4 additions & 3 deletions .mvnrepo/io/github/ultreon/ubo/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
<groupId>io.github.ultreon</groupId>
<artifactId>ubo</artifactId>
<versioning>
<latest>1.2.2</latest>
<release>1.2.2</release>
<latest>1.3.0</latest>
<release>1.3.0</release>
<versions>
<version>1.2.0</version>
<version>1.2.1</version>
<version>1.2.1+patch.1</version>
<version>1.2.2</version>
<version>1.3.0</version>
</versions>
<lastUpdated>20231110211305</lastUpdated>
<lastUpdated>20240321223511</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion .mvnrepo/io/github/ultreon/ubo/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
238f13918992c2ca9c4f00e4beea78ed
d3b9def22fc575bacb4692354ce99b23
2 changes: 1 addition & 1 deletion .mvnrepo/io/github/ultreon/ubo/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b6b59dcc3123435eb4a88b9b7ed4848dd2a75259
093c0f7c7460dad5b15fadd0a1661d630b72e810
2 changes: 1 addition & 1 deletion .mvnrepo/io/github/ultreon/ubo/maven-metadata.xml.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c89b3605ec46babdd9ba81a5fbae6df5638a39996c9af96e6afa61efe035517f
c205c3ef4d7507e323c3d29527e60a5823960b6306821c08bc9bed8d22211989
2 changes: 1 addition & 1 deletion .mvnrepo/io/github/ultreon/ubo/maven-metadata.xml.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5e887f7adf29b333f15d0d6e19350cd62638b77b29007a4c722a8147ba6d5f72ab431c981573fcf6f7f18aa428a6b23dfaa08c55f1b544141b04b15d75999981
7c6f75c31e09f9d170fa55c3be88c5338f50e6195b7c7c857e4ef69bf688e05fe1abec2b05e3fad50615c8e9bebfee19ad05c96845e053273a15f3799edfe624
2 changes: 1 addition & 1 deletion src/main/java/com/ultreon/data/UsoParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private IType<?> readBoolean() throws IOException {
StringBuilder builder = new StringBuilder();
while (true) {
int r = read();
if (r == -1) throw new EOFException("Invalid boolean: EOF");
if (r == -1) break;
if (!Character.isAlphabetic(r)) break;
builder.append((char) r);
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/ultreon/data/types/ListType.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public ListType(int id) {
@SafeVarargs
public ListType(T... type) {
this(type.getClass().getComponentType());

this.setValue(Arrays.asList(type));
}

@SafeVarargs
Expand Down Expand Up @@ -179,7 +181,7 @@ public ListType<T> copy() {
@Override
public String writeUso() {
StringBuilder builder = new StringBuilder("[");
for (T t : obj)
for (T t : this)
builder.append(t.writeUso()).append(", ");

if (this.obj.size() > 0)
Expand Down
29 changes: 26 additions & 3 deletions src/test/java/com/ultreon/tests/data/UsoReadWriteTests.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
package com.ultreon.tests.data;

import com.ultreon.data.DataIo;
import com.ultreon.data.types.ListType;
import com.ultreon.data.types.MapType;
import com.ultreon.data.types.StringType;
import com.ultreon.data.types.*;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.BitSet;
import java.util.Map;
import java.util.UUID;

class UsoReadWriteTests {
@Test
Expand Down Expand Up @@ -59,4 +62,24 @@ void readWriteList() throws IOException {
}
Assertions.assertEquals(readList, list);
}

@Test
@DisplayName("PrimitiveTypes")
void readWritePrimitive() {
Assertions.assertEquals(DataIo.toUso(new StringType("Apple")), "\"Apple\"");
Assertions.assertEquals(DataIo.toUso(new BooleanType(true)), "true");
Assertions.assertEquals(DataIo.toUso(new ByteType(5)), "5b");
Assertions.assertEquals(DataIo.toUso(new ShortType(5)), "5s");
Assertions.assertEquals(DataIo.toUso(new IntType(5)), "5i");
Assertions.assertEquals(DataIo.toUso(new LongType(5)), "5l");
Assertions.assertEquals(DataIo.toUso(new FloatType(5.5f)), "5.5f");
Assertions.assertEquals(DataIo.toUso(new DoubleType(5.5)), "5.5d");
Assertions.assertEquals(DataIo.toUso(new CharType('a')), "'a'");
Assertions.assertEquals(DataIo.toUso(new BigIntType(BigInteger.ONE)), "1I");
Assertions.assertEquals(DataIo.toUso(new BigDecType(BigDecimal.ONE)), "1D");
Assertions.assertEquals(DataIo.toUso(new UUIDType(UUID.fromString("00000000-0000-0000-0000-000000000000"))), "<00000000-0000-0000-0000-000000000000>");
Assertions.assertEquals(DataIo.toUso(new BitSetType(new BitSet())), "x;");
Assertions.assertEquals(DataIo.toUso(new ListType<>(new StringType("Apple"))), "[\"Apple\"]");
Assertions.assertEquals(DataIo.toUso(new MapType()), "{}");
}
}

0 comments on commit e1b7eaa

Please sign in to comment.