diff options
Diffstat (limited to 'html/090scenario_filesystem_test.mu.html')
-rw-r--r-- | html/090scenario_filesystem_test.mu.html | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/html/090scenario_filesystem_test.mu.html b/html/090scenario_filesystem_test.mu.html index 361b71c2..4bb717c3 100644 --- a/html/090scenario_filesystem_test.mu.html +++ b/html/090scenario_filesystem_test.mu.html @@ -35,12 +35,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> read-from-fake-file [ <span class="Constant">local-scope</span> - assume-filesystem [ + assume-resources [ <span class="Constant">[a]</span><span class="Special"> <- </span>[ <span class="Constant"> |xyz|</span> ] ] - contents:&:source:char<span class="Special"> <- </span>start-reading filesystem:&:filesystem, <span class="Constant">[a]</span> + contents:&:source:char<span class="Special"> <- </span>start-reading resources, <span class="Constant">[a]</span> <span class="Constant">1</span>:char/<span class="Special">raw <- </span>read contents <span class="Constant">2</span>:char/<span class="Special">raw <- </span>read contents <span class="Constant">3</span>:char/<span class="Special">raw <- </span>read contents @@ -57,14 +57,14 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> write-to-fake-file [ <span class="Constant">local-scope</span> - assume-filesystem [ + assume-resources [ ] - sink:&:sink:char, writer:num/routine<span class="Special"> <- </span>start-writing filesystem:&:filesystem, <span class="Constant">[a]</span> + sink:&:sink:char, writer:num/routine<span class="Special"> <- </span>start-writing resources, <span class="Constant">[a]</span> sink<span class="Special"> <- </span>write sink, <span class="Constant">120/x</span> sink<span class="Special"> <- </span>write sink, <span class="Constant">121/y</span> close sink wait-for-routine writer - contents-read-back:text<span class="Special"> <- </span>slurp filesystem, <span class="Constant">[a]</span> + contents-read-back:text<span class="Special"> <- </span>slurp resources, <span class="Constant">[a]</span> <span class="Constant">10</span>:bool/<span class="Special">raw <- </span>equal contents-read-back, <span class="Constant">[xy]</span> memory-should-contain [ <span class="Constant">10</span><span class="Special"> <- </span><span class="Constant">1</span> <span class="Comment"># file contents read back exactly match what was written</span> @@ -73,15 +73,15 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> write-to-fake-file-that-exists [ <span class="Constant">local-scope</span> - assume-filesystem [ + assume-resources [ <span class="Constant">[a]</span><span class="Special"> <- </span><span class="Constant">[]</span> ] - sink:&:sink:char, writer:num/routine<span class="Special"> <- </span>start-writing filesystem:&:filesystem, <span class="Constant">[a]</span> + sink:&:sink:char, writer:num/routine<span class="Special"> <- </span>start-writing resources, <span class="Constant">[a]</span> sink<span class="Special"> <- </span>write sink, <span class="Constant">120/x</span> sink<span class="Special"> <- </span>write sink, <span class="Constant">121/y</span> close sink wait-for-routine writer - contents-read-back:text<span class="Special"> <- </span>slurp filesystem, <span class="Constant">[a]</span> + contents-read-back:text<span class="Special"> <- </span>slurp resources, <span class="Constant">[a]</span> <span class="Constant">10</span>:bool/<span class="Special">raw <- </span>equal contents-read-back, <span class="Constant">[xy]</span> memory-should-contain [ <span class="Constant">10</span><span class="Special"> <- </span><span class="Constant">1</span> <span class="Comment"># file contents read back exactly match what was written</span> @@ -90,20 +90,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color <span class="muScenario">scenario</span> write-to-existing-file-preserves-other-files [ <span class="Constant">local-scope</span> - assume-filesystem [ + assume-resources [ <span class="Constant">[a]</span><span class="Special"> <- </span><span class="Constant">[]</span> <span class="Constant">[b]</span><span class="Special"> <- </span>[ <span class="Constant"> |bcd|</span> ] ] - sink:&:sink:char, writer:num/routine<span class="Special"> <- </span>start-writing filesystem:&:filesystem, <span class="Constant">[a]</span> + sink:&:sink:char, writer:num/routine<span class="Special"> <- </span>start-writing resources, <span class="Constant">[a]</span> sink<span class="Special"> <- </span>write sink, <span class="Constant">120/x</span> sink<span class="Special"> <- </span>write sink, <span class="Constant">121/y</span> close sink wait-for-routine writer - contents-read-back:text<span class="Special"> <- </span>slurp filesystem, <span class="Constant">[a]</span> + contents-read-back:text<span class="Special"> <- </span>slurp resources, <span class="Constant">[a]</span> <span class="Constant">10</span>:bool/<span class="Special">raw <- </span>equal contents-read-back, <span class="Constant">[xy]</span> - other-file-contents:text<span class="Special"> <- </span>slurp filesystem, <span class="Constant">[b]</span> + other-file-contents:text<span class="Special"> <- </span>slurp resources, <span class="Constant">[b]</span> <span class="Constant">11</span>:bool/<span class="Special">raw <- </span>equal other-file-contents, <span class="Constant">[bcd</span> <span class="Constant">]</span> memory-should-contain [ @@ -112,10 +112,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color ] ] -<span class="muRecipe">def</span> slurp fs:&:filesystem, filename:text<span class="muRecipe"> -> </span>contents:text [ +<span class="muRecipe">def</span> slurp resources:&:resources, filename:text<span class="muRecipe"> -> </span>contents:text [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - source:&:source:char<span class="Special"> <- </span>start-reading fs, filename + source:&:source:char<span class="Special"> <- </span>start-reading resources, filename buf:&:buffer<span class="Special"> <- </span>new-buffer <span class="Constant">30/capacity</span> <span class="Delimiter">{</span> c:char, done?:bool, source<span class="Special"> <- </span>read source |