rev 384 - trunk/pr

SVN User <[email protected]> Sun, 18 Apr 2004 00:15:51 -0400
Newsgroups gmane.comp.lang.prothon.cvs
Message-ID <[email protected]>
Author: bcollins
Date: 2004-04-18 00:15:48 -0400 (Sun, 18 Apr 2004)
New Revision: 384

Modified:
   trunk/pr/dbm.pr
   trunk/pr/file.pr
   trunk/pr/listcomp.pr
   trunk/pr/strmod.pr
Log:
Set props


Modified: trunk/pr/dbm.pr
===================================================================
--- trunk/pr/dbm.pr	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/pr/dbm.pr	2004-04-18 04:15:48 UTC (rev 384)
@@ -1,46 +1,46 @@
-#!/usr/bin/env prothon
-
-# dbm.pr
-
-from DBM import DB
-
-db = DB("test.dbm", mode=DBM.RWTRUNC)
-
-if db.exists?('a'):
-	print 'err1'
-	Sys.exit(1)
-	
-db.store('a', 'abc' + 0.chr() + 'def')
-db.store('c', 'xyz')
-db.store('b', '')
-
-if not db.exists?('a'):
-	print 'err2'
-	Sys.exit(1)
-	
-if db.fetch('a') != 'abc' + 0.chr() + 'def':
-	print 'err3'
-	Sys.exit(1)
-	
-if db.fetch('b') != '':
-	print 'err4'
-	Sys.exit(1)
-	
-if db.fetch('c') != 'xyz':
-	print 'err5'
-	Sys.exit(1)
-	
-list = []
-k = db.firstKey()
-while k:
-	list.append!(k)
-	k = db.nextKey(k)
-
-list.sort!()
-
-if list != ['a','b','c']:
-	print 'err6'
-	Sys.exit(1)
-	
-print '\nall tests passed\n'
-
+#!/usr/bin/env prothon
+
+# dbm.pr
+
+from DBM import DB
+
+db = DB("test.dbm", mode=DBM.RWTRUNC)
+
+if db.exists?('a'):
+	print 'err1'
+	Sys.exit(1)
+	
+db.store('a', 'abc' + 0.chr() + 'def')
+db.store('c', 'xyz')
+db.store('b', '')
+
+if not db.exists?('a'):
+	print 'err2'
+	Sys.exit(1)
+	
+if db.fetch('a') != 'abc' + 0.chr() + 'def':
+	print 'err3'
+	Sys.exit(1)
+	
+if db.fetch('b') != '':
+	print 'err4'
+	Sys.exit(1)
+	
+if db.fetch('c') != 'xyz':
+	print 'err5'
+	Sys.exit(1)
+	
+list = []
+k = db.firstKey()
+while k:
+	list.append!(k)
+	k = db.nextKey(k)
+
+list.sort!()
+
+if list != ['a','b','c']:
+	print 'err6'
+	Sys.exit(1)
+	
+print '\nall tests passed\n'
+


Property changes on: trunk/pr/dbm.pr
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Modified: trunk/pr/file.pr
===================================================================
--- trunk/pr/file.pr	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/pr/file.pr	2004-04-18 04:15:48 UTC (rev 384)
@@ -1,42 +1,42 @@
-#!/usr/bin/env prothon
-
-import File
-
-f = File("test.txt", 'w+')
-for i in 5:
-	f.write("line "+i+'\n')
-f.writeLines( ['line 5\n','line 6\n','line 7\n','line 8\n','line 9\n',])
-f.close()
-
-ref =  ['line 0\n','line 1\n','line 2\n','line 3\n','line 4\n',]
-ref += ['line 5\n','line 6\n','line 7\n','line 8\n','line 9\n',]
-
-f = File("test.txt")
-x = f.read()
-print x
-if (x != ''.join(ref)): 
-	print "test failed: x != f"
-	Sys.exit(1)
-
-f.seek(7)
-x = f.read(7)
-print x
-if (x != 'line 1\n'): 
-	print "test failed: x != 'line 1'"
-	Sys.exit(1)
-
-f.seek(21)
-x = f.read(14)
-print x
-if (x != 'line 3\nline 4\n'): 
-	print "test failed: x != 'line 3line 4'"
-	Sys.exit(1)
-
-x = f.readLines()
-ref = ['line 5\n','line 6\n','line 7\n','line 8\n','line 9\n',]
-print x
-if (''.join(x) != ''.join(ref)): 
-	print "test failed: x != 'line 5','line 6','line 7','line 8','line 9'"
-	Sys.exit(1)
-
-print "\nall tests passed"
+#!/usr/bin/env prothon
+
+import File
+
+f = File("test.txt", 'w+')
+for i in 5:
+	f.write("line "+i+'\n')
+f.writeLines( ['line 5\n','line 6\n','line 7\n','line 8\n','line 9\n',])
+f.close()
+
+ref =  ['line 0\n','line 1\n','line 2\n','line 3\n','line 4\n',]
+ref += ['line 5\n','line 6\n','line 7\n','line 8\n','line 9\n',]
+
+f = File("test.txt")
+x = f.read()
+print x
+if (x != ''.join(ref)): 
+	print "test failed: x != f"
+	Sys.exit(1)
+
+f.seek(7)
+x = f.read(7)
+print x
+if (x != 'line 1\n'): 
+	print "test failed: x != 'line 1'"
+	Sys.exit(1)
+
+f.seek(21)
+x = f.read(14)
+print x
+if (x != 'line 3\nline 4\n'): 
+	print "test failed: x != 'line 3line 4'"
+	Sys.exit(1)
+
+x = f.readLines()
+ref = ['line 5\n','line 6\n','line 7\n','line 8\n','line 9\n',]
+print x
+if (''.join(x) != ''.join(ref)): 
+	print "test failed: x != 'line 5','line 6','line 7','line 8','line 9'"
+	Sys.exit(1)
+
+print "\nall tests passed"


