summary refs log tree commit diff stats
path: root/doc/pydoc/test.html
blob: c5cacffc35e7db92b9955ef1b1378f519f090375 (plain) (blame)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package test</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>test</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/ranger/test/__init__.py">/home/hut/ranger/test/__init__.py</a></font></td></tr></table>
    <p><tt>#&nbsp;Copyright&nbsp;(C)&nbsp;2009,&nbsp;2010&nbsp;&nbsp;Roman&nbsp;Zimbelmann&nbsp;&lt;romanz@lavabit.com&gt;<br>
#<br>
#&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br>
#&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br>
#&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or<br>
#&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.<br>
#<br>
#&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br>
#&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br>
#&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br>
#&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br>
#<br>
#&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License<br>
#&nbsp;along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="test.tc_bookmarks.html">tc_bookmarks</a><br>
<a href="test.tc_colorscheme.html">tc_colorscheme</a><br>
<a href="test.tc_commandlist.html">tc_commandlist</a><br>
</td><td width="25%" valign=top><a href="test.tc_directory.html">tc_directory</a><br>
<a href="test.tc_displayable.html">tc_displayable</a><br>
<a href="test.tc_ext.html">tc_ext</a><br>
</td><td width="25%" valign=top><a href="test.tc_history.html">tc_history</a><br>
<a href="test.tc_keyapi.html">tc_keyapi</a><br>
<a href="test.tc_ui.html">tc_ui</a><br>
</td><td width="25%" valign=top><a href="test.test.html">test</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__all__</strong> = ['tc_keyapi', 'tc_history', 'tc_colorscheme', 'tc_bookmarks', 'tc_ext', 'tc_directory', 'tc_commandlist', 'tc_colorscheme', 'tc_keyapi', 'tc_history', 'tc_commandlist', 'tc_displayable', 'tc_directory', 'tc_ui', 'tc_ui', 'tc_bookmarks', 'tc_ext', 'tc_displayable']</td></tr></table>
</body></html>
an class="nv">check-not tmp, "F - test-stream/full?/0" # step 2: write to stream var x: int copy-to x, 0x34 var x2/edx: (addr int) <- address x write-to-stream s2, x2 tmp <- stream-empty? s2 check-not tmp, "F - test-stream/empty?/1" tmp <- stream-full? s2 check-not tmp, "F - test-stream/full?/1" # step 3: modify the value written (should make no difference) copy-to x, 0 # step 4: read back var y: int var y2/ebx: (addr int) <- address y read-from-stream s2, y2 tmp <- stream-empty? s2 check tmp, "F - test-stream/empty?/2" tmp <- stream-full? s2 check-not tmp, "F - test-stream/full?/2" # we read back what was written check-ints-equal y, 0x34, "F - test-stream" } fn test-stream-full { # write an int to a stream of capacity 1 var s: (stream int 1) var s2/ecx: (addr stream int) <- address s var tmp/eax: boolean <- stream-full? s2 check-not tmp, "F - test-stream-full?/pre" var x: int var x2/edx: (addr int) <- address x write-to-stream s2, x2 tmp <- stream-full? s2 check tmp, "F - test-stream-full?" } fn test-fake-input-buffered-file { var foo: (handle buffered-file) var foo-ah/eax: (addr handle buffered-file) <- address foo populate-buffered-file-containing "abc", foo-ah var foo-addr/eax: (addr buffered-file) <- lookup foo var s: (stream byte 0x100) var result/ecx: (addr stream byte) <- address s read-line-buffered foo-addr, result check-stream-equal result, "abc", "F - test-fake-input-buffered-file" } fn test-fake-output-buffered-file { var foo: (handle buffered-file) var foo-ah/eax: (addr handle buffered-file) <- address foo new-buffered-file foo-ah var foo-addr/eax: (addr buffered-file) <- lookup foo write-buffered foo-addr, "abc" var s: (stream byte 0x100) var result/ecx: (addr stream byte) <- address s read-line-buffered foo-addr, result check-stream-equal result, "abc", "F - test-fake-output-buffered-file" }