Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
BorzdeG committed May 7, 2023
1 parent ed632f5 commit fb908ca
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 25 deletions.
2 changes: 2 additions & 0 deletions env_wasm.go → env-tomap.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !windows

package env

import "strings"
Expand Down
14 changes: 9 additions & 5 deletions env_unix_test.go → env-tomap_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
//go:build !windows

package env

import "testing"

func TestUnix(t *testing.T) {
envVars := []string{":=/test/unix", "PATH=:/test_val1:/test_val2", "VAR=REGULARVAR"}
result := toMap(envVars)
isEqual(t, map[string]string{
":": "/test/unix",
"PATH": ":/test_val1:/test_val2",
"VAR": "REGULARVAR",
}, result)
isEqual(
t, map[string]string{
":": "/test/unix",
"PATH": ":/test_val1:/test_val2",
"VAR": "REGULARVAR",
}, result,
)
}
2 changes: 2 additions & 0 deletions env_windows.go → env-tomap_windows.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build windows

package env

import "strings"
Expand Down
14 changes: 9 additions & 5 deletions env_windows_test.go → env-tomap_windows_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build windows

package env

import "testing"
Expand All @@ -7,9 +9,11 @@ import "testing"
func TestToMapWindows(t *testing.T) {
envVars := []string{"=::=::\\", "=C:=C:\\test", "VAR=REGULARVAR"}
result := toMap(envVars)
isEqual(t, map[string]string{
"=::": "::\\",
"=C:": "C:\\test",
"VAR": "REGULARVAR",
}, result)
isEqual(
t, map[string]string{
"=::": "::\\",
"=C:": "C:\\test",
"VAR": "REGULARVAR",
}, result,
)
}
15 changes: 0 additions & 15 deletions env_unix.go

This file was deleted.

0 comments on commit fb908ca

Please sign in to comment.