[111597] trunk/base/src/macports1.0/tests/macports.test

Ryan Schmidt ryandesign at macports.org
Thu Sep 26 18:09:01 PDT 2013


On Sep 26, 2013, at 18:00, marius at macports.org wrote:

> Revision: 111597
>          https://trac.macports.org/changeset/111597
> Author:   marius at macports.org
> Date:     2013-09-26 16:00:49 -0700 (Thu, 26 Sep 2013)
> Log Message:
> -----------
> macports.test: added get_tar_flags, fetch_port and getportdir tests
> 
> Modified Paths:
> --------------
>    trunk/base/src/macports1.0/tests/macports.test
> 
> Modified: trunk/base/src/macports1.0/tests/macports.test
> ===================================================================
> --- trunk/base/src/macports1.0/tests/macports.test	2013-09-26 21:08:13 UTC (rev 111596)
> +++ trunk/base/src/macports1.0/tests/macports.test	2013-09-26 23:00:49 UTC (rev 111597)
> @@ -464,10 +464,33 @@
> } -result "Create thread successful."
> 
> 
> -# test get_tar_flags
> -# test fetch_port
> +test get_tar_flags {
> +    Get tar flags unit test.
> +} -body {
> +    if {[macports::get_tar_flags .tbz2] != "-j"} {
> +	return "FAIL: wrong flaga (-j)"
> +    }
> +    if {[macports::get_tar_flags .tgz] != "-z"} {
> +	return "FAIL: wrong flaga (-z)"
> +    }
> +    return "Get tar flags successful."
> +} -result "Get tar flags successful."
> 
> 
> +test fetch_port {
> +    Fetch port unit test.
> +} -body {
> +    set url http://packages.macports.org/fondu/fondu-060102_1.darwin_10.x86_64.tbz2
> +    set res [macports::fetch_port $url]
> +    if {$res != "${pwd}/portdbpath/portdirs/fondu-060102_1"} {
> +	return "FAIL: cannot fetch port"
> +    }
> +    return "Fetch port successful."
> +} -cleanup {
> +    file delete -force $pwd/portdbpath
> +} -result "Fetch port successful."
> +

String comparisons should use eq or ne, not == or !=.




More information about the macports-dev mailing list