Browse Source

fix: test compile error

Akeit0 6 months ago
parent
commit
8a6a083d57
1 changed files with 2 additions and 3 deletions
  1. 2 3
      tests/Lua.Tests/AbstractFileTests.cs

+ 2 - 3
tests/Lua.Tests/AbstractFileTests.cs

@@ -8,16 +8,15 @@ public class AbstractFileTests
 {
 {
     class ReadOnlyFileSystem(Dictionary<string, string> dictionary) : NotImplementedExceptionFileSystemBase
     class ReadOnlyFileSystem(Dictionary<string, string> dictionary) : NotImplementedExceptionFileSystemBase
     {
     {
-        public override ILuaIOStream? Open(string path, LuaFileOpenMode mode, bool throwError)
+        public override ILuaIOStream Open(string path, LuaFileOpenMode mode)
         {
         {
             if (!dictionary.TryGetValue(path, out var value))
             if (!dictionary.TryGetValue(path, out var value))
             {
             {
-                if (!throwError) return null;
                 throw new FileNotFoundException($"File {path} not found");
                 throw new FileNotFoundException($"File {path} not found");
             }
             }
 
 
             if (mode != LuaFileOpenMode.Read)
             if (mode != LuaFileOpenMode.Read)
-                throw new NotSupportedException($"File {path} not opened in read mode");
+                throw new IOException($"File {path} not opened in read mode");
             return new ReadOnlyCharMemoryLuaIOStream(value.AsMemory());
             return new ReadOnlyCharMemoryLuaIOStream(value.AsMemory());
         }
         }
     }
     }