aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-06-11 22:11:09 +1200
committerDylan <boss@tehbox.org>2026-06-11 22:11:09 +1200
commit49a8dae0f3a6e589dfad65cbbf230137a7b67f4a (patch)
tree12eb15246e6e53911a91fde2d715c5d3a78dc614 /test
parent79a977bc3bea7777de861e4c1adda6d9f9feec99 (diff)
downloadtehjson-49a8dae0f3a6e589dfad65cbbf230137a7b67f4a.tar.gz
tehjson-49a8dae0f3a6e589dfad65cbbf230137a7b67f4a.zip
feat: Started to add arrays
Only supports arrays of ints so far
Diffstat (limited to 'test')
-rw-r--r--test/main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/main.cpp b/test/main.cpp
index 00fca03..456810b 100644
--- a/test/main.cpp
+++ b/test/main.cpp
@@ -1,19 +1,23 @@
+#include "json.h"
#include <json.hpp>
#include <tokenizer.h>
#include <iostream>
#include <memory>
+#include <vector>
using std::cout, std::endl;
int main()
{
TehJSON::JSON jsonWriter;
- // TestClass test1;
- // json["test1"].set(test1);
jsonWriter["test_string"].set<std::string>("stringy");
jsonWriter["test_int"].set<int>(123);
jsonWriter["test_float"].set<float>(51.8);
+ jsonWriter["test_vecs"]["int"].set<int>({1, 2, 3});
+ // jsonWriter["test_vecs"]["float"].set<float>({0.1, 0.2, 0.3});
+ // jsonWriter["test_true"].set(true);
+ // jsonWriter["test_false"].set(false);
jsonWriter["test_object"]["test_int"].set<int>(100);
jsonWriter["test_object"]["test_float"].set<float>(100);