~ubuntu-branches/ubuntu/saucy/padre/saucy-proposed

« back to all changes in this revision

Viewing changes to t/93-padre-filename-win.t

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl
2
 
 
3
 
use strict;
4
 
use warnings;
5
 
use Test::More;
6
 
 
7
 
use Padre::File;
8
 
 
9
 
if ( ( $^O ne 'MSWin32' ) and ( $^O ne 'cygwin' ) ) {
10
 
        plan( tests => 1 );
11
 
        ok( 1, 'Skipped, only applies to Windows' );
12
 
        exit;
13
 
}
14
 
 
15
 
plan( tests => 7 );
16
 
 
17
 
{
18
 
 
19
 
        local $TODO;
20
 
        $TODO = 'Failing this is no reason to stop install' unless $ENV{AUTOMATED_TESTING};
21
 
 
22
 
        # The test file name is hard-coded because we need to play around with the pathname (/ or \):
23
 
 
24
 
        ok( open( my $fh, '>', 't/files/padre-file-test' ), 'Create test file' );
25
 
        print $fh "foo";
26
 
        close $fh;
27
 
        is( -s 't/files/padre-file-test', 3, 'Check test file size' );
28
 
 
29
 
        my $file = Padre::File->new('t/files/padre-file-test');
30
 
        ok( defined($file), 'Create Padre::File object' );
31
 
        ok( $file->exists,  'File exists' );
32
 
 
33
 
        # Now we have a Padre::File object and a testfile to play with...
34
 
 
35
 
        $file->{filename} = 'T/Files/Padre-File-Test';
36
 
        $file->_reformat_filename;
37
 
        is( $file->{filename}, 't\files\Padre-File-Test', 'Correct wrong case' );
38
 
 
39
 
        $file->{filename} = 'T\Files\Padre-File-Test';
40
 
        $file->_reformat_filename;
41
 
        is( $file->{filename}, 't\files\Padre-File-Test', 'Correct wrong case' );
42
 
 
43
 
        my $Crap = 'X:\foo\bar\padre-nonexistent\testfile';
44
 
        $file->{filename} = $Crap;
45
 
        $file->_reformat_filename;
46
 
        is( $file->{filename}, $Crap, 'Keep the filename on nonexistent file' );
47
 
 
48
 
}
49
 
 
50
 
END {
51
 
        unlink 't/files/padre-file-test';
52
 
}