refractor
This commit is contained in:
parent
cfe5f4f789
commit
22e3b3f6a1
3 changed files with 19 additions and 11 deletions
11
main.v
11
main.v
|
@ -1,11 +0,0 @@
|
||||||
module main
|
|
||||||
|
|
||||||
import steamid as s
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
steamid := s.to_steamid32("STEAM_0:1:37792218")
|
|
||||||
assert steamid == s.SteamID32 { 0, 1, 37792218 }
|
|
||||||
assert steamid.str() == "STEAM_0:1:37792218"
|
|
||||||
assert steamid.to_steamid3() == s.SteamID3 { "U", 1, 75584437 }
|
|
||||||
assert steamid.to_steamid64() == s.SteamID64 { 76561198035850165 }
|
|
||||||
}
|
|
11
steamid_tests.v
Normal file
11
steamid_tests.v
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import steamid as s
|
||||||
|
|
||||||
|
fn test_convert() {
|
||||||
|
assert s.to_steamid32("STEAM_0:1:37792218") == s.SteamID32 { 0, 1, 37792218 }
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_steamid32() {
|
||||||
|
assert s.SteamID32{ 0, 1, 37792218 }.str() == "STEAM_0:1:37792218"
|
||||||
|
assert s.SteamID32{ 0, 1, 37792218 }.to_steamid3() == s.SteamID3 { "U", 1, 75584437 }
|
||||||
|
assert s.SteamID32{ 0, 1, 37792218 }.to_steamid64() == s.SteamID64 { 76561198035850165 }
|
||||||
|
}
|
8
v.mod
Normal file
8
v.mod
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
Module {
|
||||||
|
name: 'steamid.v'
|
||||||
|
description: 'SteamID converting'
|
||||||
|
version: '0.0.1'
|
||||||
|
license: 'AGPLv3'
|
||||||
|
repo_url: 'https://git.snrd.eu/Spaenny/steamid.v'
|
||||||
|
dependencies: []
|
||||||
|
}
|
Loading…
Reference in a new issue