about summary refs log tree commit diff stats
path: root/shell
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-05-03 18:16:15 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-05-03 18:16:15 -0700
commita08658f218b2674d56fec3c01ead62671d36e5c8 (patch)
treeaafdad0b778027433f7676c272f6c98d0093fa66 /shell
parent1048729a6e516f1a5a106e61deddecca935d2098 (diff)
downloadmu-a08658f218b2674d56fec3c01ead62671d36e5c8.tar.gz
.
Diffstat (limited to 'shell')
-rw-r--r--shell/evaluate.mu21
1 files changed, 21 insertions, 0 deletions
diff --git a/shell/evaluate.mu b/shell/evaluate.mu
index 02203e0f..d4f13407 100644
--- a/shell/evaluate.mu
+++ b/shell/evaluate.mu
@@ -1179,6 +1179,27 @@ fn test-evaluate-symbol {
   check-ints-equal result-value, 3, "F - test-evaluate-symbol/1"
 }
 
+fn test-evaluate-quote {
+  # env = nil
+  var nil-storage: (handle cell)
+  var nil-ah/ecx: (addr handle cell) <- address nil-storage
+  allocate-pair nil-ah
+  # eval `a, env
+  var tmp-storage: (handle cell)
+  var tmp-ah/edx: (addr handle cell) <- address tmp-storage
+  new-symbol tmp-ah, "'"
+  var tmp2-storage: (handle cell)
+  var tmp2-ah/ebx: (addr handle cell) <- address tmp2-storage
+  new-symbol tmp2-ah, "a"
+  new-pair tmp-ah, *tmp-ah, *tmp2-ah
+  evaluate tmp-ah, tmp-ah, *nil-ah, 0/no-globals, 0/no-trace, 0/no-screen, 0/no-keyboard, 0/call-number
+  var result/eax: (addr cell) <- lookup *tmp-ah
+  var result-type/edx: (addr int) <- get result, type
+  check-ints-equal *result-type, 2/symbol, "F - test-evaluate-quote/0"
+  var sym?/eax: boolean <- symbol-equal? result, "a"
+  check sym?, "F - test-evaluate-quote/1"
+}
+
 fn test-evaluate-primitive-function {
   var globals-storage: global-table
   var globals/edi: (addr global-table) <- address globals-storage