refractor

This commit is contained in:
Philipp 2022-08-29 00:10:36 +02:00
parent cfe5f4f789
commit 22e3b3f6a1
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 276B613AF9DBE9C3
3 changed files with 19 additions and 11 deletions

11
main.v
View file

@ -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
View 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
View 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: []
}