fixed caller_location test for windows
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 3 Dec 2021 21:40:02 +0000 (15:40 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Fri, 3 Dec 2021 21:40:02 +0000 (15:40 -0600)
tests/caller_location.onyx

index 9e4a07375923d7b668e608259aca4d3d835bef9b..ec628d098976f72624b3c13f0dec8942342f734c 100644 (file)
@@ -4,7 +4,7 @@ use package core
 
 using_callsite :: (value: $T, site := #callsite) {
     println(value);
-    path := string.split(site.file, #char "/");
+    path := string.split(site.file, ~~(#char "\\" if runtime.OS == runtime.OS_Windows else #char "/"));
     printf("I was called from {}:{}:{}\n", path[path.count - 1], site.line, site.column);
 }
 
@@ -23,4 +23,6 @@ Something :: struct {
     method :: (use s: ^Something) {
         using_callsite(member);
     }
-}
\ No newline at end of file
+}
+
+#local runtime :: package runtime