sass 3.3.0.alpha.16 → 3.3.0.alpha.50

Sign up to get free protection for your applications and to get access to all the features.
@@ -310,4 +310,45 @@ class UtilTest < Test::Unit::TestCase
310
310
  "UtilTest::FooBar must implement #foo") {FooBar.new.foo}
311
311
  end
312
312
 
313
+ def test_json_escape_string
314
+ assert_json_string "", ""
315
+ alphanum = (("0".."9").to_a).concat(("a".."z").to_a).concat(("A".."Z").to_a).join
316
+ assert_json_string alphanum, alphanum
317
+ assert_json_string "'\"\\/'", "'\\\"\\\\\\/'"
318
+ assert_json_string "\b\f\n\r\t", "\\b\\f\\n\\r\\t"
319
+ end
320
+
321
+ def assert_json_string(source, target)
322
+ assert_equal target, json_escape_string(source)
323
+ end
324
+
325
+ def test_json_value_of
326
+ assert_json_value 0, "0"
327
+ assert_json_value -42, "-42"
328
+ assert_json_value 42, "42"
329
+ assert_json_value true, "true"
330
+ assert_json_value false, "false"
331
+ assert_json_value "", "\"\""
332
+ assert_json_value "\"\"", "\"\\\"\\\"\""
333
+ assert_json_value "Multi\nLine\rString", "\"Multi\\nLine\\rString\""
334
+ assert_json_value [1, "some\nstr,ing", false, nil], "[1,\"some\\nstr,ing\",false,null]"
335
+ end
336
+
337
+ def assert_json_value(source, target)
338
+ assert_equal target, json_value_of(source)
339
+ end
340
+
341
+ def test_vlq
342
+ assert_equal "A", encode_vlq(0)
343
+ assert_equal "e", encode_vlq(15)
344
+ assert_equal "gB", encode_vlq(16)
345
+ assert_equal "wH", encode_vlq(120)
346
+ end
347
+
348
+ def assert_vlq_encodes(int, vlq)
349
+ vlq_from_decimal_array = decimal_array.map {|d| encode_vlq(d)}.join
350
+ decimal_array_from_vlq = decode_vlq(vlq)
351
+ assert_equal vlq, vlq_from_decimal_array
352
+ assert_equal decimal_array, decimal_array_from_vlq
353
+ end
313
354
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 592302893
4
+ hash: 592302953
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 16
12
- version: 3.3.0.alpha.16
11
+ - 50
12
+ version: 3.3.0.alpha.50
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2012-11-09 00:00:00 -05:00
22
+ date: 2012-11-29 00:00:00 -05:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -171,6 +171,9 @@ files:
171
171
  - lib/sass/util/multibyte_string_scanner.rb
172
172
  - lib/sass/util/subset_map.rb
173
173
  - lib/sass/version.rb
174
+ - lib/sass/source/map.rb
175
+ - lib/sass/source/position.rb
176
+ - lib/sass/source/range.rb
174
177
  - vendor/listen/CHANGELOG.md
175
178
  - vendor/listen/Gemfile
176
179
  - vendor/listen/Guardfile
@@ -324,6 +327,7 @@ files:
324
327
  - test/sass/util/multibyte_string_scanner_test.rb
325
328
  - test/sass/util/subset_map_test.rb
326
329
  - test/sass/util_test.rb
330
+ - test/sass/source_map_test.rb
327
331
  - test/test_helper.rb
328
332
  - extra/update_watch.rb
329
333
  - Rakefile
@@ -393,3 +397,4 @@ test_files:
393
397
  - test/sass/util/multibyte_string_scanner_test.rb
394
398
  - test/sass/util/subset_map_test.rb
395
399
  - test/sass/util_test.rb
400
+ - test/sass/source_map_test.rb