this repo has no description
www.jonmsterling.com/01HC/
1// SPDX-FileCopyrightText: 2025 The Project Pterodactyl Developers
2//
3// SPDX-License-Identifier: MPL-2.0
4
5import Testing
6
7@testable import PterodactylKernel
8
9struct QuotationTests {
10 @Test func quotingNeutrals() async throws {
11 let analysis = LocalAnalysis()
12 let recordType1 = Term.Type_.recordType(boundName: nil, fields: FieldDict([("foo", Term.FieldSpec(type: .universeType, manifest: nil))]))
13 let recordType2 = Term.Type_.recordType(boundName: nil, fields: FieldDict([("bar", Term.FieldSpec(type: recordType1, manifest: nil))]))
14 let recordTypeValue = Evaluator().evaluate(type: recordType2)
15 let base = Value.Neutral(head: .global(name: "X"), spine: [], boundary: AsyncThunk { Value.Boundary(type: recordTypeValue, value: nil) })
16 let bar = base.plug(frame: .proj(fieldName: "bar"))
17 let foo = bar.plug(frame: .proj(fieldName: "foo"))
18 let term = analysis.quote(neutral: foo)
19 let result =
20 switch term {
21 case .cut(term: .cut(term: .global(name: "X"), frame: .proj(fieldName: "bar")), frame: .proj(fieldName: "foo")): true
22 default: false
23 }
24 #expect(result, "Neutral incorrectly quoted as: \(term)")
25 }
26}