Array Test Specifications

Conformance Level: Level 2-3 for full array support.

Overview

Comprehensive testing of array functionality including parsing, serialization, and validation.

Test Cases

ARRAY_001: Empty Array

Input: {items = []}

Expected:

  • Property "items": Type=Array
  • Count = 0
  • IsEmpty = true

ARRAY_002: Homogeneous Arrays

Test Cases:

  • Numbers: [1, 2, 3, 4, 5]
  • Strings: ["apple", "banana", "cherry"]
  • Booleans: [true, false, true]

Validation: All elements have same type

ARRAY_003: Mixed Type Arrays

Input: [1, "hello", true, null, 3.14]

Expected Types:

  • Element[0]: Integer
  • Element[1]: String
  • Element[2]: Boolean
  • Element[3]: Null
  • Element[4]: Float

ARRAY_004: Nested Arrays

Input: [[1, 2], [3, 4], [5, 6]]

Structure:

  • Outer array count = 3
  • Each inner array count = 2
  • Access: array[0][0] = 1, array[1][1] = 4

ARRAY_005: Arrays with Objects

Input:

[
    {name = "Alice", age = 30},
    {name = "Bob", age = 25}
]

Expected: Array of objects, each with properties

ARRAY_006: Trailing Comma Error

Input: [1, 2, 3,]

Expected: Parse error - "Trailing comma not allowed in arrays"