From 9abace78cf1e02b47421e4bfa7f76f0bbc9deaaa Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Tue, 26 Jul 2022 22:18:57 -0700 Subject: [PATCH 1/7] Returns the TOML library to previous functionality The DM-side of the API returns an object instead of a json string --- dmsrc/toml.dm | 2 +- tests/dm/toml.dme | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dmsrc/toml.dm b/dmsrc/toml.dm index d30d2bb8..8ef7c277 100644 --- a/dmsrc/toml.dm +++ b/dmsrc/toml.dm @@ -3,6 +3,6 @@ /proc/rustg_read_toml_file(path) var/list/output = rustg_raw_read_toml_file(path) if (output["success"]) - return output["content"] + return json_decode(output["content"]) else CRASH(output["content"]) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index a570f4fa..5fff598e 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -17,5 +17,5 @@ var/test_json = @{" var/toml_output = rustg_read_toml_file("test.toml") - if (toml_output != test_json) + if (toml_output != json_decode(test_json)) // We want to compare the decoded *objects* CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[toml_output]") From b27612c0f2f4ef566e8cbcb7b3a9be70084dad17 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Tue, 26 Jul 2022 22:43:12 -0700 Subject: [PATCH 2/7] this? --- tests/dm/toml.dme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index 5fff598e..75340524 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -17,5 +17,5 @@ var/test_json = @{" var/toml_output = rustg_read_toml_file("test.toml") - if (toml_output != json_decode(test_json)) // We want to compare the decoded *objects* - CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[toml_output]") + if (toml_output ~= json_decode(test_json)) // We want to compare the decoded *objects* + CRASH("test:\n[test_toml]\n \nexpected:\n[json_decode(test_json)]\n \nrustg:\n[toml_output]") From f9e20580d401c11996ea1be499d1050689016365 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Tue, 26 Jul 2022 22:53:37 -0700 Subject: [PATCH 3/7] tired --- tests/dm/toml.dme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index 75340524..7d53c2f4 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -17,5 +17,5 @@ var/test_json = @{" var/toml_output = rustg_read_toml_file("test.toml") - if (toml_output ~= json_decode(test_json)) // We want to compare the decoded *objects* - CRASH("test:\n[test_toml]\n \nexpected:\n[json_decode(test_json)]\n \nrustg:\n[toml_output]") + if (json_decode(toml_output) ~= json_decode(test_json)) // We want to compare the decoded *objects* + CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[toml_output]") From 9f8485470d600743e9d024780e85bc5e980898f6 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Sat, 30 Jul 2022 23:32:35 -0700 Subject: [PATCH 4/7] this --- tests/dm/toml.dme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index 7d53c2f4..329acf2a 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -17,5 +17,5 @@ var/test_json = @{" var/toml_output = rustg_read_toml_file("test.toml") - if (json_decode(toml_output) ~= json_decode(test_json)) // We want to compare the decoded *objects* - CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[toml_output]") + if (toml_output ~= json_decode(test_json)) // We want to compare the decoded *objects* + CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[json_encode(toml_output)]") From a40c954ebbeeda3fba5cb6ad768a33aaf5a4dce8 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Sat, 30 Jul 2022 23:37:16 -0700 Subject: [PATCH 5/7] byond pls --- tests/dm/toml.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index 329acf2a..6d405c65 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -9,7 +9,7 @@ temp_targets = { cpu = 79, case = 72 } "} var/test_json = @{" -{"database":{"data":[["delta","phi"]],"enabled":true,"ports":[8000,25565],"temp_targets":{"case":72,"cpu":79}}} +{"database":{"data":[["delta","phi"]],"enabled":1,"ports":[8000,25565],"temp_targets":{"case":72,"cpu":79}}} "} /test/proc/check_toml_file2json() From c7e38051f6e9450f1c375fcd682a302680411180 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Sat, 30 Jul 2022 23:43:09 -0700 Subject: [PATCH 6/7] bleh strings it is --- tests/dm/toml.dme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index 6d405c65..d8a3c54f 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -9,7 +9,7 @@ temp_targets = { cpu = 79, case = 72 } "} var/test_json = @{" -{"database":{"data":[["delta","phi"]],"enabled":1,"ports":[8000,25565],"temp_targets":{"case":72,"cpu":79}}} +{"database":{"data":[["delta","phi"]],"enabled":true,"ports":[8000,25565],"temp_targets":{"case":72,"cpu":79}}} "} /test/proc/check_toml_file2json() @@ -17,5 +17,5 @@ var/test_json = @{" var/toml_output = rustg_read_toml_file("test.toml") - if (toml_output ~= json_decode(test_json)) // We want to compare the decoded *objects* + if (json_encode(toml_output) ~= json_encode(json_decode(test_json))) // Double-encode so true becomes 1 CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[json_encode(toml_output)]") From caaeff8cbb143a7ea1215fc15b2e9dfe49997df7 Mon Sep 17 00:00:00 2001 From: ZeWaka Date: Sat, 30 Jul 2022 23:48:17 -0700 Subject: [PATCH 7/7] lol i've been doing it backwards --- tests/dm/toml.dme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dm/toml.dme b/tests/dm/toml.dme index d8a3c54f..0125be98 100644 --- a/tests/dm/toml.dme +++ b/tests/dm/toml.dme @@ -17,5 +17,5 @@ var/test_json = @{" var/toml_output = rustg_read_toml_file("test.toml") - if (json_encode(toml_output) ~= json_encode(json_decode(test_json))) // Double-encode so true becomes 1 + if (toml_output ~! json_decode(test_json)) CRASH("test:\n[test_toml]\n \nexpected:\n[test_json]\n \nrustg:\n[json_encode(toml_output)]")