diff --git a/core/tests/Drupal/Tests/Component/Diff/Engine/DiffEngineTest.php b/core/tests/Drupal/Tests/Component/Diff/Engine/DiffEngineTest.php
new file mode 100644
index 0000000..3558aad
--- /dev/null
+++ b/core/tests/Drupal/Tests/Component/Diff/Engine/DiffEngineTest.php
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Component\Diff\DiffTest.
+ */
+
+namespace Drupal\Tests\Component\Engine;
+
+use Drupal\Component\Diff\Engine\DiffEngine;
+
+/**
+ * Test DiffEngine class.
+ *
+ * @coversDefaultClass \Drupal\Component\Diff\Engine\DiffEngine
+ *
+ * @group Diff
+ */
+class DiffEngineTest extends \PHPUnit_Framework_TestCase {
+
+  /**
+   * @return array
+   *   - Expected output in terms of return class. A list of class names
+   *     expected to be returned by DiffEngine::diff().
+   *   - An array of strings to change from.
+   *   - An array of strings to change to.
+   */
+  public function provideTestDiff() {
+    return [
+      [[], [], []],
+      [['Drupal\Component\Diff\Engine\DiffOpAdd'], [], ['a']],
+      [['Drupal\Component\Diff\Engine\DiffOpCopy'], ['a'], ['a']],
+      [['Drupal\Component\Diff\Engine\DiffOpChange'], ['a'], ['b']],
+      [
+        [
+          'Drupal\Component\Diff\Engine\DiffOpCopy',
+          'Drupal\Component\Diff\Engine\DiffOpChange',
+        ],
+        ['a', 'b'],
+        ['a', 'c'],
+      ],
+      [
+        [
+          'Drupal\Component\Diff\Engine\DiffOpCopy',
+          'Drupal\Component\Diff\Engine\DiffOpChange',
+          'Drupal\Component\Diff\Engine\DiffOpCopy',
+        ],
+        ['a', 'b', 'd'],
+        ['a', 'c', 'd'],
+      ],
+      [
+        [
+          'Drupal\Component\Diff\Engine\DiffOpCopy',
+          'Drupal\Component\Diff\Engine\DiffOpChange',
+          'Drupal\Component\Diff\Engine\DiffOpCopy',
+          'Drupal\Component\Diff\Engine\DiffOpAdd'
+        ],
+        ['a', 'b', 'd'],
+        ['a', 'c', 'd', 'e'],
+      ],
+      [
+        [
+          'Drupal\Component\Diff\Engine\DiffOpCopy',
+          'Drupal\Component\Diff\Engine\DiffOpDelete',
+        ],
+        ['a', 'b', 'd'],
+        ['a'],
+      ],
+    ];
+  }
+
+  /**
+   * Tests whether op classes returned by DiffEngine::diff() match expectations.
+   *
+   * @covers ::diff
+   * @dataProvider provideTestDiff
+   */
+  public function testDiff($expected, $from, $to) {
+    $diff_engine = new DiffEngine();
+    $diff = $diff_engine->diff($from, $to);
+    // Make sure we have the same number of results as expected.
+    $this->assertCount(count($expected), $diff);
+    // Make sure the diff objects match our expectations.
+    foreach ($expected as $index => $op_class) {
+      $this->assertEquals($op_class, get_class($diff[$index]));
+    }
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Component/Diff/Engine/DiffOpTest.php b/core/tests/Drupal/Tests/Component/Diff/Engine/DiffOpTest.php
new file mode 100644
index 0000000..cde9a30
--- /dev/null
+++ b/core/tests/Drupal/Tests/Component/Diff/Engine/DiffOpTest.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Component\Diff\Engine\DiffOpTest.
+ */
+
+namespace Drupal\Tests\Component\Diff\Engine;
+
+use Drupal\Component\Diff\Engine\DiffOp;
+
+/**
+ * Test DiffOp base class.
+ *
+ * The only significant behavior here is that ::reverse() should throw an error
+ * if not overridden. In versions of this code in other projects, reverse() is
+ * marked as abstract, which enforces some of this behavior.
+ *
+ * @coversDefaultClass \Drupal\Component\Diff\Engine\DiffOp
+ *
+ * @group Diff
+ */
+class DiffOpTest extends \PHPUnit_Framework_TestCase {
+
+  /**
+   * DiffOp::reverse() always throws an error.
+   *
+   * @covers ::reverse
+   * @expectedException \PHPUnit_Framework_Error
+   */
+  public function testReverse() {
+    $op = new DiffOp();
+    $result = $op->reverse();
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php b/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php
new file mode 100644
index 0000000..b6e8371
--- /dev/null
+++ b/core/tests/Drupal/Tests/Component/Diff/Engine/HWLDFWordAccumulatorTest.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Component\Diff\Engine\DiffOpTest.
+ */
+
+namespace Drupal\Tests\Component\Diff\Engine;
+
+use Drupal\Component\Diff\Engine\HWLDFWordAccumulator;
+
+/**
+ * Test HWLDFWordAccumulator.
+ *
+ * @coversDefaultClass \Drupal\Component\Diff\Engine\HWLDFWordAccumulator
+ *
+ * @group Diff
+ */
+class HWLDFWordAccumulatorTest extends \PHPUnit_Framework_TestCase {
+
+  /**
+   * Verify that we only get back a NBSP from an empty accumulator.
+   *
+   * @covers ::getLines
+   *
+   * @see Drupal\Component\Diff\Engine\HWLDFWordAccumulator::NBSP
+   */
+  public function testGetLinesEmpty() {
+    $acc = new HWLDFWordAccumulator();
+    $this->assertEquals(['&#160;'], $acc->getLines());
+  }
+
+  /**
+   * @return array
+   *   - Expected array of lines from getLines().
+   *   - Array of strings for the $words parameter to addWords().
+   *   - String tag for the $tag parameter to addWords().
+   */
+  public function provideAddWords() {
+    return [
+      [['wordword2'], ['word', 'word2'], 'tag'],
+      [['word', 'word2'], ['word', "\nword2"], 'tag'],
+      [['&#160;', 'word2'], ['', "\nword2"], 'tag'],
+    ];
+  }
+
+  /**
+   * @covers ::addWords
+   * @dataProvider provideAddWords
+   */
+  public function testAddWords($expected, $words, $tag) {
+    $acc = new HWLDFWordAccumulator();
+    $acc->addWords($words, $tag);
+    $this->assertEquals($expected, $acc->getLines());
+  }
+
+}
