(function (_, kotlin_kotlin, kotlin_kotlin_test, kotlin_com_ustadmobile_app_core) {
  'use strict';
  //region block: imports
  var VOID = kotlin_kotlin.$_$.g;
  var assertTrue = kotlin_kotlin_test.$_$.b;
  var abs = kotlin_kotlin.$_$.bg;
  var XXStringHasherJs = kotlin_com_ustadmobile_app_core.$_$.b;
  var Long = kotlin_kotlin.$_$.vl;
  var assertEquals = kotlin_kotlin_test.$_$.a;
  var protoOf = kotlin_kotlin.$_$.tf;
  var listOf = kotlin_kotlin.$_$.qa;
  var XXHasher64FactoryJs = kotlin_com_ustadmobile_app_core.$_$.a;
  var toByteArray = kotlin_com_ustadmobile_app_core.$_$.d;
  var classMeta = kotlin_kotlin.$_$.ee;
  var setMetadataFor = kotlin_kotlin.$_$.uf;
  var suite = kotlin_kotlin_test.$_$.c;
  var test = kotlin_kotlin_test.$_$.d;
  var Unit_getInstance = kotlin_kotlin.$_$.g6;
  var SavedStateHandle2 = kotlin_com_ustadmobile_app_core.$_$.c;
  //endregion
  //region block: pre-declaration
  setMetadataFor(XXHashJsTest, 'XXHashJsTest', classMeta, VOID, VOID, XXHashJsTest);
  setMetadataFor(SavedStateHandle2Test, 'SavedStateHandle2Test', classMeta, VOID, VOID, SavedStateHandle2Test);
  //endregion
  function assertEqualsWithinThreshold(expected, actual, threshold, message) {
    message = message === VOID ? null : message;
    assertTrue(isWithinThreshold(expected, actual, threshold), message);
  }
  function isWithinThreshold(expected, actual, threshold) {
    return abs(expected.minus_mfbszm_k$(actual)).compareTo_9jj042_k$(threshold) < 0;
  }
  function XXHashJsTest() {
  }
  protoOf(XXHashJsTest).test_w5z8la_k$ = function () {
    var hasher = new XXStringHasherJs();
    assertEquals(new Long(-1026862423, -1453291819), hasher.hash_6htf84_k$('http://adlnet.gov/expapi/verbs/progressed'));
  };
  protoOf(XXHashJsTest).givenLongArray_whenInvoked_thenWillHash_a0fnmh_k$ = function () {
    var longsList = listOf([new Long(1, 0), new Long(42, 0), new Long(50, 0)]);
    var factory = new XXHasher64FactoryJs();
    var hasher = factory.newHasher_bylh2l_k$(new Long(0, 0));
    // Inline function 'kotlin.collections.forEach' call
    var tmp0_iterator = longsList.iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var element = tmp0_iterator.next_20eer_k$();
      // Inline function 'com.ustadmobile.core.domain.xxhash.XXHashJsTest.givenLongArray_whenInvoked_thenWillHash.<anonymous>' call
      hasher.update_abaron_k$(toByteArray(element));
    }
    assertEquals(new Long(-682341065, 733922687), hasher.digest_m0ziv0_k$());
  };
  function test_fun_izoufj() {
    suite('XXHashJsTest', false, test_fun$XXHashJsTest_test_fun_phluut);
  }
  function test_fun$XXHashJsTest_test_fun_phluut() {
    test('test', false, test_fun$XXHashJsTest_test_fun$test_test_fun_73uzao);
    test('givenLongArray_whenInvoked_thenWillHash', false, test_fun$XXHashJsTest_test_fun$givenLongArray_whenInvoked_thenWillHash_test_fun_8m8ytz);
    return Unit_getInstance();
  }
  function test_fun$XXHashJsTest_test_fun$test_test_fun_73uzao() {
    var tmp = new XXHashJsTest();
    tmp.test_w5z8la_k$();
    return Unit_getInstance();
  }
  function test_fun$XXHashJsTest_test_fun$givenLongArray_whenInvoked_thenWillHash_test_fun_8m8ytz() {
    var tmp = new XXHashJsTest();
    tmp.givenLongArray_whenInvoked_thenWillHash_a0fnmh_k$();
    return Unit_getInstance();
  }
  function SavedStateHandle2Test() {
  }
  protoOf(SavedStateHandle2Test).givenStateSavedToHistory_whenNewHandleCreated_thenValueShouldBeRestored_z2amv8_k$ = function () {
    var stateHandle = new SavedStateHandle2(window.history, new URLSearchParams(''));
    stateHandle.set_wua6pr_k$('test', '42');
    var restoredHandle = new SavedStateHandle2(window.history, new URLSearchParams(''));
    assertEquals('42', restoredHandle.get_6bo4tg_k$('test'));
  };
  function test_fun_izoufj_0() {
    suite('SavedStateHandle2Test', false, test_fun$SavedStateHandle2Test_test_fun_qoxisy);
  }
  function test_fun$SavedStateHandle2Test_test_fun_qoxisy() {
    test('givenStateSavedToHistory_whenNewHandleCreated_thenValueShouldBeRestored', false, test_fun$SavedStateHandle2Test_test_fun$givenStateSavedToHistory_whenNewHandleCreated_thenValueShouldBeRestored_test_fun_jivus1);
    return Unit_getInstance();
  }
  function test_fun$SavedStateHandle2Test_test_fun$givenStateSavedToHistory_whenNewHandleCreated_thenValueShouldBeRestored_test_fun_jivus1() {
    var tmp = new SavedStateHandle2Test();
    tmp.givenStateSavedToHistory_whenNewHandleCreated_thenValueShouldBeRestored_z2amv8_k$();
    return Unit_getInstance();
  }
  //region block: tests
  (function () {
    suite('com.ustadmobile.core.domain.xxhash', false, function () {
      test_fun_izoufj();
    });
    suite('com.ustadmobile.core.navigation', false, function () {
      test_fun_izoufj_0();
    });
  }());
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlin-kotlin-test-kotlin-test-js-ir.js'), require('./UstadMobile-core.js')));

//# sourceMappingURL=UstadMobile-core-test.js.map
