<?xml version = "1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
<!-- 
	See COPYING for copyright and distribution information.
-->
<html xmlns = "http://www.w3.org/1999/xhtml">

<head>
	<title>NDN Name</title>
	
	<script type="text/javascript" src="../build/ndn-js.js"></script>

	<script type="text/javascript">
	
function testName() {
    var result = document.getElementById('result');
    result.innerHTML = "";
    
    var comp1 = new Uint8Array(1); 
    comp1.set(['.'.charCodeAt(0)]);
    
    var ab2 = new ArrayBuffer(4); 
    var comp2 = new Uint8Array(ab2); 
    comp2.set([0x00, 0x01, 0x02, 0x03]);

    // \u00E9 is e with accent.
    var entree = "entr\u00E9e";

    // When Name constructor is passed an array, each item is a name component represented with ArrayBuffer, 
    //   typed array, or string (parsed as UTF-8)
    var name1 = new Name([entree, comp1, ab2]);
    var name1Uri = name1.to_uri();
    var name1UriExpected = "/entr%C3%A9e/..../%00%01%02%03";
    result.innerHTML += "Name from '" + entree + "', Uint8Array of '.' and ArrayBuffer of 0,1,2,3:<br/>";
    if (name1Uri == name1UriExpected)
        result.innerHTML += "SUCCESS: " + name1Uri + ".<br/>";
    else
        result.innerHTML += "ERROR: got " + name1Uri + ", expected " + name1UriExpected + " .<br/>";

    result.innerHTML += "Compare with same Name from '" + entree + "', '.' and ArrayBuffer:<br/>";
    // Equivalent with name1
    var name2 = new Name([entree, ".", comp2]);
    if (name2.components.length != name1.components.length)
        result.innerHTML += "ERROR: Got name with " + name2.components.length + 
            " components, expected " + name1.components.length + ".<br/>";
    else {
        var allEqual = true;
        for (var i = 0; i < name1.components.length; ++i) {
            if (!DataUtils.arraysEqual(name1.components[i], name2.components[i])) {
                allEqual = false;
                result.innerHTML += "ERROR: Names differ at component at index " + i + ".<br/>";
            }
        }
        if (allEqual)
            result.innerHTML += "SUCCESS: Names are equal.<br/>";
    }
    
    result.innerHTML += "Compare with same Name from URI:<br/>";
    // Equivalent with name1; when Name constructor is passed a string, it is treated as a URI
    var name3 = new Name("/entr%C3%A9e/..../%00%01%02%03");
    if (name3.components.length != name1.components.length)
        result.innerHTML += "ERROR: Got name with " + name3.components.length + 
            " components, expected " + name1.components.length + ".<br/>";
    else {
        var allEqual = true;
        for (var i = 0; i < name1.components.length; ++i) {
            if (!DataUtils.arraysEqual(name1.components[i], name3.components[i])) {
                allEqual = false;
                result.innerHTML += "ERROR: Names differ at component at index " + i + ".<br/>";
            }
        }
        if (allEqual)
            result.innerHTML += "SUCCESS: Names are equal.<br/>";
    }    
    
    result.innerHTML += "Compare with Name prefix of first 2 components:<br/>";
    // Returns new Name([entree, "."])
    var name4 = name2.getPrefix(2);
    if (name4.components.length != 2)
        result.innerHTML += "ERROR: Got name with " + name4.components.length + 
            " components, expected 2.<br/>";
    else {
        var allEqual = true;
        for (var i = 0; i < name4.components.length; ++i) {
            if (!DataUtils.arraysEqual(name1.components[i], name4.components[i])) {
                allEqual = false;
                result.innerHTML += "ERROR: Names differ at component at index " + i + ".<br/>";
            }
        }
        if (allEqual)
            result.innerHTML += "SUCCESS: First 2 components are equal: " + name4.to_uri() + " .<br/>";
    }    
    
    result.innerHTML += "Check with Name component at index 2:<br/>";
    // Returns ArrayBuffer of "%00%01%02%03"
    var component2Out = new Uint8Array(name1.getComponent(2));
    if (DataUtils.arraysEqual(component2Out, comp2))
        result.innerHTML += "SUCCESS: Components at index 2 are equal.<br/>";
    else
        result.innerHTML += "ERROR: Components at index 2 are different.<br/>";
    
    var name5 = new Name("/localhost/user/folders/files/%00%0F");
    result.innerHTML += "Check chaining calls to add() to create Name: " + name5.to_uri() + "<br/>";
    if (name5.equalsName(new Name(new Name("/localhost")).add(new Name("/user/folders")).add
          ("files").addSegment(15)))
        result.innerHTML += "SUCCESS: Names are equal.<br/>";
    else
        result.innerHTML += "ERROR: Names are different.<br/>";
}

	</script>

</head>
<body >
	<button onclick="testName()">Test</button>
	
	<p id="result"></p>

</body>
</html>
