[111183] branches/gsoc13-tests/src/macports1.0/tests

marius at macports.org marius at macports.org
Mon Sep 16 11:33:39 PDT 2013


Revision: 111183
          https://trac.macports.org/changeset/111183
Author:   marius at macports.org
Date:     2013-09-16 11:33:38 -0700 (Mon, 16 Sep 2013)
Log Message:
-----------
macports1.0: fixed whitespaces, tabs

Modified Paths:
--------------
    branches/gsoc13-tests/src/macports1.0/tests/macports.test
    branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test
    branches/gsoc13-tests/src/macports1.0/tests/macports_index.test
    branches/gsoc13-tests/src/macports1.0/tests/macports_util.test

Modified: branches/gsoc13-tests/src/macports1.0/tests/macports.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports.test	2013-09-16 17:42:06 UTC (rev 111182)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports.test	2013-09-16 18:33:38 UTC (rev 111183)
@@ -38,8 +38,8 @@
 source ../../port1.0/port_autoconf.tcl
 
 proc registry_exists {name version {revision 0} {variants ""}} {
-        global macports::registry.format
-        return [${macports::registry.format}::entry_exists $name $version $revision $variants]
+    global macports::registry.format
+    return [${macports::registry.format}::entry_exists $name $version $revision $variants]
 }
 
 proc uninstall_main {args} {
@@ -52,8 +52,7 @@
     if {${autoconf_hint} != "" && [file executable ${autoconf_hint}]} {
         return ${autoconf_hint}
     } else {
-        if {[catch {set cmd_path [macports::binaryInPath ${prog}]} t] ==
-
+        if {[catch {set cmd_path [macports::binaryInPath ${prog}]} result] == 0} {
             return ${cmd_path}
         } else {
             return -code error "${result} or at its MacPorts guration time tion, did you move it?"
@@ -68,10 +67,10 @@
 } -body {
     set mport [mportopen file://.]
     if {[catch {mportclose $mport}] != 0} {
-	return "FAIL: cannot run mportclose"
+	   return "FAIL: cannot run mportclose"
     }
     if {[ditem_key $mport workername] != ""} {
-	return "FAIL: port not closed"
+	   return "FAIL: port not closed"
     }
     return "Mport close successful."
 } -result "Mport close successful."
@@ -84,7 +83,7 @@
 } -body {
     set res [mportinfo $mport]
     if {[lindex $res 2] != "canonical_active_variants"} {
-	return "FAIL: cannot get ::PortInfo"
+        return "FAIL: cannot get ::PortInfo"
     }
     return "Mport info successful."
 } -cleanup {
@@ -165,14 +164,14 @@
 } -body {
     set res [mportopen_installed $subport $version $revision $variants $options]
     if {![string match "ditem_*" $res]} {
-	return "FAIL: installed port not opened"
+	   return "FAIL: installed port not opened"
     }
 
     if {[catch {mportclose_installed $res}] != 0} {
-	return "FAIL: cannot close port"
+	   return "FAIL: cannot close port"
     }
     if {[catch {mportclose_installed $res}] != 1} {
-	return "FAIL: installed port not closed"
+	   return "FAIL: installed port not closed"
     }
     return "Installed port open successful."
 
@@ -192,10 +191,10 @@
 	array set ui_options { test yes }
     }
     if {[macports::ui_isset test] != 1} {
-	return "FAIL: set option not detected"
+	   return "FAIL: set option not detected"
     }
     if {[macports::ui_isset port] != 0} {
-	return "FAIL: unset option detected"
+	   return "FAIL: unset option detected"
     }
     return "ui_isset successful."
 } -result "ui_isset successful."
@@ -208,10 +207,10 @@
 	array set global_options { test yes }
     }
     if {[macports::global_option_isset test] != 1} {
-	return "FAIL: set option not detected"
+	   return "FAIL: set option not detected"
     }
     if {[macports::global_option_isset port] != 0} {
-	return "FAIL: unset option detected"
+	   return "FAIL: unset option detected"
     }
     return "Global option isset successful."
 } -result "Global option isset successful."
