Files
Codex 8ec7ee2ec9
Some checks failed
CI / build-test (push) Has been cancelled
CI / containers (push) Has been cancelled
Add distributed F# monitoring platform
2026-08-09 18:22:24 +03:00

16 lines
869 B
Forth
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open System
open IpCheck.Domain
let assertTrue message condition = if not condition then failwith message
[<EntryPoint>]
let main _ =
let valid = Target.create "192.168.1.10" None [ Ping; TcpPort("ssh", 22us) ] (TimeSpan.FromSeconds 60.0)
let invalidAddress = Target.create "not-an-ip" None [ Ping ] (TimeSpan.FromSeconds 60.0)
let invalidInterval = Target.create "127.0.0.1" None [ Ping ] (TimeSpan.FromSeconds 5.0)
assertTrue "Корректный адрес должен создавать цель" (Result.isOk valid)
assertTrue "Некорректный адрес должен отклоняться" (Result.isError invalidAddress)
assertTrue "Слишком короткий интервал должен отклоняться" (Result.isError invalidInterval)
printfn "Все доменные тесты пройдены"
0