YREA-SLS/SLS_Tests/cases.yaml

258 lines
4.7 KiB
YAML

# Kyler Olsen
# SLS Test Cases
# November 2025
# Could you now help me by creating test cases. Just start by naming any new categories I should have, then I will ask you to name new tests. Token strings should have their tokens listed with in their data
# - name: Test Name
# code: "Test Code"
# # Lexed tokens or lexer error
# tokens:
# - type: Token Type
# value: Token Value
# lexer_error:
# message: Error message.
# # Parsed operations or parsing error (if no lexer error)
# operations:
# - function: Operation Name
# parsing_error:
# message: Error message.
# # Final stack state and/or runtime error (if no lexer or parsing error)
# stack_final:
# - type: Stack Item Type
# value: Stack Item Value
# runtime_error:
# message: Error message.
- name: Empty_Statement
code: ""
tokens: []
operations: []
stack_final: []
# Basic Identifiers
- name: Identifier Hello
code: "Hello"
tokens:
- type: identifier
value: Hello
operations:
- function: Hello
runtime_error:
message: Function "Hello" not found.
- name: Identifier Plus
code: "+"
tokens:
- type: identifier
value: "+"
operations:
- function: "+"
runtime_error:
message: Function "+" requires 2 "Addable" on the stack.
- name: Identifier Rotate
code: "rot"
tokens:
- type: identifier
value: rot
operations:
- function: rot
runtime_error:
message: Function "rot" requires 3 "Stackable" on the stack.
- name: Identifier Swap and Duplicate
code: "swap dup"
tokens:
- type: identifier
value: swap
- type: identifier
value: dup
operations:
- function: swap
- function: dup
runtime_error:
message: Function "swap" requires 2 "Stackable" on the stack.
- name: Identifier Depth
code: "depth"
tokens:
- type: identifier
value: depth
operations:
- function: depth
stack_final:
- type: i64
value: 0
# Basic Identifier Literals
- name: Identifier Literal Point
code: "::Point"
tokens:
- type: identifier_literal
value: Point
operations:
- function: push
type: identifier_literal
value: Point
stack_final:
- type: identifier_literal
value: Point
- name: Identifier Literal Multiply
code: "::*"
tokens:
- type: identifier_literal
value: "*"
operations:
- function: push
type: identifier_literal
value: "*"
stack_final:
- type: identifier_literal
value: "*"
- name: Identifier Literal Name
code: "::name"
tokens:
- type: identifier_literal
value: name
operations:
- function: push
type: identifier_literal
value: name
stack_final:
- type: identifier_literal
value: name
# Basic Integers
- name: Integer Default Decimal 15
code: "15"
tokens:
- type: i64
value: 15
operations:
- function: push
type: i64
value: 15
stack_final:
- type: i64
value: 15
- name: Integer Default Hex E1
code: "0xE1"
tokens:
- type: i64
value: 225
operations:
- function: push
type: i64
value: 225
stack_final:
- type: i64
value: 225
- name: Integer Default Hex b2
code: "0xb2"
tokens:
- type: i64
value: 178
operations:
- function: push
type: i64
value: 178
stack_final:
- type: i64
value: 178
- name: Integer Default Binary 1010
code: "0b1010"
tokens:
- type: i64
value: 10
operations:
- function: push
type: i64
value: 10
stack_final:
- type: i64
value: 10
- name: Integer Default Decimal 2,001,650
code: "2_001_650"
tokens:
- type: i64
value: 2001650
operations:
- function: push
type: i64
value: 2001650
stack_final:
- type: i64
value: 2001650
# - name: Integer i64 Decimal 5
# - name: Integer i64 Hex 5f
# - name: Integer i64 Binary 10110
# Basic Floats
# Basic Strings
# Basic Booleans
# Basic Arrays
# Basic Token Strings
# Stack Operations
# Arithmetic Operations
# Comparison Operations
# Logical Operations
# Bitwise Operations
# Function Definitions
# Lambda Functions
# Conditional Statements
# While Loops
# For Loops
# Match Statements
# Structs
# Unions
# Enums
# Array Operations
# Array Combinators
# Array Arithmetic
# Array Manipulation
# Type Inference
# Type Tuples
# Trait Definition
# Trait Implementation
# Trait Inheritance
# Stackable Trait
# Addable Trait
# Multiplyable Trait
# Exponentiable Trait
# Logarithmic Trait
# Number Trait
# Orderable Trait
# Equatable Trait
# Comparable Trait
# Logical Trait
# Bitwise Trait
# Sized Trait
# Selectable<T> Trait
# Sliceable Trait
# Concatenable Trait
# ArrayOf<T> Trait
# Iterable<T> Trait
# Convertible Trait
# Stringifiable Trait
# Parseable Trait
# String Trait
# Size Trait
# Identifier Trait
# Implementable Trait
# Generics
# Eval
# Std Lib IO
# Std Lib Strings
# Std Lib Type conversions