@@ -225,13 +224,13 @@
     set mport [mportopen file://.]
 } -body {
     if {[macports::init_logging $mport] != 0} {
-	return "FAIL: incorrect channels"
+	   return "FAIL: incorrect channels"
     }
     if {$macports::channels(any) != "stdout debuglog"} {
-	return "FAIL: incorrect channels(any)"
+	   return "FAIL: incorrect channels(any)"
     }
     if {$macports::channels(debug) != "debuglog"} {
-	return "FAIL: incorrect channels(debug)"
+	   return "FAIL: incorrect channels(debug)"
     }
     return "Init logging successful."
 } -cleanup {
@@ -253,13 +252,13 @@
 
 } -body {
     if {[macports::ch_logging $mport] != 0} {
-	return "FAIL: channels not set"
+	   return "FAIL: channels not set"
     }
     if {![file exists $logname]} {
-	return "FAIL: logname dir missing"
+	   return "FAIL: logname dir missing"
     }
     if {![file exists $logname/main.log]} {
-	return "FAIL: main.log missing"
+	   return "FAIL: main.log missing"
     }
     return "Channel logging successful."
 
@@ -277,10 +276,10 @@
 } -body {
     set ::logenabled 1
     if {[catch {macports::push_log $mport}] != 0} {
-	return "FAIL: cannot push log"
+	   return "FAIL: cannot push log"
     }
     if {[lindex $::logstack 0] != [list $::debuglog $::debuglogname]} {
-	return "FAIL: incorrect logstack"
+	   return "FAIL: incorrect logstack"
     }
     return "Push log successful."
 } -cleanup {
@@ -302,10 +301,10 @@
     Find binary unit test.
 } -body {
     if {[macports::findBinary pwd ls] != "/bin/pwd"} {
-	return "FAIL: wrong binary"
+	   return "FAIL: wrong binary"
     }
     if {[macports::findBinary pwd /bin/ls] != "/bin/ls"} {
-	return "FAIL: wrong binary"
+	   return "FAIL: wrong binary"
     }
     return "Find binary successful."
 } -result "Find binary successful."
@@ -315,10 +314,10 @@
     Binary in path unit test.
 } -body {
     if {[catch {macports::binaryInPath zz}] != 1} {
-	return "FAIL: invalid binary found"
+	   return "FAIL: invalid binary found"
     }
     if {[macports::binaryInPath ls] != "/bin/ls"} {
-	return "FAIL: wrong binary found"
+	   return "FAIL: wrong binary found"
     }
     return "Binary in path successful."
 } -result "Binary in path successful."
@@ -335,10 +334,10 @@
     unset macports::xcodeversion
 
     if {[macports::setxcodeinfo a b c] != ""} {
-	return "FAIL: xcode binary not found"
+	   return "FAIL: xcode binary not found"
     }
     if {![info exists macports::xcodeversion]} {
-	return "FAIL: xcodeversion unset"
+	   return "FAIL: xcodeversion unset"
     }
     return "Set XCode version successful."
 } -result "Set XCode version successful."
@@ -352,10 +351,10 @@
     unset macports::developer_dir
 
     if {[macports::set_developer_dir a b c] != ""} {
-	return "FAIL: cannot set dev dir"
+	   return "FAIL: cannot set dev dir"
     }
     if {![info exists macports::developer_dir]} {
-	return "FAIL: developer_dir var no set"
+	   return "FAIL: developer_dir var no set"
     }
     return "Set developer dir successful."
 } -result "Set developer dir successful."
@@ -366,17 +365,13 @@
 } -body {
     set macports::set_developer /Applications/Xcode.app/Contents/Developer
     if {[macports::_is_valid_developer_dir $macports::developer_dir] != 1} {
-	return "FAIL: valid dir not detected"
+	   return "FAIL: valid dir not detected"
     }
     return "Valid dev dir successful."
 } -result "Valid dev dir successful."
 
 