Property changes on: trunk/pr/file.pr
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Modified: trunk/pr/listcomp.pr
===================================================================
--- trunk/pr/listcomp.pr	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/pr/listcomp.pr	2004-04-18 04:15:48 UTC (rev 384)
@@ -1,22 +1,22 @@
-#!/usr/bin/env prothon
-
-# listcomp.pr
-
-lst = [x for x in 4]
-if lst != [0, 1, 2, 3]:
-	print "err1"
-	Sys.exit(1)
-	
-lst = [(x,y) for x in 2 for y in 2]
-if lst != [(0, 0), (0, 1), (1, 0), (1, 1)]:
-	print "err2"
-	Sys.exit(1)
-	
-lst = [(x,y) for x in 4 if x%2==0 for y in 4 if y%2==1]
-if lst != [(0, 1), (0, 3), (2, 1), (2, 3)]:
-	print "err3"
-	Sys.exit(1)
-
-print
-print "all tests passed"
-print
+#!/usr/bin/env prothon
+
+# listcomp.pr
+
+lst = [x for x in 4]
+if lst != [0, 1, 2, 3]:
+	print "err1"
+	Sys.exit(1)
+	
+lst = [(x,y) for x in 2 for y in 2]
+if lst != [(0, 0), (0, 1), (1, 0), (1, 1)]:
+	print "err2"
+	Sys.exit(1)
+	
+lst = [(x,y) for x in 4 if x%2==0 for y in 4 if y%2==1]
+if lst != [(0, 1), (0, 3), (2, 1), (2, 3)]:
+	print "err3"
+	Sys.exit(1)
+
+print
+print "all tests passed"
+print


Property changes on: trunk/pr/listcomp.pr
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native

Modified: trunk/pr/strmod.pr
===================================================================
--- trunk/pr/strmod.pr	2004-04-18 03:44:16 UTC (rev 383)
+++ trunk/pr/strmod.pr	2004-04-18 04:15:48 UTC (rev 384)
@@ -1,20 +1,20 @@
-#!/usr/bin/env prothon
-
-# strmod.pr
-
-s = "test %4d..%4.2e..%s" % (-12, 100/3, 'jhgdjhg')
-
-if s != 'test  -12..3.33e+01..jhgdjhg': 
-	print 'error 1'
-	print s
-	Sys.exit(1)
-	
-s = "%d" % 3333
-
-if s != '3333': 
-	print 'error 2'
-	print s
-	Sys.exit(1)
-	
-print '\nall tests passed\n'
-
+#!/usr/bin/env prothon
+
+# strmod.pr
+
+s = "test %4d..%4.2e..%s" % (-12, 100/3, 'jhgdjhg')
+
+if s != 'test  -12..3.33e+01..jhgdjhg': 
+	print 'error 1'
+	print s
+	Sys.exit(1)
+	
+s = "%d" % 3333
+
+if s != '3333': 
+	print 'error 2'
+	print s
+	Sys.exit(1)
+	
+print '\nall tests passed\n'
+


Property changes on: trunk/pr/strmod.pr
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native