ladybird/Tests/LibWeb/TestLibWebSwiftBindings.swift
Andrew Kaster 782926601d Tests: Convert Swift tests to use Testing module where possible
The AK tests can't seem to use it because it crashes the frontend :)
2024-08-28 21:27:35 -06:00

26 lines
625 B
Swift

/*
* Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
import AK
import Web
import Testing
@Suite
struct TestLibWebSwiftBindings {
@Test func enumsAreBound() {
#expect(Web.DOM.NodeType.ELEMENT_NODE.rawValue == 1)
#expect(Web.Bindings.NavigationType.Push.rawValue == 0)
let end = Web.Bindings.idl_enum_to_string(Web.Bindings.ScrollLogicalPosition.End)
let end_view = end.__bytes_as_string_viewUnsafe().bytes();
let end_string = Swift.String(bytes: end_view, encoding: .utf8)!
#expect(end_string == "end")
}
}