🎉 FileBox v2 plugin system fully working with TLV encoding fix
Major achievements: - Fixed TLV encoding format to match plugin expectations - Header: version(2 bytes) + argc(2 bytes) - Entry: tag(1) + reserved(1) + size(2) + data - Removed duplicate implementation in method_dispatch.rs - All FileBox methods working: open/read/write/close - Successfully tested file I/O operations This completes the v2 plugin system integration for FileBox. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
9
local_tests/test_filebox_debug.nyash
Normal file
9
local_tests/test_filebox_debug.nyash
Normal file
@ -0,0 +1,9 @@
|
||||
// Debug test for FileBox type checking
|
||||
local file
|
||||
file = new FileBox()
|
||||
print("Created FileBox")
|
||||
|
||||
// Try method call
|
||||
local result
|
||||
result = file.open("test.txt", "w")
|
||||
print("Open result: " + result)
|
||||
36
local_tests/test_filebox_full.nyash
Normal file
36
local_tests/test_filebox_full.nyash
Normal file
@ -0,0 +1,36 @@
|
||||
// Complete FileBox test
|
||||
local file
|
||||
file = new FileBox()
|
||||
print("Created FileBox")
|
||||
|
||||
// Open file for writing
|
||||
local openResult
|
||||
openResult = file.open("test_output.txt", "w")
|
||||
print("Open result: " + openResult)
|
||||
|
||||
// Write some data
|
||||
local writeResult
|
||||
writeResult = file.write("Hello from Nyash!\n")
|
||||
print("Write result: " + writeResult)
|
||||
|
||||
// Write more data
|
||||
writeResult = file.write("FileBox is working! 🎉\n")
|
||||
print("Write result 2: " + writeResult)
|
||||
|
||||
// Close the file
|
||||
local closeResult
|
||||
closeResult = file.close()
|
||||
print("Close result: " + closeResult)
|
||||
|
||||
// Open for reading
|
||||
openResult = file.open("test_output.txt", "r")
|
||||
print("Open for read result: " + openResult)
|
||||
|
||||
// Read the content
|
||||
local content
|
||||
content = file.read()
|
||||
print("Read content: " + content)
|
||||
|
||||
// Close again
|
||||
closeResult = file.close()
|
||||
print("Final close result: " + closeResult)
|
||||
Reference in New Issue
Block a user