-test mportinit {
-    Mport init unit test.
-} -body {
-    #puts [mportinit]
-} -result ""
+# test mportinit
 
 
 test mportshutdown {
@@ -392,9 +387,10 @@
 
     file mkdir $macports::portdbpath
     close [open $macports::portdbpath/pingtimes w+]
+
 } -body {
     if {[mportshutdown] != ""} {
-	return "FAIL: errors occured"
+	   return "FAIL: errors occured"
     }
 
     set res ""
@@ -402,7 +398,7 @@
     set fd [open $macports::portdbpath/pingtimes r]
 
     if {[gets $fd] != $res} {
-	return "FAIL: wrong value saved"
+	   return "FAIL: wrong value saved"
     }
     close $fd
     return "Mportshutdown successful."
@@ -420,13 +416,12 @@
     set target $pwd/target
 
     if {[macports::copy_xcode_plist $target] != ""} {
-	return "FAIL: cannot copy xcode plist"
+	   return "FAIL: cannot copy xcode plist"
     }
     if {![file exists $target/Library/Preferences/com.apple.dt.Xcode.plist]} {
-	return "FAIL: missing plist file"
+	   return "FAIL: missing plist file"
     }
     return "Copy xcode plist successful."
-    puts $res
 } -cleanup {
     file delete -force $target
 } -result "Copy xcode plist successful."
@@ -444,16 +439,16 @@
 } -body {
     macports::worker_init $name $portpath $porturl $portbuildpath $options $variations
     if {$name != "interp0"} {
-	return "FAIL: wrong workername"
+	   return "FAIL: wrong workername"
     }
     if {[$name eval source Portfile] != "yes"} {
-	return "FAIL: cannot load Portfile"
+	   return "FAIL: cannot load Portfile"
     }
     if {[$name eval findBinary ls] != "/bin/ls"} {
-	return "FAIL: alias not created"
+	   return "FAIL: alias not created"
     }
     if {[$name eval return \$os_arch] != "i386"} {
-	return "FAIL: var not set"
+	   return "FAIL: var not set"
     }
     return "Worker init successful."
 } -result "Worker init successful."
@@ -467,7 +462,7 @@
 
     set res [macports::create_thread]
     if {![string match "tid0x*" $res]} {
-	return "FAIL: cannot create thread"
+	   return "FAIL: cannot create thread"
     }
     return "Create thread successful."
 } -result "Create thread successful."
@@ -481,7 +476,7 @@
     Get protocol unit test.
 } -body {
     if {[macports::getprotocol http://www.macports.org] != "http"} {
-	return "FAIL: wrong protocol"
+	   return "FAIL: wrong protocol"
     }
     return "Get protocol successful."
 } -result "Get protocol successful."
@@ -499,13 +494,13 @@
     set fallback_path $pwd/portdbpath/sources/packages.macports.org/fondu/fondu-060102_1.darwin_12.x86_64.tbz2/_resources
 
     if {[macports::getportresourcepath $url "" yes] != $default_path} {
-	return "FAIL: wrong resource path"
+	   return "FAIL: wrong resource path"
     }
     if {[macports::getportresourcepath $url "" no] != $fallback_path} {
-	return "FAIL: wrong fallback path"
+	   return "FAIL: wrong fallback path"
     }
     if {[macports::getportresourcepath $url "test" no] != "${fallback_path}/test"} {
-	return "FAIL: wrong fallback path with subdir"
+	   return "FAIL: wrong fallback path with subdir"
     }
 
     return "Get resource path successful."
@@ -518,44 +513,22 @@
     set path test/path
     set macports::sources_default file://$pwd
     if {[macports::getdefaultportresourcepath $path] != "${pwd}/_resources/${path}"} {
-	return "FAIL: wrong file res path"
+	   return "FAIL: wrong file res path"
     }
 
     set macports::sources_default http://$pwd
     set default_source_url [lindex ${macports::sources_default} 0]
     set right_path [macports::getsourcepath $default_source_url]/_resources/test/path
     if {[macports::getdefaultportresourcepath $path] != $right_path} {
-	return "FAIL: wrong http res path"
+	   return "FAIL: wrong http res path"
     }
     return "Default res path successful."
 } -result "Default res path successful."
 
 
-test mportopen {
-    Mport open unit test.
-} -setup {
-    set os_platform darwin
-    set os.platform darwin
-    set macosx_version 10.8
-    set os_version 12
-    set os_arch i386
+# test mportopen
 
-    global os_platform
 
-    set macports::portdbpath $pwd/portdbpath
-    set macports::portconf $pwd/conf
-} -body {
-    # set mport [mportopen file://.]
-    # puts [ditem_key $mport refcnt]
-    # if {[mportopen file://.] != "ditem_1"} {
-	# return "FAIL: Portfile not opened"
-    # }
-    return "Mport open successful."
-} -cleanup {
-    #mportclose $mport
-} -result "Mport open successful."
-
-
 # Covered by mportopen_installed
 # test mportclose_installed
 
