test('removeLeading',

  [
    'ephox.katamari.api.Strings'
  ],

  function(Strings) {

    function check(expected, str, trail) {
        var actual = Strings.removeLeading(str, trail);
        assert.eq(expected, actual);
    }

    check("", "", "");
    check("cat", "cat", "");
    check("", "", "/");
    check("cat", "/cat", "/");
    check("", "cat/", "cat/");

    check("dog", "catdog", "cat");
  }
);


@@ -52,16 +52,38 @@
 Strings'
+,%0A    'ephox.wrap.Jsc'
 %0A  %5D,%0A%0A 
@@ -99,16 +99,21 @@
 (Strings
+, Jsc
 ) %7B%0A%0A   
@@ -152,18 +152,16 @@
 rail) %7B%0A
-  
       va
@@ -212,18 +212,16 @@
 ;%0A      
-  
 assert.e
@@ -262,18 +262,18 @@
 eck(
-%22%22, %22%22, %22%22
+'', '', ''
 );%0A 
@@ -285,24 +285,24 @@
 eck(
-%22cat%22, %22cat%22, %22%22
+'cat', 'cat', ''
 );%0A 
@@ -314,19 +314,19 @@
 eck(
-%22%22, %22%22, %22/%22
+'', '', '/'
 );%0A 
@@ -338,26 +338,26 @@
 eck(
-%22cat%22, %22
+'cat', '
 /cat
-%22, %22/%22
+', '/'
 );%0A 
@@ -369,26 +369,26 @@
 eck(
-%22%22, %22
+'', '
 cat/
-%22, %22
+', '
 cat/
-%22
+'
 );%0A%0A
@@ -401,30 +401,681 @@
 eck(
-%22dog%22, %22
+'dog', '
 catdog
-%22, %22cat%22
+', 'cat');%0A%0A    Jsc.property(%0A      'startsWith(removeLeading(str, s1), s1) === false',%0A      Jsc.asciistring,%0A      Jsc.asciinestring,%0A      function (str, s1) %7B%0A        var doubleStart = Strings.startsWith(str, s1) && Strings.startsWith(str.substring(s1.length), s1);%0A        return Jsc.eq(%0A          doubleStart,%0A          Strings.startsWith(%0A            Strings.removeLeading(str, s1),%0A            s1%0A          )%0A        );%0A      %7D%0A    );%0A%0A    Jsc.property(%0A      'removeLeading(s1 + str, s1) === str',%0A      Jsc.asciistring,%0A      Jsc.asciinestring,%0A      function (str, s1) %7B%0A        return Jsc.eq(str, Strings.removeLeading(s1 + str, s1));%0A      %7D%0A    
 );%0A 

remove leading