Browse Source

improve test log for LuaTests

Akeit0 6 months ago
parent
commit
92ba39a603
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tests/Lua.Tests/LuaTests.cs

+ 2 - 2
tests/Lua.Tests/LuaTests.cs

@@ -31,9 +31,10 @@ public class LuaTests
         var state = LuaState.Create();
         state.OpenStandardLibraries();
         var path = FileHelper.GetAbsolutePath(file);
+        Directory.SetCurrentDirectory(Path.GetDirectoryName(path)!);
         try
         {
-            await state.DoFileAsync(path);
+            await state.DoFileAsync(Path.GetFileName(file));
         }
         catch (LuaRuntimeException e)
         {
@@ -45,7 +46,6 @@ public class LuaTests
 
             var line = luaTraceback.LastLine;
             throw new Exception($"{path}:line {line}\n{e.InnerException}\n {e}");
-
         }
     }
 }