@@ -571,10 +544,10 @@
     file copy -force $pwd/Portfile $pwd/porttree/cat2/fondu/Portfile
 
     proc test_proc {file} {
-	global pwd res
-	set fd [open ${pwd}/porttree/${file}/Portfile r]
-	gets $fd line
-	append res [lindex [split $line " "] 3]
+	   global pwd res
+	   set fd [open ${pwd}/porttree/${file}/Portfile r]
+	   gets $fd line
+	   append res [lindex [split $line " "] 3]
     }
 
     global res
@@ -582,7 +555,7 @@
 } -body {
     mporttraverse test_proc $pwd/porttree
     if {$res != "8547285472"} {
-	return "FAIL: porttree not traversed"
+	   return "FAIL: porttree not traversed"
     }
     return "Mport traverse successful."
 } -cleanup {
@@ -615,10 +588,6 @@
 # test mports_generate_quickindex
 
 
-
-
-
-
 # test _mportkey
 # test mportdepends
 # test _mport_supports_archs
@@ -654,18 +623,19 @@
     close $fd
 } -body {
     if {[mportselect list group] != {file1 file2}} {
-	return "FAIL: files not listed"
+	   return "FAIL: files not listed"
     }
     if {[mportselect set group file1] != ""} {
-	reutrn "FAIL: cannot set links"
+	   reutrn "FAIL: cannot set links"
     }
     if {![file exists $macports::prefix/a]} {
-	return "FAIL: link not created"
+	   return "FAIL: link not created"
     }
     if {[mportselect show group] != "file1"} {
-	return "FAIL: file not selected"
+	   return "FAIL: file not selected"
     }
     return "Mport select successful."
+
 } -cleanup {
     file delete -force $macports::prefix
 } -result "Mport select successful."
@@ -677,11 +647,11 @@
     global env
     set env(TMPDIR) temporal
     if {[macports::gettmpdir] != "temporal"} {
-	return "FAIL: set temp dir not detected"
+	   return "FAIL: set temp dir not detected"
     }
     unset env(TMPDIR)
     if {[macports::gettmpdir] != "/tmp"} {
-	return "FAIL: default value not set"
+	   return "FAIL: default value not set"
     }
     return "Get tmp dir successful."
 } -result "Get tmp dir successful."
@@ -694,22 +664,22 @@
     set macports::os_arch i386
     set macports::os_platform darwin
     if {[macports::arch_runnable ppc1] != no} {
-	return "FAIL: major:12 arch:i386 arch:ppc* not detected"
+	   return "FAIL: major:12 arch:i386 arch:ppc* not detected"
     }
     if {[macports::arch_runnable ppc64] != no} {
-	return "FAIL: major:12 arch:i386 arch:ppc64 not detected"
+	   return "FAIL: major:12 arch:i386 arch:ppc64 not detected"
     }
     set macports::os_major 7
     set macports::os_arch i386
     set macports::os_platform darwin
     if {[macports::arch_runnable x86_64] != no} {
-	return "FAIL: major:7 arch:i386 arch:x86_64 not detected"
+	   return "FAIL: major:7 arch:i386 arch:x86_64 not detected"
     }
     set macports::os_major 12
     set macports::os_arch i386
     set macports::os_platform darwin
     if {[macports::arch_runnable x86_64] != yes} {
-	return "FAIL: major:12 arch:i386 arch:x86_64 not detected"
+	   return "FAIL: major:12 arch:i386 arch:x86_64 not detected"
     }
     return "Arch runnable successful."
 } -result "Arch runnable successful."
@@ -724,14 +694,14 @@
 } -body {
     set macports::applications_dir appdir
     if {[macports::path_is_in_prefix appdir/test/port] != yes} {
-	return "FAIL: application dir not detected"
+	   return "FAIL: application dir not detected"
     }
     set macports::prefix prefix
     if {[macports::path_is_in_prefix prefix/test/port] != yes} {
-	return "FAIL: prefix not detected"
+	   return "FAIL: prefix not detected"
     }
     if {[macports::path_is_in_prefix test/port] != no} {
-	return "FAIL: no prefix detected"
+	   return "FAIL: no prefix detected"
     }
     return "Path prefix successful."
 } -result "Path prefix successful."
