<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/cebcad3ad1001fb9640ebab55353059d4a5fb971">https://github.com/macports/macports-base/commit/cebcad3ad1001fb9640ebab55353059d4a5fb971</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit cebcad3ad1001fb9640ebab55353059d4a5fb971
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Fri Dec 2 14:57:01 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> A few improvements to macports_util tests
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Test multi-index behaviour of ldindex, and fix a few typos.
</span>---
src/macports1.0/tests/macports_util.test | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/tests/macports_util.test b/src/macports1.0/tests/macports_util.test
</span><span style='display:block; white-space:pre;color:#808080;'>index 72dc8cd..d39afb9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/tests/macports_util.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/tests/macports_util.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -78,20 +78,27 @@ test ldindex {
</span> } -body {
set list {0 1 2 3}
if {[ldindex list 1] != 1} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: element not poped"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: correct element not popped, single index"
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$list != {0 2 3}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: wrong list remaining"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$list ne {0 2 3}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: wrong list remaining, single index"
</span> }
if {[catch {ldindex list 4}] != 1} {
return "FAIL: error not detected"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[ldindex list] != {0 2 3}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: not all elements poped"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[ldindex list] ne {0 2 3}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: not all elements popped"
</span> }
if {$list ne ""} {
return "FAIL: list not emptied"
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set list {{{0 1} {2 3}} {{4 5} {6 7}}}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[ldindex list 1 1 1] != 7} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: correct element not popped, multiple indices"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$list ne {{{0 1} {2 3}} {{4 5} 6}}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: wrong list remaining, multiple indices"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> return "ldindex successful."
} -result "ldindex successful."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -101,10 +108,10 @@ test lpop {
</span> } -body {
set list {0 1 2}
if {[lpop list] != 2} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: element not poped"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: element not popped"
</span> }
if {$list != {0 1}} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: wrong element poped"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: wrong element popped"
</span> }
return "lpop successful."
} -result "lpop successful."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -134,7 +141,7 @@ test lshift {
</span> set list1 {}
if {[lshift list] != 0} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: wrong element poped"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "FAIL: wrong element popped"
</span> }
if {$list != {1 2}} {
return "FAIL: wrong list remaining"
</pre><pre style='margin:0'>
</pre>