spb/zyquo-atlas Public License
The AI-native macOS web browser — every surface, intelligent.
Swift 75.2%
JavaScript 22%
Shell 2%
Makefile 0.9%
1//2// OmniIntentTests.swift3// Zyquo Atlas4//5// Author: Simon-Pierre Boucher6// Mail: contact@spboucher.ai7//8// Verifies the Phase 2 omnibox URL-vs-search resolution (the phase gate's9// "omnibox must resolve URL vs. search" requirement).10//1112import Foundation13import Testing14@testable import ZyquoAtlas1516@Suite struct OmniIntentTests {17 @Test func explicitSchemeNavigates() {18 #expect(OmniIntent.resolve("https://apple.com") == .navigate(URL(string: "https://apple.com")!))19 #expect(OmniIntent.resolve("http://example.org/path") == .navigate(URL(string: "http://example.org/path")!))20 }2122 @Test func bareHostBecomesHTTPS() {23 #expect(OmniIntent.resolve("github.com") == .navigate(URL(string: "https://github.com")!))24 #expect(OmniIntent.resolve("news.ycombinator.com/newest")25 == .navigate(URL(string: "https://news.ycombinator.com/newest")!))26 }2728 @Test func localhostAndIPNavigate() {29 #expect(OmniIntent.resolve("localhost:8080") == .navigate(URL(string: "https://localhost:8080")!))30 #expect(OmniIntent.resolve("127.0.0.1") == .navigate(URL(string: "https://127.0.0.1")!))31 }3233 @Test func multiWordOrPlainTextSearches() {34 #expect(OmniIntent.resolve("best coffee in montreal") == .search("best coffee in montreal"))35 #expect(OmniIntent.resolve("swift concurrency") == .search("swift concurrency"))36 }3738 @Test func singleWordWithoutTLDSearches() {39 #expect(OmniIntent.resolve("swift") == .search("swift"))40 }4142 @Test func searchIntentProducesQueryURL() {43 let intent = OmniIntent.resolve("hello world")44 let url = intent.url45 #expect(url != nil)46 #expect(url!.absoluteString.contains("hello%20world"))47 }48}49