diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-10-24 15:06:15 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-10-24 15:07:25 -0700 |
commit | 56356de8793d0b2a9a2260401b70dc05fd2be982 (patch) | |
tree | e5bae22c8f477860bf31a91e7a496054f2d7cbf8 | |
parent | ae9db5a45f5e6bbee363fb0cd0a75a904d913b7b (diff) | |
download | mu-56356de8793d0b2a9a2260401b70dc05fd2be982.tar.gz |
3588 - documentation for filesystem and network
-rw-r--r-- | Readme.md | 8 | ||||
-rw-r--r-- | html/fake-filesystem.png | bin | 21909 -> 0 bytes | |||
-rw-r--r-- | html/resources.mu | 18 | ||||
-rw-r--r-- | html/resources.png | bin | 0 -> 21555 bytes | |||
-rw-r--r-- | index.html | 27 |
5 files changed, 43 insertions, 10 deletions
diff --git a/Readme.md b/Readme.md index 2af72102..51eb9c1a 100644 --- a/Readme.md +++ b/Readme.md @@ -216,12 +216,12 @@ Similarly you can fake the keyboard to pretend someone typed something: <img alt='fake console (keyboard, mouse, ..)' src='html/fake-console.png'> -A fake file-system can map arbitrary paths to contents: +Within tests you can map arbitrary paths (local files or URLs) to contents: -<img alt='fake file-system' src='html/fake-filesystem.png'> +<img alt='fake file-system and network' src='html/resources.png'> -As we add network support, graphics, audio, and so on, we'll augment scenarios -with corresponding abilities. +As we add graphics, audio, and so on, we'll augment scenarios with +corresponding abilities. --- diff --git a/html/fake-filesystem.png b/html/fake-filesystem.png deleted file mode 100644 index b088265b..00000000 --- a/html/fake-filesystem.png +++ /dev/null Binary files differdiff --git a/html/resources.mu b/html/resources.mu new file mode 100644 index 00000000..79bb999f --- /dev/null +++ b/html/resources.mu @@ -0,0 +1,18 @@ + + + + + assume-resources [ + # contents for a local file + [/foo/bar] <- [ + |def| # lines delimited by '|' + ] + + # contents for a URL + [example.com/foo/bar] <- [ + |abc| + ] + ] + + + diff --git a/html/resources.png b/html/resources.png new file mode 100644 index 00000000..4222c5d0 --- /dev/null +++ b/html/resources.png Binary files differdiff --git a/index.html b/index.html index 2d178504..1d9dd349 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,6 @@ syntax, using the special labels '{' and '}'. <li><a href='html/tangle.mu.html'>tangle.mu</a>: another (contrived) version of factorial showing Mu's ability to 'tangle' code from multiple places into a single function or <em>recipe</em>. -<li><a href='html/counters.mu.html'>counters.mu</a>: lexical scope <li>simple examples showing off support for concurrency: <a href='html/fork.mu.html'>fork.mu</a>, <a href='html/channel.mu.html'>channel.mu</a> <li>simple examples showing off hardware control: <a href='html/display.mu.html'>display.mu</a>, @@ -40,9 +39,13 @@ for testing. <li><a href='html/filesystem.mu.html'>filesystem.mu</a>: example program showing file primitives that inject a 'filesystem' dependency which can be faked for testing. +<li><a href='html/http-client.mu.html'>http-client.mu</a> and <a href='html/http-server.mu.html'>http-server.mu</a>, +examples of Mu's testable high-level interfaces to the network. <li><a href='html/static-dispatch.mu.html'>static-dispatch.mu</a>: example -program showing mu's ability to define recipes with headers, and allow -recipes with the same name but different headers to coexist. +program showing mu's ability to define recipes with headers, and thereby to +allow functions with the same name but arguments of different types to +coexist. +<li><a href='html/counters.mu.html'>counters.mu</a>: lexical scope <li><a href='html/chessboard.mu.html'>chessboard.mu</a>: a little program for 2 people to play chess, with thorough tests of its behavior including both screen and keyboard handling. @@ -230,8 +233,8 @@ generator with a <a href='html/068random.mu.html'>testable</a> interface. <p><b>Part V</b>: Primitives for interfacing with hardware. -<p/><a href='html/080display.cc.html'>080display.cc</a>: primitives for using -the keyboard and screen. +<p/><a href='html/080display.cc.html'>080display.cc</a>: primitives for +accessing the keyboard and screen. <br/><a href='html/081print.mu.html'>081print.mu</a>: helpers that can swap the real screen with fake ones for testing. <br/><a href='html/082scenario_screen.cc.html'>082scenario_screen.cc</a>: @@ -242,8 +245,20 @@ swap the real keyboard and mouse with fake ones for testing. <br/><a href='html/085scenario_console.cc.html'>085scenario_console.cc</a>: writing tests for keyboard and mouse using the fakes. (<a href='html/086scenario_console_test.mu.html'>examples</a>) +<br/><a href='html/087file.cc.html'>087file.cc</a>: primitives for accessing +the file system. +<br/><a href='html/088file.mu.html'>088file.mu</a>: helpers that permit +swapping a fake filesystem or <tt>resources</tt> object for testing. +<br/><a href='html/089scenario_filesystem.cc.html'>089scenario_filesystem.cc</a>: +writing tests for filesystem using the fakes. +(<a href='html/090scenario_filesystem_test.mu.html'>examples</a>) +<br/><a href='html/091socket.cc.html'>091socket.cc</a>: primitives for +accessing the network. +<br/><a href='html/092socket.mu.html'>092socket.mu</a>: helpers for the +network. In Mu you create a fake network ‘neighborhood’ the same +way you create a fake local file system. -<br/><a href='html/029tools.cc.html'>029tools.cc</a>: various primitive +<p/><a href='html/029tools.cc.html'>029tools.cc</a>: various primitive operations to help with testing and debugging. <br/><a href='html/100trace_browser.cc.html'>100trace_browser.cc</a>: a zoomable UI for inspecting traces generated by Mu programs. Allows both |