summary refs log tree commit diff stats
path: root/tests/untestable/network/stdlib/tnet.nim
blob: cb0f389442fd67dbcb1d8c89aa72e8f52301157a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
discard """
outputsub: ""
"""

import net, nativesockets
import unittest

suite "getPrimaryIPAddr":
  test "localhost v4":
    check getPrimaryIPAddr(parseIpAddress("127.0.0.1")) == parseIpAddress("127.0.0.1")

  test "localhost v6":
    check getPrimaryIPAddr(parseIpAddress("::1")) == parseIpAddress("::1")

  test "v4":
    check getPrimaryIPAddr() != parseIpAddress("127.0.0.1")