Skip to content

Commit

Permalink
snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Sep 21, 2020
1 parent 892154b commit 87655f0
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions next/main_test.go
@@ -1,7 +1,6 @@
package main

import (
"bytes"
"fmt"
"io/ioutil"
"os"
Expand Down Expand Up @@ -52,7 +51,6 @@ func TestScript(t *testing.T) {
"mksourcedir": cmdMkSourceDir,
"rmfinalnewline": cmdRmFinalNewline,
"umask": cmdUmask,
"unix2dos": cmdUNIX2DOS,
},
Condition: func(cond string) (bool, error) {
switch cond {
Expand Down Expand Up @@ -273,28 +271,6 @@ func cmdRmFinalNewline(ts *testscript.TestScript, neg bool, args []string) {
}
}

// cmdUNIX2DOS converts files from UNIX line endings to DOS line endings.
func cmdUNIX2DOS(ts *testscript.TestScript, neg bool, args []string) {
if neg {
ts.Fatalf("unsupported: ! unix2dos")
}
if len(args) < 1 {
ts.Fatalf("usage: unix2dos paths...")
}
for _, arg := range args {
filename := ts.MkAbs(arg)
data, err := ioutil.ReadFile(filename)
if err != nil {
ts.Fatalf("%s: %v", filename, err)
}
data = bytes.Replace(data, []byte{'\n'}, []byte{'\r', '\n'}, -1)
//nolint:gosec
if err := ioutil.WriteFile(filename, data, 0o666); err != nil {
ts.Fatalf("%s: %v", filename, err)
}
}
}

// cmdUmask sets the umask.
func cmdUmask(ts *testscript.TestScript, neg bool, args []string) {
if neg {
Expand Down

0 comments on commit 87655f0

Please sign in to comment.