mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-03 20:38:13 +03:00
@@ -95,9 +95,19 @@ void test_strings(void)
|
||||
test_bool("(4.222).String(2)", (f = 4.222, f.String(2) == "4.22"), true);
|
||||
// C_REF
|
||||
test_equal("abあいう[3]", (s = "abあいう", s[3]), 'い');
|
||||
test_equal("abc[3]", (s = "abc", s[3]), 0);
|
||||
test_equal("abあいう[5]", (s = "abあいう", s[5]), 0);
|
||||
test_equal("abあいう[8]", (s = "abあいう", s[8]), 0);
|
||||
// This throws
|
||||
// test_equal("abあいう[9]", (s = "abあいう", s[9]), 0);
|
||||
|
||||
// C_ASSIGN
|
||||
test_string("abあいう[1] = 'c'", (s = "abあいう", s[1] = 'c', s), "acあいう");
|
||||
test_string("abあいう[3] = 'あ'", (s = "abあいう", s[3] = 'あ', s), "abああう");
|
||||
test_string("abあいう[1] = 'あ'", (s = "abあいう", s[1] = 'あ', s), "aああいう");
|
||||
test_string("abあいう[3] = 'c'", (s = "abあいう", s[3] = 'c', s), "abあcう");
|
||||
test_string("abあいう[5] = 'c'", (s = "abあいう", s[5] = 'c', s), "abあいう");
|
||||
test_string("abあいう[7] = 'c'", (s = "abあいう", s[7] = 'c', s), "abあいう");
|
||||
// This throws
|
||||
// test_string("abあいう[8] = 'c'", (s = "abあいう", s[8] = 'c', s), "abあいう");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user