58 lines
1.4 KiB
EmacsLisp
58 lines
1.4 KiB
EmacsLisp
// Engram language — example test file
|
|
// Run with: el test-file examples/hello-project/src/tests.el
|
|
|
|
test "basic arithmetic" {
|
|
let x: Int = 6
|
|
let y: Int = 7
|
|
let result: Int = x * y
|
|
assert result == 42
|
|
}
|
|
|
|
test "string operations" {
|
|
let greeting: String = "Hello"
|
|
let name: String = "Engram"
|
|
let full: String = greeting + ", " + name
|
|
assert full == "Hello, Engram"
|
|
}
|
|
|
|
test "type graph has Point type" {
|
|
seed Node {
|
|
type: "Point"
|
|
content: "A 2D coordinate"
|
|
importance: 0.8
|
|
tier: Semantic
|
|
}
|
|
|
|
let results = activate Point where "coordinate"
|
|
assert results.len() > 0
|
|
}
|
|
|
|
test "empty graph" {
|
|
let results = activate Customer where "anything"
|
|
assert results.len() == 0
|
|
}
|
|
|
|
test "empty graph returns insufficient" {
|
|
let result = reason("Is there a customer named Will?")
|
|
assert result.verdict == "Insufficient"
|
|
}
|
|
|
|
test "seeded graph reasoning" {
|
|
seed Node {
|
|
type: "Customer"
|
|
content: "Will Anderson, founding member"
|
|
importance: 0.9
|
|
tier: Semantic
|
|
}
|
|
|
|
let result = reason("founding member")
|
|
assert result.verdict == "Supported"
|
|
}
|
|
|
|
test "production customer lookup" target: e2e {
|
|
// No seeds — uses the real Engram database
|
|
// (skipped when ENGRAM_URL is not set)
|
|
let results = activate Customer where "founding member"
|
|
assert results.len() > 0
|
|
}
|