@@ -742,11 +712,11 @@
 } -body {
     set res [macports::revupgrade_handle_special_paths fname test_path]
     if {$res != "test_path"} {
-	return "FAIL: wrong path"
+	   return "FAIL: wrong path"
     }
     set res [macports::revupgrade_handle_special_paths fname @loader_path/test_load]
     if {$res != "./test_load"} {
-	return "FAIL: wrong load path"
+	   return "FAIL: wrong load path"
     }
     return "Revupgrade handle special path successful."
 } -result "Revupgrade handle special path successful."
@@ -765,13 +735,13 @@
 
 } -body {
     if {[macports::get_pingtime macports.org] != "MacPorts"} {
-	return "FAIL: wrong ping time"
+	   return "FAIL: wrong ping time"
     }
     if {[macports::get_pingtime macports_blacklist] != -1} {
-	return "FAIL: wrong time for blacklisted host"
+	   return "FAIL: wrong time for blacklisted host"
     }
     if {[macports::get_pingtime macports_pref] != 1} {
-	return "FAIL: wrong time for preferred host"
+	   return "FAIL: wrong time for preferred host"
     }
     return "Get ping time successful."
 } -result "Get ping time successful."
@@ -782,7 +752,7 @@
 } -body {
     set macports::ping_cache(macports) {}
     if {[lindex [macports::set_pingtime macports 007] 0] != 007} {
-	return "FAIL: ping time not set"
+	   return "FAIL: ping time not set"
     }
     return "Set ping time successful."
 } -result "Set ping time successful."
