main_windows_test.go 776 B

12345678910111213141516171819202122232425262728293031
  1. //go:build windows
  2. package yu_file
  3. import (
  4. "fmt"
  5. "testing"
  6. "time"
  7. )
  8. func TestGetS(t *testing.T) {
  9. fmt.Println(GetS("C:\\Users\\Administrator\\Desktop\\awesomeProject\\go.mod"))
  10. fmt.Println(SetS("C:\\Users\\Administrator\\Desktop\\awesomeProject\\build.txt", "1sadasdasd"))
  11. fmt.Println(LinesS("C:\\Users\\Administrator\\Desktop\\awesomeProject\\build.txt", "\r\n"))
  12. for i := 0; i < 300; i++ {
  13. go func() {
  14. for i := 0; i < 1000; i++ {
  15. PutS("C:\\Users\\Administrator\\Desktop\\122\\111.txt", "sadsadasdsdad", "\r\n")
  16. }
  17. }()
  18. }
  19. time.Sleep(time.Second * 30)
  20. }
  21. func TestFind_Enum(t *testing.T) {
  22. j_find := NewFind().SetPath(`C:\Users\Administrator\Desktop\`).SetName("*")
  23. fmt.Println(j_find.Enum())
  24. j_find.SetName("*.zip")
  25. fmt.Println(j_find.Enum())
  26. }