summary refs log tree commit diff stats
path: root/doc/pydoc/test.test.html
blob: 14c090fdfd6de90123302f89a4055d2077467c80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module test.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><a href="test.html"><font color="#ffffff">test</font></a>.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/test.py">/home/hut/ranger/test/test.py</a></font></td></tr></table>
    <p><tt>Workaround&nbsp;to&nbsp;allow&nbsp;running&nbsp;single&nbsp;test&nbsp;cases&nbsp;directly</tt></p>

</body></html>
, either Qemu or Bochs. # qemu-system-i386 -hda code.img -hdb data.img # bochs -f bochsrc.2disks # 5. Exit the emulator. # 6. Notice that the data disk now contains the word count of the original text. # xxd data.img |head fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) { var text-storage: (stream byte 0x200) var text/esi: (addr stream byte) <- address text-storage load-sectors data-disk, 0/lba, 1/num-sectors, text var word-count/eax: int <- word-count text var result-storage: (stream byte 0x10) var result/edi: (addr stream byte) <- address result-storage write-int32-decimal result, word-count store-sectors data-disk, 0/lba, 1/num-sectors, result } fn word-count in: (addr stream byte) -> _/eax: int { var result/edi: int <- copy 0 { var done?/eax: boolean <- stream-empty? in compare done?, 0/false break-if-!= var g/eax: grapheme <- read-grapheme in { compare g, 0x20/space break-if-!= result <- increment } { compare g, 0xa/newline break-if-!= result <- increment } loop } return result }