<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -26,7 +26,6 @@ var LiquidMetal = function() {
       if (abbreviation.length &gt; string.length) return SCORE_NO_MATCH;
 
       var scores = this.buildScoreArray(string, abbreviation);
-      // console.log(string + &quot; ~ &quot; + abbreviation + &quot; : &quot; + scores);
 
       var sum = 0.0;
       for (var i in scores) {</diff>
      <filename>liquidmetal.js</filename>
    </modified>
    <modified>
      <diff>@@ -11,42 +11,62 @@
     &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
     &lt;script src=&quot;liquidmetal.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
     &lt;script type=&quot;text/javascript&quot;&gt;
+      function log(message) { if (console &amp;&amp; console.log) console.log(message); }
+
       $(document).ready(function() {
-        function shouldScore(expected, string, abbreviation) {
+        function shouldScore(charScores, string, abbreviation) {
+          var sum = 0.0;
+          for (var s in charScores) { sum += charScores[s]; }
+          var expectedScore = Math.round(sum / charScores.length * 1000) / 1000;
+
           var score = LiquidMetal.score(string, abbreviation);
+          var scoreArray = LiquidMetal.buildScoreArray(string, abbreviation);
           var roundedScore = Math.round(score*1000)/1000;
-          var pass = (expected == roundedScore);
+
+          var pass = (expectedScore == roundedScore);
           var result = (pass) ? &quot;pass&quot; : &quot;fail&quot;;
 
+          log(string + &quot; ~ &quot; + abbreviation + &quot; : &quot; + scoreArray);
+
           var desc = &quot;.&quot;
           if (!pass) {
-            desc = &quot;LiquidMetal.score('&quot; + string + &quot;', '&quot; + abbreviation + &quot;') should match &quot; + expected + &quot; but was &quot; + score;
+            desc = &quot;LiquidMetal.score('&quot; + string + &quot;', '&quot; + abbreviation + &quot;') should match &quot; + expectedScore + &quot; but was &quot; + score;
           }
+
           $(&quot;body&quot;).append($(&quot;&lt;div&gt;&lt;/div&gt;&quot;).addClass(result).text(desc));
         }
 
-        shouldScore(0.8, &quot;&quot;, &quot;&quot;);
-        shouldScore(0.0, &quot;&quot;, &quot;a&quot;);
-        shouldScore(0.8, &quot;a&quot;, &quot;&quot;);
-        shouldScore(0.0, &quot;a&quot;, &quot;toolong&quot;);
-        shouldScore(1.0, &quot;a&quot;, &quot;a&quot;);
-        shouldScore(0.0, &quot;a&quot;, &quot;b&quot;);
-        shouldScore(0.8, &quot;abc&quot;, &quot;&quot;);
-        shouldScore(0.933, &quot;abc&quot;, &quot;a&quot;);
-        shouldScore(0.6, &quot;abc&quot;, &quot;b&quot;);
-        shouldScore(0.333, &quot;abc&quot;, &quot;c&quot;);
-        shouldScore(1.0, &quot;A&quot;, &quot;a&quot;);
-        shouldScore(0.8, &quot;FooBar&quot;, &quot;&quot;);
-        shouldScore(0.95, &quot;FooBar&quot;, &quot;foo&quot;);
-        shouldScore(0.917, &quot;FooBar&quot;, &quot;fb&quot;);
-        shouldScore(0.858, &quot;FooBar&quot;, &quot;b&quot;);
-        shouldScore(0.667, &quot;FooBar&quot;, &quot;ooar&quot;);
-        shouldScore(0.8, &quot;Foo Bar&quot;, &quot;&quot;);
-        shouldScore(0.943, &quot;Foo Bar&quot;, &quot;foo&quot;);
-        shouldScore(0.929, &quot;Foo Bar&quot;, &quot;fb&quot;);
-        shouldScore(0.879, &quot;Foo Bar&quot;, &quot;b&quot;);
-        shouldScore(0.571, &quot;Foo Bar&quot;, &quot;ooar&quot;);
-        shouldScore(0.0, &quot;Foo Bar&quot;, &quot;bab&quot;);
+        var n = 0.0;   // no match
+        var m = 1.0;   // match
+        var t = 0.8;   // trailing
+        var s = 0.9;   // special trailing
+        var b = 0.85;  // buffer
+
+        shouldScore([t],             &quot;&quot;,        &quot;&quot;);
+        shouldScore([n],             &quot;&quot;,        &quot;a&quot;);
+        shouldScore([t],             &quot;a&quot;,       &quot;&quot;);
+        shouldScore([n],             &quot;a&quot;,       &quot;toolong&quot;);
+        shouldScore([m],             &quot;a&quot;,       &quot;a&quot;);
+        shouldScore([n],             &quot;a&quot;,       &quot;b&quot;);
+        shouldScore([t,t,t],         &quot;abc&quot;,     &quot;&quot;);
+        shouldScore([m,s,s],         &quot;abc&quot;,     &quot;a&quot;);
+        shouldScore([n,m,t],         &quot;abc&quot;,     &quot;b&quot;);
+        shouldScore([n,n,m],         &quot;abc&quot;,     &quot;c&quot;);
+        shouldScore([n,n,n],         &quot;abc&quot;,     &quot;d&quot;);
+        shouldScore([m],             &quot;A&quot;,       &quot;a&quot;);
+        shouldScore([n],             &quot;A&quot;,       &quot;b&quot;);
+        shouldScore([t,t,t,t,t,t],   &quot;FooBar&quot;,  &quot;&quot;);
+        shouldScore([m,m,m,s,s,s],   &quot;FooBar&quot;,  &quot;foo&quot;);
+        shouldScore([m,b,b,m,s,s],   &quot;FooBar&quot;,  &quot;fb&quot;);
+        shouldScore([b,b,b,m,t,t],   &quot;FooBar&quot;,  &quot;b&quot;);
+        shouldScore([n,m,m,n,m,m],   &quot;FooBar&quot;,  &quot;ooar&quot;);
+        shouldScore([n,n,n,n,n,n],   &quot;FooBar&quot;,  &quot;bab&quot;);
+        shouldScore([t,t,t,t,t,t,t], &quot;Foo Bar&quot;, &quot;&quot;);
+        shouldScore([m,m,m,s,s,s,s], &quot;Foo Bar&quot;, &quot;foo&quot;);
+        shouldScore([m,b,b,m,m,s,s], &quot;Foo Bar&quot;, &quot;fb&quot;);
+        shouldScore([b,b,b,m,m,t,t], &quot;Foo Bar&quot;, &quot;b&quot;);
+        shouldScore([n,m,m,n,n,m,m], &quot;Foo Bar&quot;, &quot;ooar&quot;);
+        shouldScore([n,n,n,n,n,n,n], &quot;Foo Bar&quot;, &quot;bab&quot;);
       });
     &lt;/script&gt;
   &lt;/head&gt;</diff>
      <filename>test.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2ed22ccd7be3eac2479675ad31c9fd7f8d36b9f2</id>
    </parent>
  </parents>
  <author>
    <name>Ryan McGeary</name>
    <email>ryanongit@mcgeary.org</email>
  </author>
  <url>http://github.com/rmm5t/liquidmetal/commit/78f7723cd096c7c01db407170848f4ed3feddae0</url>
  <id>78f7723cd096c7c01db407170848f4ed3feddae0</id>
  <committed-date>2009-02-07T08:27:44-08:00</committed-date>
  <authored-date>2009-02-07T08:27:44-08:00</authored-date>
  <message>Made tests a little less brittle against algorithm changes</message>
  <tree>bec788347ab75560919181c492650a5964384e56</tree>
  <committer>
    <name>Ryan McGeary</name>
    <email>ryanongit@mcgeary.org</email>
  </committer>
</commit>
