Skip to content

Commit f2f5e8a

Browse files
committed
Changes after libsass interface PR got merged
1 parent 2c94a78 commit f2f5e8a

File tree

8 files changed

+92
-29
lines changed

8 files changed

+92
-29
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "libsass"]
22
path = libsass
3-
url = git://github.com/mgreter/libsass.git
3+
url = git://github.com/sass/libsass.git
44
[submodule "t/sass-spec"]
55
path = t/sass-spec
66
url = git://github.com/sass/sass-spec.git

Build.PL

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ my $cover = $ARGV[0] && $ARGV[0] eq "cover=1" ? 1 : 0;
8080
my %config = (
8181
module_name => 'CSS::Sass',
8282
license => 'perl',
83-
dist_author => q{David Caldwell <[email protected]>},
83+
dist_author => [q{David Caldwell <[email protected]>},
84+
q{Marcel Greter <[email protected]>}],
8485
dist_version_from => 'lib/CSS/Sass.pm',
8586
release_status => 'stable',
8687
create_license => 1,

lib/CSS/Sass.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright © 2013 David Caldwell.
2+
# Copyright © 2013 Marcel Greter.
23
#
34
# This library is free software; you can redistribute it and/or modify
45
# it under the same terms as Perl itself, either Perl version 5.12.4 or,
@@ -308,17 +309,19 @@ L<CSS::Sass::Type>
308309
309310
L<The Sass Home Page|http://sass-lang.com/>
310311
311-
L<The libsass Home Page|https://github.com/hcatlin/libsass>
312+
L<The libsass Home Page|https://github.com/sass/libsass>
312313
313-
L<The CSS::Sass Home Page|https://github.com/caldwell/CSS-Sass>
314+
L<The CSS::Sass Home Page|https://github.com/sass/perl-libsass>
314315
315316
=head1 AUTHOR
316317
317318
David Caldwell E<lt>[email protected]E<gt>
319+
Marcel Greter E<lt>[email protected]E<gt>
318320
319321
=head1 COPYRIGHT AND LICENSE
320322
321323
Copyright (C) 2013 by David Caldwell
324+
Copyright (C) 2014 by Marcel Greter
322325
323326
This library is free software; you can redistribute it and/or modify
324327
it under the same terms as Perl itself, either Perl version 5.12.4 or,

lib/CSS/Sass.xs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright © 2013 David Caldwell.
2+
// Copyright © 2014 Marcel Greter.
23
//
34
// This library is free software; you can redistribute it and/or modify
45
// it under the same terms as Perl itself, either Perl version 5.12.4 or,

lib/CSS/Sass/Type.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2013 David Caldwell, All Rights Reserved. -*- cperl -*-
1+
# Copyright (c) 2013 David Caldwell,
2+
# Copyright (c) 2013 Marcel Greter,
3+
# All Rights Reserved. -*- cperl -*-
24

35
use strict; use warnings;
46

libsass

Submodule libsass updated from 0dbcec4 to b1ce9a8

t/99_sass_specs.t

Lines changed: 78 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
# -*- perl -*-
22

3-
# Usefult for debugging the xs with prints:
4-
# cd text-sass-xs && ./Build && perl -Mlib=blib/arch -Mlib=blib/lib t/04_perl_functions.t
5-
63
use strict;
74
use warnings;
85

9-
my (@dirs, @tests);
6+
my (@dirs, @tests, @todos);
107

118
BEGIN
129
{
1310

11+
our $todo = 0;
12+
my $skip_todo = 0;
13+
1414
@dirs = ('t/sass-spec/spec');
1515

1616
while (my $dir = shift(@dirs))
1717
{
1818
opendir(my $dh, $dir) or die "error opening specs dir $dir";
1919
while (my $ent = readdir($dh))
2020
{
21+
local $todo = $todo;
2122
next if $ent eq ".";
2223
next if $ent eq "..";
23-
next if $ent eq "todo";
24+
$todo = $todo || $ent eq "todo" ||
25+
$ent eq "libsass-todo-tests" ||
26+
$ent eq "libsass-todo-issues";
2427
my $path = join("/", $dir, $ent);
28+
next if($skip_todo && $todo);
2529
push @dirs, $path if -d $path;
26-
push @tests, [$dir, $ent] if $ent =~ m/^input/;
30+
if ($ent =~ m/^input\./)
31+
{
32+
push @tests, [$dir, $ent];
33+
}
2734
}
2835
closedir($dh);
2936
}
@@ -32,7 +39,7 @@ BEGIN
3239

3340
}
3441

35-
use Test::More tests => scalar(@tests) * 2;
42+
use Test::More tests => scalar @tests;
3643

3744
use CSS::Sass;
3845

@@ -48,25 +55,74 @@ my ($r, $err);
4855
my ($src, $expect);
4956
my $ignore_whitespace = 1;
5057

58+
my @false_negatives;
59+
5160
foreach my $test (@tests)
5261
{
5362
my $input_file = join("/", @{$test});
5463
my $expected_file = join("/", $test->[0], 'expected_output.css');
5564

56-
$sass = CSS::Sass->new(include_paths => ['t/inc'], output_style => SASS_STYLE_NESTED);
57-
$r = eval { $sass->compile_file($input_file) };
58-
warn $@ if $@;
59-
$expect = read_file($expected_file);
60-
$expect =~ s/[\r\n]+/\n/g if $ignore_whitespace;
61-
$r =~ s/[\r\n]+/\n/g if $ignore_whitespace;
62-
# output format seems to be off by some newlines
63-
# ignore for now as the meaning does not change
64-
$expect =~ s/[\s]+//g if $ignore_whitespace;
65-
$r =~ s/[\s]+//g if $ignore_whitespace;
66-
chomp($expect) if $ignore_whitespace;
67-
chomp($r) if $ignore_whitespace;
68-
69-
is ($r, $expect, "sass-spec " . $input_file);
70-
is ($err, undef, "sass-spec " . $input_file);
65+
die "no expected file" unless defined $expected_file;
66+
67+
if ($input_file =~ m/todo/)
68+
{
69+
$sass = CSS::Sass->new(include_paths => ['t/inc'], output_style => SASS_STYLE_NESTED);
70+
$r = eval { $sass->compile_file($input_file) };
71+
$err = $@;
72+
$expect = read_file($expected_file);
73+
$expect =~ s/[\r\n]+/\n/g if $ignore_whitespace;
74+
$expect =~ s/[\s]+//g if $ignore_whitespace;
75+
chomp($expect) if $ignore_whitespace;
76+
if (defined $r)
77+
{
78+
$r =~ s/[\r\n]+/\n/g if $ignore_whitespace;
79+
$r =~ s/[\s]+//g if $ignore_whitespace;
80+
chomp($r) if $ignore_whitespace;
81+
}
82+
83+
my $is_expected = defined $r && $r eq $expect && !$err ? 1 : 0;
84+
is ($is_expected, 0, "sass todo text unexpectedly passed: " . $input_file);
85+
push @false_negatives, $input_file if $is_expected;
86+
87+
}
88+
else
89+
{
90+
$sass = CSS::Sass->new(include_paths => ['t/inc'], output_style => SASS_STYLE_NESTED);
91+
$r = eval { $sass->compile_file($input_file) };
92+
$err = $@; warn $@ if $@;
93+
$expect = read_file($expected_file);
94+
$expect =~ s/[\r\n]+/\n/g if $ignore_whitespace;
95+
$expect =~ s/[\s]+//g if $ignore_whitespace;
96+
chomp($expect) if $ignore_whitespace;
97+
if (defined $r)
98+
{
99+
$r =~ s/[\r\n]+/\n/g if $ignore_whitespace;
100+
$r =~ s/[\s]+//g if $ignore_whitespace;
101+
chomp($r) if $ignore_whitespace;
102+
}
103+
104+
is ($r, $expect, "sass-spec " . $input_file);
105+
106+
}
71107

72108
}
109+
110+
__DATA__
111+
112+
require File::Basename;
113+
require File::Spec::Functions;
114+
115+
# print git mv commands
116+
warn join "\n", (map {
117+
$_ =~ s/\/+/\\/g;
118+
$_ =~ s /\\input\.[a-z]+$//;
119+
my $org = $_;
120+
my $root = File::Basename::dirname($org);
121+
$_ =~ s /\\libsass\-todo\-(?:tests|issues)//;
122+
sprintf("pushd \"%s\"\n", $root).
123+
sprintf("git mv %s %s\n",
124+
File::Spec->rel2abs($org, $root),
125+
File::Spec->abs2rel($_, $root)
126+
).
127+
sprintf("popd\n");
128+
} @false_negatives), "\n";

t/sass-spec

Submodule sass-spec updated 776 files

0 commit comments

Comments
 (0)