Files
hakorune/local_tests/kilo_simple_test.nyash
Moe Charm ef7a0de3b0 feat: Prepare for code modularization and cleanup
- Archive old documentation and test files to `docs/archive/` and `local_tests/`.
- Remove various temporary and old files from the project root.
- Add `nekocode-rust` analysis tool and its output files (`nekocode/`, `.nekocode_sessions/`, `analysis.json`).
- Minor updates to `apps/chip8_nyash/chip8_emulator.nyash` and `local_tests` files.

This commit cleans up the repository and sets the stage for further code modularization efforts, particularly in the `src/interpreter` and `src/parser` modules, based on recent analysis.
2025-08-16 01:30:39 +09:00

79 lines
1.4 KiB
Plaintext

// Simple Kilo Editor Test - Step by step validation
// Test basic Box operations before full editor
local s1
local s2
local s3
local result
print("=== StringBox Methods Test ===")
// Test basic StringBox operations
s1 = "" // Create empty string instead of new StringBox()
print("Created empty StringBox")
s2 = "Hello"
print("String length test:")
result = s2.length()
print(result)
print("String substring test:")
result = s2.substring(1, 4)
print(result)
print("String concat test:")
s3 = " World"
result = s2.concat(s3)
print(result)
print("=== ArrayBox Methods Test ===")
local arr
local item
local len
arr = new ArrayBox()
print("Created empty ArrayBox")
len = arr.length()
print("Array length:")
print(len)
print("=== Basic Editor Component Test ===")
// Test a simple editor component without full complexity
box SimpleEditor {
init { text, cursor }
init_empty() {
me.text = ""
me.cursor = 0
}
append_char(ch) {
me.text = me.text.concat(ch)
me.cursor = me.cursor + 1
}
get_text() {
return me.text
}
get_cursor() {
return me.cursor
}
}
local editor
editor = new SimpleEditor()
editor.init_empty()
print("Testing simple editor:")
editor.append_char("H")
editor.append_char("i")
print("Editor text:")
print(editor.get_text())
print("Editor cursor:")
print(editor.get_cursor())