Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: third_party/pyscss/scss/tests/test_if.py

Issue 9111023: Pyscss is obsolete with Dart CSS complier; remove all pyscss code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove pyparsing from .gitignore Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 import unittest
2
3 from scss.parser import Stylesheet
4
5
6 class TestSCSS( unittest.TestCase ):
7
8 def setUp(self):
9 self.parser = Stylesheet(options=dict(compress=True))
10
11 def test_if(self):
12 src = """
13 $type: monster;
14 $test: 9px;
15
16 $rec: true;
17 $rec2: $rec or true;
18 $rec3: $rec or true;
19 $rec: $rec2 or $rec3;
20
21 @if $test + 2 > 10 {
22 @if $rec {
23 .test { border: 2px; }
24 }
25 }
26
27 @mixin test($fix: true) {
28 @if $fix {
29 display: block;
30 } @else {
31 display: none;
32 }
33 }
34 span {
35 @include test(false)
36 }
37 p {
38 @if $type == girl {
39 color: pink;
40 }
41 @else if $type == monster {
42 color: red;
43 b { border: 2px; }
44 }
45 @else {
46 color: blue;
47 }
48 }
49 """
50 test = ".test{border:2px}span{display:none}p{color:#f00}p b{border:2px}"
51 out = self.parser.loads(src)
52 self.assertEqual(test, out)
OLDNEW
« no previous file with comments | « third_party/pyscss/scss/tests/test_functions.py ('k') | third_party/pyscss/scss/tests/test_mixin.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698