about summary refs log tree commit diff stats
path: root/subx/apps/crenshaw2-1b
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-05-25 00:43:19 -0700
committerKartik Agaram <vc@akkartik.com>2019-05-25 00:43:19 -0700
commit6c03f2edab211d90405187eafa9a0243bbd64c39 (patch)
tree91d39f253b3ff5b1c080f3591ec448d9be32e3b0 /subx/apps/crenshaw2-1b
parent0b2d2d97284c41ad095e9dbbe6657b857af1c7b9 (diff)
downloadmu-6c03f2edab211d90405187eafa9a0243bbd64c39.tar.gz
new primitive: array-equal?
Diffstat (limited to 'subx/apps/crenshaw2-1b')
-rwxr-xr-xsubx/apps/crenshaw2-1bbin20374 -> 20960 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/subx/apps/crenshaw2-1b b/subx/apps/crenshaw2-1b
index b93d10c2..b68d9d44 100755
--- a/subx/apps/crenshaw2-1b
+++ b/subx/apps/crenshaw2-1b
Binary files differ
d88d9558c0445119d8cbae55e8b73937778a4'>2d3d88d9 ^
d5c86dfd ^
2d3d88d9 ^
0893d65e ^
6641b247 ^
9ed95def ^
6641b247 ^



0893d65e ^
80df524b ^
6641b247 ^




d5c86dfd ^


















6641b247 ^

0893d65e ^
6641b247 ^
2d3d88d9 ^
9ed95def ^
2d3d88d9 ^



0893d65e ^
80df524b ^
2d3d88d9 ^




0230a6cc ^

0893d65e ^
0230a6cc ^




9ed95def ^
0230a6cc ^



0893d65e ^
80df524b ^
0893d65e ^
80df524b ^
0230a6cc ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99



                                                       
                    



            
                                                        



                             
                                







                         
 
                                 
             
                    
   
                                                                      



                           
                                                 
                                               




                                                                     


















                                                                      

                                         
                    
             
   
                                                                      



                           
                                                 
                                               




                                                                     

                                                       
                    




             
                                                                      



                           
                                                 
                                               
                                                  
                                                





                                                                     
# Check our support for fake file systems in scenarios.

scenario read-from-fake-file [
  local-scope
  assume-resources [
    [a] <- [
      |xyz|
    ]
  ]
  contents:&:source:char <- start-reading resources, [a]
  1:char/raw <- read contents
  2:char/raw <- read contents
  3:char/raw <- read contents
  4:char/raw <- read contents
  _, 5:bool/raw <- read contents
  memory-should-contain [
    1 <- 120  # x
    2 <- 121  # y
    3 <- 122  # z
    4 <- 10  # newline
    5 <- 1  # eof
  ]
]

scenario write-to-new-fake-file [
  local-scope
  assume-resources [
  ]
  sink:&:sink:char, writer:num/routine <- start-writing resources, [a]
  sink <- write sink, 120/x
  sink <- write sink, 121/y
  close sink
  wait-for-routine writer
  contents-read-back:text <- slurp resources, [a]
  10:bool/raw <- equal contents-read-back, [xy]
  memory-should-contain [
    10 <- 1  # file contents read back exactly match what was written
  ]
]

scenario write-to-new-fake-file-2 [
  local-scope
  assume-resources [
    [a] <- [
      |abc|
    ]
  ]
  sink:&:sink:char, writer:num/routine <- start-writing resources, [b]
  sink <- write sink, 120/x
  sink <- write sink, 121/y
  close sink
  wait-for-routine writer
  contents-read-back:text <- slurp resources, [b]
  10:bool/raw <- equal contents-read-back, [xy]
  memory-should-contain [
    10 <- 1  # file contents read back exactly match what was written
  ]
]

scenario write-to-fake-file-that-exists [
  local-scope
  assume-resources [
    [a] <- []
  ]
  sink:&:sink:char, writer:num/routine <- start-writing resources, [a]
  sink <- write sink, 120/x
  sink <- write sink, 121/y
  close sink
  wait-for-routine writer
  contents-read-back:text <- slurp resources, [a]
  10:bool/raw <- equal contents-read-back, [xy]
  memory-should-contain [
    10 <- 1  # file contents read back exactly match what was written
  ]
]

scenario write-to-existing-file-preserves-other-files [
  local-scope
  assume-resources [
    [a] <- []
    [b] <- [
      |bcd|
    ]
  ]
  sink:&:sink:char, writer:num/routine <- start-writing resources, [a]
  sink <- write sink, 120/x
  sink <- write sink, 121/y
  close sink
  wait-for-routine writer
  contents-read-back:text <- slurp resources, [a]
  10:bool/raw <- equal contents-read-back, [xy]
  other-file-contents:text <- slurp resources, [b]
  11:bool/raw <- equal other-file-contents, [bcd
]
  memory-should-contain [
    10 <- 1  # file contents read back exactly match what was written
    11 <- 1  # other files also continue to persist unchanged
  ]
]