package org.basex.qt3ts.fn;

import org.basex.tests.bxapi.*;
import org.basex.tests.qt3ts.*;

/**
 * Tests for the iri-to-uri() function.
 *
 * @author BaseX Team 2005-15, BSD License
 * @author Leo Woerteler
 */
@SuppressWarnings("all")
public class FnIriToUri extends QT3TestSet {

  /**
   *  A test whose essence is: `iri-to-uri()`. .
   */
  @org.junit.Test
  public void kIRIToURIfunc1() {
    final XQuery query = new XQuery(
      "iri-to-uri()",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPST0017")
    );
  }

  /**
   *  A test whose essence is: `iri-to-uri("http://example.com/", "wrong param")`. .
   */
  @org.junit.Test
  public void kIRIToURIfunc2() {
    final XQuery query = new XQuery(
      "iri-to-uri(\"http://example.com/\", \"wrong param\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPST0017")
    );
  }

  /**
   *  A test whose essence is: `iri-to-uri(()) eq ""`. .
   */
  @org.junit.Test
  public void kIRIToURIfunc3() {
    final XQuery query = new XQuery(
      "iri-to-uri(()) eq \"\"",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertBoolean(true)
    );
  }

  /**
   *  Invoke fn:normalize-space() on the return value of fn:iri-to-uri(). Implementations supporting the static typing feature may raise XPTY0004. .
   */
  @org.junit.Test
  public void kIRIToURIfunc4() {
    final XQuery query = new XQuery(
      "normalize-space(iri-to-uri((\"somestring\", current-time())[1])) eq \"somestring\"",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      (
        assertBoolean(true)
      ||
        error("XPTY0004")
      )
    );
  }

  /**
   *  Must be passed at least one argument. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc1() {
    final XQuery query = new XQuery(
      "iri-to-uri()",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPST0017")
    );
  }

  /**
   *  Pass a relatively high range of unicode characters. 0x32 to 0x126 in hexa decimal .
   */
  @org.junit.Test
  public void k2IRIToURIfunc10() {
    final XQuery query = new XQuery(
      "iri-to-uri(codepoints-to-string(15000 to 16000))",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "%E3%AA%98%E3%AA%99%E3%AA%9A%E3%AA%9B%E3%AA%9C%E3%AA%9D%E3%AA%9E%E3%AA%9F%E3%AA%A0%E3%AA%A1%E3%AA%A2%E3%AA%A3%E3%AA%A4%E3%AA%A5%E3%AA%A6%E3%AA%A7%E3%AA%A8%E3%AA%A9%E3%AA%AA%E3%AA%AB%E3%AA%AC%E3%AA%AD%E3%AA%AE%E3%AA%AF%E3%AA%B0%E3%AA%B1%E3%AA%B2%E3%AA%B3%E3%AA%B4%E3%AA%B5%E3%AA%B6%E3%AA%B7%E3%AA%B8%E3%AA%B9%E3%AA%BA%E3%AA%BB%E3%AA%BC%E3%AA%BD%E3%AA%BE%E3%AA%BF%E3%AB%80%E3%AB%81%E3%AB%82%E3%AB%83%E3%AB%84%E3%AB%85%E3%AB%86%E3%AB%87%E3%AB%88%E3%AB%89%E3%AB%8A%E3%AB%8B%E3%AB%8C%E3%AB%8D%E3%AB%8E%E3%AB%8F%E3%AB%90%E3%AB%91%E3%AB%92%E3%AB%93%E3%AB%94%E3%AB%95%E3%AB%96%E3%AB%97%E3%AB%98%E3%AB%99%E3%AB%9A%E3%AB%9B%E3%AB%9C%E3%AB%9D%E3%AB%9E%E3%AB%9F%E3%AB%A0%E3%AB%A1%E3%AB%A2%E3%AB%A3%E3%AB%A4%E3%AB%A5%E3%AB%A6%E3%AB%A7%E3%AB%A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3%B8%A2%E3%B8%A3%E3%B8%A4%E3%B8%A5%E3%B8%A6%E3%B8%A7%E3%B8%A8%E3%B8%A9%E3%B8%AA%E3%B8%AB%E3%B8%AC%E3%B8%AD%E3%B8%AE%E3%B8%AF%E3%B8%B0%E3%B8%B1%E3%B8%B2%E3%B8%B3%E3%B8%B4%E3%B8%B5%E3%B8%B6%E3%B8%B7%E3%B8%B8%E3%B8%B9%E3%B8%BA%E3%B8%BB%E3%B8%BC%E3%B8%BD%E3%B8%BE%E3%B8%BF%E3%B9%80%E3%B9%81%E3%B9%82%E3%B9%83%E3%B9%84%E3%B9%85%E3%B9%86%E3%B9%87%E3%B9%88%E3%B9%89%E3%B9%8A%E3%B9%8B%E3%B9%8C%E3%B9%8D%E3%B9%8E%E3%B9%8F%E3%B9%90%E3%B9%91%E3%B9%92%E3%B9%93%E3%B9%94%E3%B9%95%E3%B9%96%E3%B9%97%E3%B9%98%E3%B9%99%E3%B9%9A%E3%B9%9B%E3%B9%9C%E3%B9%9D%E3%B9%9E%E3%B9%9F%E3%B9%A0%E3%B9%A1%E3%B9%A2%E3%B9%A3%E3%B9%A4%E3%B9%A5%E3%B9%A6%E3%B9%A7%E3%B9%A8%E3%B9%A9%E3%B9%AA%E3%B9%AB%E3%B9%AC%E3%B9%AD%E3%B9%AE%E3%B9%AF%E3%B9%B0%E3%B9%B1%E3%B9%B2%E3%B9%B3%E3%B9%B4%E3%B9%B5%E3%B9%B6%E3%B9%B7%E3%B9%B8%E3%B9%B9%E3%B9%BA%E3%B9%BB%E3%B9%BC%E3%B9%BD%E3%B9%BE%E3%B9%BF%E3%BA%80")
    );
  }

  /**
   *  Must be passed at most one argument. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc2() {
    final XQuery query = new XQuery(
      "iri-to-uri(\"a string\", \"a string\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPST0017")
    );
  }

  /**
   *  Must be passed a string. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc3() {
    final XQuery query = new XQuery(
      "iri-to-uri(1)",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPTY0004")
    );
  }

  /**
   *  Must be passed at most one string. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc4() {
    final XQuery query = new XQuery(
      "iri-to-uri((\"a string\", \"a string\"))",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPTY0004")
    );
  }

  /**
   *  Passing xs:anyURI causes type promotion. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc5() {
    final XQuery query = new XQuery(
      "iri-to-uri(xs:anyURI(\"a string\"))",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "a%20string")
    );
  }

  /**
   *  Passing xs:untypedAtomic causes type promotion. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc6() {
    final XQuery query = new XQuery(
      "iri-to-uri(xs:untypedAtomic(\"a string\"))",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "a%20string")
    );
  }

  /**
   *  Check some ASCII characters that must be escaped. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc7() {
    final XQuery query = new XQuery(
      "iri-to-uri(\"<> \"\"{}|\\^`\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "%3C%3E%20%22%7B%7D%7C%5C%5E%60")
    );
  }

  /**
   *  Pass a new-line character. .
   */
  @org.junit.Test
  public void k2IRIToURIfunc8() {
    final XQuery query = new XQuery(
      "iri-to-uri(\"\n" +
      "\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "%0A")
    );
  }

  /**
   *  Pass the range of 0x20 to 0x126(hexa decimals). 0x32 to 0x126 in hexa decimal .
   */
  @org.junit.Test
  public void k2IRIToURIfunc9() {
    final XQuery query = new XQuery(
      "iri-to-uri(codepoints-to-string(32 to 294))",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "%20!%22#$%&'()*+,-./0123456789:;%3C=%3E?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[%5C]%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D~%7F%C2%80%C2%81%C2%82%C2%83%C2%84%C2%85%C2%86%C2%87%C2%88%C2%89%C2%8A%C2%8B%C2%8C%C2%8D%C2%8E%C2%8F%C2%90%C2%91%C2%92%C2%93%C2%94%C2%95%C2%96%C2%97%C2%98%C2%99%C2%9A%C2%9B%C2%9C%C2%9D%C2%9E%C2%9F%C2%A0%C2%A1%C2%A2%C2%A3%C2%A4%C2%A5%C2%A6%C2%A7%C2%A8%C2%A9%C2%AA%C2%AB%C2%AC%C2%AD%C2%AE%C2%AF%C2%B0%C2%B1%C2%B2%C2%B3%C2%B4%C2%B5%C2%B6%C2%B7%C2%B8%C2%B9%C2%BA%C2%BB%C2%BC%C2%BD%C2%BE%C2%BF%C3%80%C3%81%C3%82%C3%83%C3%84%C3%85%C3%86%C3%87%C3%88%C3%89%C3%8A%C3%8B%C3%8C%C3%8D%C3%8E%C3%8F%C3%90%C3%91%C3%92%C3%93%C3%94%C3%95%C3%96%C3%97%C3%98%C3%99%C3%9A%C3%9B%C3%9C%C3%9D%C3%9E%C3%9F%C3%A0%C3%A1%C3%A2%C3%A3%C3%A4%C3%A5%C3%A6%C3%A7%C3%A8%C3%A9%C3%AA%C3%AB%C3%AC%C3%AD%C3%AE%C3%AF%C3%B0%C3%B1%C3%B2%C3%B3%C3%B4%C3%B5%C3%B6%C3%B7%C3%B8%C3%B9%C3%BA%C3%BB%C3%BC%C3%BD%C3%BE%C3%BF%C4%80%C4%81%C4%82%C4%83%C4%84%C4%85%C4%86%C4%87%C4%88%C4%89%C4%8A%C4%8B%C4%8C%C4%8D%C4%8E%C4%8F%C4%90%C4%91%C4%92%C4%93%C4%94%C4%95%C4%96%C4%97%C4%98%C4%99%C4%9A%C4%9B%C4%9C%C4%9D%C4%9E%C4%9F%C4%A0%C4%A1%C4%A2%C4%A3%C4%A4%C4%A5%C4%A6")
    );
  }

  /**
   *  Examines the fn:iri-to-uri function with nothing to escape. .
   */
  @org.junit.Test
  public void fnIriToUri1() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "'" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri10() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example'example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example'example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "(" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri11() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example(example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example(example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the ")" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri12() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example)example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example)example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the ";" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri13() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example;example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example;example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "/" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri14() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example/example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example/example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "?" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri15() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example?example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example?example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the ":" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri16() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example:example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example:example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "@" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri17() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example@example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example@example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does escape not the "&" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri18() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example&amp;amp;example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example&amp;example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "=" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri19() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example=example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example=example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape numbers. .
   */
  @org.junit.Test
  public void fnIriToUri2() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example0123456789\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example0123456789")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape "+" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri20() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example+example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example+example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "$" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri21() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example$example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example$example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "," symbol. .
   */
  @org.junit.Test
  public void fnIriToUri22() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example,example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example,example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "[" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri23() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example[example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example[example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "]" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri24() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example]example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example]example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "%" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri25() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example%example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example%example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri with an iri that contains a space. .
   */
  @org.junit.Test
  public void fnIriToUri26() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example%20example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escapes the "#" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri3() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example#example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example#example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escapes the "-" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri4() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example-example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example-example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "_" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri5() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example_example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example_example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escapes the "." symbol. .
   */
  @org.junit.Test
  public void fnIriToUri6() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example.example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example.example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does escape not the "!" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri7() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example!example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example!example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "~" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri8() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example~example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example~example")
    );
  }

  /**
   *  Examines that the fn:iri-to-uri function does not escape the "*" symbol. .
   */
  @org.junit.Test
  public void fnIriToUri9() {
    final XQuery query = new XQuery(
      "fn:iri-to-uri(\"example*example\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "example*example")
    );
  }

  /**
   * Test iri-to-uri from example defined in functions and operators specification .
   */
  @org.junit.Test
  public void fnIriToUri1args1() {
    final XQuery query = new XQuery(
      "iri-to-uri(\"http://www.example.com/00/Weather/CA/Los%20Angeles#ocean\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "http://www.example.com/00/Weather/CA/Los%20Angeles#ocean")
    );
  }

  /**
   * Test iri-to-uri from example defined in functions and operators specification .
   */
  @org.junit.Test
  public void fnIriToUri1args2() {
    final XQuery query = new XQuery(
      "iri-to-uri(\"http://www.example.com/~bébé\")",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "http://www.example.com/~b%C3%A9b%C3%A9")
    );
  }

  /**
   * Test iri-to-uri with zero-length string argument .
   */
  @org.junit.Test
  public void fnIriToUri1args3() {
    final XQuery query = new XQuery(
      "iri-to-uri('')",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "")
    );
  }

  /**
   * Test iri-to-uri with empty sequence argument .
   */
  @org.junit.Test
  public void fnIriToUri1args4() {
    final XQuery query = new XQuery(
      "iri-to-uri(())",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      assertStringValue(false, "")
    );
  }

  /**
   * test iri-to-uri with invalid argument type .
   */
  @org.junit.Test
  public void fnIriToUri1args5() {
    final XQuery query = new XQuery(
      "iri-to-uri(12)",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPTY0004")
    );
  }

  /**
   * test iri-to-uri with incorrect arity .
   */
  @org.junit.Test
  public void fnIriToUri1args6() {
    final XQuery query = new XQuery(
      "iri-to-uri('',())",
      ctx);
    try {
      result = new QT3Result(query.value());
    } catch(final Throwable trw) {
      result = new QT3Result(trw);
    } finally {
      query.close();
    }
    test(
      error("XPST0017")
    );
  }
}
