#!/usr/bin/env ruby require File.expand_path(File.dirname(__FILE__) + '/../test_helper') require 'xhtmldiff' class DiffTest < Test::Unit::TestCase def setup end def diff(a,b) diff_doc = REXML::Document.new diff_doc << (div = REXML::Element.new 'div' ) hd = XHTMLDiff.new(div) parsed_a = REXML::HashableElementDelegator.new( REXML::XPath.first(REXML::Document.new("
this was the original string
" b = "this is
\nthe new string
\naround the world
" assert_equal( " this was is" +
" the original string
the new string
" + "\naround the world
this is a paragraph
\nthis is a second paragraph
\nthis is a third paragraph
" b = "this is a paragraph
\nthis is a third paragraph
" assert_equal( "this is a paragraph
\nthis is a second paragraph
this is a third paragraph
foo bar
" b = "foo
bar
" assert_equal( " foo bar
bar
foo
bar
" b = "foo bar
" assert_equal( "foo bar
" + "bar
foo bar
" b = "foo bar
" assert_equal( " foo bar" +
"bar
a\nb\nc\n" b = "
a\n" assert_equal( "
a\nb\nc\n