@@ -803,15 +773,15 @@
 } -body {
     set res [macports::get_archive_sites_conf_values]
     if {[lindex [split $res " "] 1] != "macports.org:nosubdir"} {
-	return "FAIL: name not set"
+	   return "FAIL: name not set"
     }
     if {[lindex [split $res " "] 3] != "tgz"} {
-	return "FAIL: wrong type set"
+	   return "FAIL: wrong type set"
     }
 
     set macports::archive_sites_conf_values {a b c}
     if {[macports::get_archive_sites_conf_values] != {a b c}} {
-	return "FAIL: wrong  result for bad conf file"
+	   return "FAIL: wrong  result for bad conf file"
     }
     return "Get archive sites conf values successful."
 

Modified: branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test	2013-09-16 17:42:06 UTC (rev 111182)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test	2013-09-16 18:33:38 UTC (rev 111183)
@@ -19,19 +19,17 @@
 } -setup {
     set mport [mportopen file://.]
     set crit {
-	provides fondu
-	porturl file://.
+	   provides fondu
+	   porturl file://.
     }
-    set crit2 {
-	provides fondu2
-    }
+    set crit2 { provides fondu2 }
 
 } -body {
     if {[dlist_match_multi $mport $crit] != $mport} {
-	return "FAIL: correct dlist not matched"
+	   return "FAIL: correct dlist not matched"
     }
     if {[dlist_match_multi $mport $crit2] != ""} {
-	return "FAIL: incorrect dlist matched"
+	   return "FAIL: incorrect dlist matched"
     }
     return "dlist match successful."
 } -cleanup {
@@ -45,10 +43,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[dlist_search $mport provides fondu] != $mport} {
-	return "FAIL: matching item not found"
+	   return "FAIL: matching item not found"
     }
     if {[dlist_search $mport provides fondu2] != ""} {
-	return "FAIL: wrong item detected"
+	   return "FAIL: wrong item detected"
     }
     return "dlist successful."
 } -cleanup {
@@ -64,10 +62,10 @@
     lappend dlist $mport
 } -body {
     if {[dlist_delete dlist $mport] != ""} {
-	return "FAIL: cannot run dlist_delete"
+	   return "FAIL: cannot run dlist_delete"
     }
     if {$dlist != ""} {
-	return "FAIL: port not removed from list"
+	   return "FAIL: port not removed from list"
     }
     return "Dlist delete successful."
 } -cleanup {
@@ -81,10 +79,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[dlist_has_pending $mport fondu] != 1} {
-	return "FAIL: not detected"
+	   return "FAIL: not detected"
     }
     if {[dlist_has_pending $mport provides] != 0} {
-	return "FAIL: incorrect detected"
+	   return "FAIL: incorrect detected"
     }
     return "dlist pending successful."
 } -cleanup {
@@ -97,14 +95,14 @@
 } -setup {
     set mport [mportopen file://.]
     array set statusdict {
-	vara 0
-	varb 0
-	varc 1
+	   vara 0
+	   varb 0
+	   varc 1
     }
     set tokens {vara varb vard}
 } -body {
     if {[dlist_count_unmet $mport statusdict $tokens] != 3} {
-	return "FAIL: wrong unmet number"
+	   return "FAIL: wrong unmet number"
     }
     return "count unmet successful."
 } -cleanup {
@@ -122,10 +120,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[ditem_key $mport {provides}] != "fondu"} {
-	return "FAIL: wrong key value"
+	   return "FAIL: wrong key value"
     }
     if {[ditem_key $mport {wants}] != ""} {
-	return "FAIL: wrong key detected"
+	   return "FAIL: wrong key detected"
     }
     return "ditem key successful."
 } -cleanup {
@@ -145,7 +143,7 @@
     set result {fondu2}
 } -body {
     if {[dlist_append_dependents $mport provides $result] != {fondu2 provides}} {
-	return "FAIL: wrong depends"
+	   return "FAIL: wrong depends"
     }
     return "Append depends successful."
 } -cleanup {
@@ -160,7 +158,7 @@
     set dict {fondu}
 } -body {
     if {[dlist_get_next $mport $dict] != $mport} {
-	return "FAIL: wrong dlist"
+	   return "FAIL: wrong dlist"
     }
     return "dlist get next successful."
 } -cleanup {
@@ -173,16 +171,16 @@
 } -setup {
     set mport [mportopen file://.]
     proc cond {arg} {
-	if {[string match "ditem_*" $arg] != 0} {
-	    return 0
-	} else {
-	    return 1
-	}
+	   if {[string match "ditem_*" $arg] != 0} {
+            return 0
+	   } else {
+            return 1
+	   }
     }
     proc handler {arg} {}
 } -body {
     if {[dlist_eval $mport cond handler] != ""} {
-	return "FAIL: wrong value returned"
+	   return "FAIL: wrong value returned"
     }
     return "dlist eval successful."
 } -cleanup {
@@ -203,10 +201,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[ditem_contains $mport provides] != 1} {
-	return "FAIL: valid key not detected"
+	   return "FAIL: valid key not detected"
     }
     if {[ditem_contains $mport wants] != 0} {
-	return "FAIL: invalid key detected"
+	   return "FAIL: invalid key detected"
     }
     return "ditem contains successful."
 } -cleanup {

Modified: branches/gsoc13-tests/src/macports1.0/tests/macports_index.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports_index.test	2013-09-16 17:42:06 UTC (rev 111182)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports_index.test	2013-09-16 18:33:38 UTC (rev 111183)
@@ -19,7 +19,7 @@
     set url "http://www.macports.org"
 
     if {[macports::index::get_path $url] != "${macports::portdbpath}/sources/http.www.macports.org"} {
-	return "FAIL: wrong path"
+	   return "FAIL: wrong path"
     }
     return "Get path successful."
 } -result "Get path successful."

Modified: branches/gsoc13-tests/src/macports1.0/tests/macports_util.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports_util.test	2013-09-16 17:42:06 UTC (rev 111182)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports_util.test	2013-09-16 18:33:38 UTC (rev 111183)
@@ -10,20 +10,20 @@
     Method wrap unit test.
 } -setup {
     proc test_proc {a} {
-	if { $a == 1} {
-	    return -code error $a -errorcode 7
-	} else {
-	    return $a
-	}
+	   if { $a == 1} {
+	       return -code error $a -errorcode 7
+	   } else {
+            return $a
+	   }
     }
 
 } -body {
     macports_util::method_wrap test_proc
     if {[test_proc 1] != 7} {
-	return "FAIL: no wrap around method"
+	   return "FAIL: no wrap around method"
     }
     if {[test_proc arg] != "arg"} {
-	return "FAIL: no wrap around method"
+	   return "FAIL: no wrap around method"
     }
     return "Method wrap successful."
 } -result "Method wrap successful."
