Browse Source

Update xmake.lua

c8ef 1 year ago
parent
commit
17ee9c7011
1 changed files with 6 additions and 4 deletions
  1. 6 4
      packages/p/pyincpp/xmake.lua

+ 6 - 4
packages/p/pyincpp/xmake.lua

@@ -21,10 +21,12 @@ package("pyincpp")
             #include <cassert>
             using namespace pyincpp;
             void test() {
-                Map<String, List<Integer>> map = {{"first", {123, 456}}, {"second", {789}}, {"second", {0}}, {"third", {"12345678987654321", 5}}};
-                assert(map.size() == 3);
-                assert(map.keys() == Set<String>({"first", "second", "third"}));
-                assert(map["third"][-1].factorial() == 120);
+                Dict<Str, List<Int>> dict = {{"first", {"123", "456"}}, {"second", {"789"}}, {"third", {"12345678987654321", "5"}}};
+                std::ostringstream oss;
+                oss << dict;
+                assert(oss.str() == "{\"first\": [123, 456], \"second\": [789], \"third\": [12345678987654321, 5]}");
+                assert(dict.keys() == Set<Str>{"first", "second", "third"});
+                assert(dict["third"][-1].factorial() == 120);
             }
         ]]}, {configs = {languages = "c++20"}, includes = "pyincpp/pyincpp.hpp"}))
     end)