Files
hakorune/tests/development/test_basic_boxes_comprehensive.nyash

60 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 基本Box機能の網羅的テスト
local console
console = new ConsoleBox()
// === 基本系Box ===
console.log("=== 基本系Box ===")
// StringBox
local str
str = new StringBox("Hello")
console.log("StringBox: " + str.toString())
// IntegerBox
local num
num = new IntegerBox(42)
console.log("IntegerBox: " + num.toString())
// BoolBox
local bool
bool = new BoolBox(true)
console.log("BoolBox: " + bool.toString())
// NullBox
local null
null = new NullBox()
console.log("NullBox: " + null.toString())
// === 新機能Box ===
console.log("=== 新機能Box ===")
// FloatBox新実装
local float
float = new FloatBox(3.14)
console.log("FloatBox: " + float.toString())
// ArrayBox改良版
local arr
arr = new ArrayBox()
arr.push("item1")
arr.push("item2")
console.log("ArrayBox length: " + arr.length())
// === ユーティリティBox ===
console.log("=== ユーティリティBox ===")
// MathBox
local math
math = new MathBox()
console.log("MathBox PI: " + math.pi())
// TimeBox
local time
time = new TimeBox()
console.log("TimeBox: " + time.toString())
// MapBox
local map
map = new MapBox()
map.set("key1", "value1")
console.log("MapBox has key1: " + map.has("key1"))