Ejemplo n.º 1
0
 public void BracesInSingleLineCommentsAreIgnored()
 {
     String input = @"
     some string() // this is a comment with (){}[] braces
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(2, chars.Count);
 }
Ejemplo n.º 2
0
 public void BracesInSingleQuotedStringsAreIgnored()
 {
     String input = @"
     '../fonts/glyphicons-halflings-regular.eot (){}'
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(0, chars.Count);
 }
Ejemplo n.º 3
0
 public void BracesInCommentsAreIgnored()
 {
     String input = @"
     /* this is a comment with (){}[] braces */
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(0, chars.Count);
 }
Ejemplo n.º 4
0
 public void BracesInMultilineStringsAreIgnored()
 {
     String input = @"
     '../fonts/glyphicons-halflings-regular.eot \
     some other string (){} \
     with more stuff'
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(0, chars.Count);
 }
Ejemplo n.º 5
0
 public void CanHandleEscapeSequencesInSingleQuotedStrings()
 {
     String input = @"
     '\123eab../fonts/glyphicons-halflings-regular.eot\'(){}\''
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(0, chars.Count);
 }
Ejemplo n.º 6
0
 public void SimpleRule()
 {
     String input = @"
     audio,
     canvas,
     video {
       display: inline-block;
     }";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(2, chars.Count);
 }
Ejemplo n.º 7
0
 public void ComplexRule()
 {
     String input = @"
     .btn-group > .btn + .dropdown-toggle {
       padding-right: 8px;
       padding-left: 8px;
     }
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(2, chars.Count);
 }
Ejemplo n.º 8
0
 public void CompleteComplexRule1()
 {
     String input = @"
     @font-face {
       font-family: 'Glyphicons Halflings';
       src: url('../fonts/glyphicons-halflings-regular.eot');
       src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
     }
     ";
       var extractor = new CssBraceScanner();
       var chars = Extract(extractor, input.Trim(), 0, 0);
       Assert.Equal(2+2+8*2, chars.Count);
 }