import test from "node:test";
import assert from "node:assert/strict";
import { createPlatformRuntime } from "./runtime.js";

test("platform runtime keeps web fallback independent from native platforms", () => {
  const runtime = createPlatformRuntime({ getPlatform: () => "web", isNativePlatform: () => false });

  assert.equal(runtime.platform, "web");
  assert.equal(runtime.isNative, false);
  assert.equal(runtime.isAndroid, false);
  assert.equal(runtime.isIOS, false);
});

test("platform runtime can add iOS later without changing feature callers", () => {
  const runtime = createPlatformRuntime({ getPlatform: () => "ios", isNativePlatform: () => true });

  assert.equal(runtime.platform, "ios");
  assert.equal(runtime.isNative, true);
  assert.equal(runtime.isAndroid, false);
  assert.equal(runtime.isIOS, true);
});
