octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

use filesep in gzip.m test code - failed test on mingw32


From: Benjamin Lindner
Subject: use filesep in gzip.m test code - failed test on mingw32
Date: Fri, 30 Jan 2009 18:35:55 +0100
User-agent: Thunderbird 2.0.0.18 (Windows/20081105)

Hello,

in the current development sources, the test code in gzip.m uses a hard-coded forward slash as file seprator. The attached changeset changes this to use filesep() instead, making the test pass on mingw32.

benjamin
# HG changeset patch
# User Benjamin Lindner <address@hidden>
# Date 1233234306 -3600
# Node ID a483949786c3b0ea627769c108dac8fcc7bdbeb6
# Parent  fee44a7e2e2e25b008a310ee7dc4791d0031124e
fix gzip test code - use filesep()

diff -r fee44a7e2e2e -r a483949786c3 scripts/miscellaneous/gzip.m
--- a/scripts/miscellaneous/gzip.m      Thu Jan 29 13:56:37 2009 +0100
+++ b/scripts/miscellaneous/gzip.m      Thu Jan 29 14:05:06 2009 +0100
@@ -53,19 +53,19 @@
 %!    mkdir(dirname);
 %!    entry = gzip(filename, dirname);
 %!    [path, basename, extension] = fileparts(filename);
-%!    if ! strcmp(entry, [dirname, "/", basename, extension, ".gz"])
+%!    if ! strcmp(entry, [dirname, filesep, basename, extension, ".gz"])
 %!      error("gzipped file does not match expected name!");
 %!    endif
 %!    if ! exist(entry, "file")
 %!      error("gzipped file cannot be found!");
 %!    endif 
 %!    gunzip(entry);
-%!    if (system(sprintf("diff %s %s/%s%s", filename, dirname, 
+%!    if (system(sprintf("diff %s %s%c%s%s", filename, dirname, filesep,
 %!                                          basename, extension)))
 %!      error("unzipped file not equal to original file!");
 %!    end
 %!  unwind_protect_cleanup
 %!    delete(filename);
-%!    delete([dirname, "/", basename, extension]);
+%!    delete([dirname, filesep, basename, extension]);
 %!    rmdir(dirname);
 %!  end_unwind_protect

reply via email to

[Prev in Thread] Current Thread [Next in Thread]