@@ -34,19 +34,19 @@
 } -body {
     set list {0 1 2 3}
     if {[ldindex list 1] != 1} {
-	return "FAIL: element not poped"
+	   return "FAIL: element not poped"
     }
     if {$list != {0 2 3}} {
-	return "FAIL: wrong list remaining"
+	   return "FAIL: wrong list remaining"
     }
     if {[catch {ldindex list 4}] != 1} {
-	return "FAIL: error not detected"
+	   return "FAIL: error not detected"
     }
     if {[ldindex list] != {0 2 3}} {
-	return "FAIL: not all elements poped"
+	   return "FAIL: not all elements poped"
     }
     if {$list != ""} {
-	return "FAIL: list not emptied"
+	   return "FAIL: list not emptied"
     }
     return "ldindex successful."
 } -result "ldindex successful."
@@ -57,10 +57,10 @@
 } -body {
     set list {0 1 2}
     if {[lpop list] != 2} {
-	return "FAIL: element not poped"
+	   return "FAIL: element not poped"
     }
     if {$list != {0 1}} {
-	return "FAIL: wrong element poped"
+	   return "FAIL: wrong element poped"
     }
     return "lpop successful."
 } -result "lpop successful."
@@ -71,13 +71,13 @@
 } -body {
     set list {0 1}
     if {[lpush list 2] != {0 1 2}} {
-	return "FAIL: element not appended"
+	   return "FAIL: element not appended"
     }
     if {[lpush list 3 4] != {0 1 2 3 4}} {
-	return "FAIL: multiple elements not appended"
+	   return "FAIL: multiple elements not appended"
     }
     if {[lpush list1 0] != 0} {
-	return "FAIL: list not created"
+	   return "FAIL: list not created"
     }
     return "lpop successful."
 } -result "lpop successful."
@@ -90,13 +90,13 @@
     set list1 {}
 
     if {[lshift list] != 0} {
-	return "FAIL: wrong element poped"
+	   return "FAIL: wrong element poped"
     }
     if {$list != {1 2}} {
-	return "FAIL: wrong list remaining"
+	   return "FAIL: wrong list remaining"
     }
     if {[lshift list1] != ""} {
-	return "FAIL: empty list not detected"
+	   return "FAIL: empty list not detected"
     }
     return "lshift successful."
 } -result "lshift successful."
@@ -108,13 +108,13 @@
     set list {3 4}
 
     if {[lunshift list 2] != {2 3 4}} {
-	return "FAIL: element not inserted"
+	   return "FAIL: element not inserted"
     }
     if {[lunshift list 0 1] != {0 1 2 3 4}} {
-	return "FAIL: multiple elements not inserted"
+	   return "FAIL: multiple elements not inserted"
     }
     if {[lunshift list2 0] != 0} {
-	return "FAIL: list not created"
+	   return "FAIL: list not created"
     }
     return "lunshift successful."
 } -result "lunshift successful."
@@ -125,15 +125,15 @@
     Throw unit test.
 } -setup {
     proc test_proc {arg} {
-	catch {throw $arg} res
-	return $res
+	   catch {throw $arg} res
+	   return $res
     }
 } -body {
     if {[test_proc {7 msg info}] != "error: 7 msg info"} {
-	return "FAIL: wrong error returneed"
+	   return "FAIL: wrong error returneed"
     }
     if {[catch {test_proc ""}] != 0} {
-	return "FAIL: wrong value returned"
+	   return "FAIL: wrong value returned"
     }
     return "throw successful."
 } -result "throw successful."
@@ -146,13 +146,13 @@
     proc test_proc2 {} {try {error "msg" "info" 3} catch * {return 6}}
 } -body {
     if {[test_proc] != 7} {
-	return "FAIL: try clause not working"
+	   return "FAIL: try clause not working"
     }
     if {[test_proc2] != 6} {
-	reutrn "FAIL: catch clause not working"
+	   reutrn "FAIL: catch clause not working"
     }
     if {[catch {try}] != 1} {
-	return "FAIL: no args err not detected"
+	   return "FAIL: no args err not detected"
     }
     return "try successful."
 } -result "try successful."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130916/b7b6e12f/attachment-0001.html>


More information about the macports-changes mailing list