aboutsummaryrefslogtreecommitdiff
path: root/statement_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-10-03 00:15:29 +0700
committerShulhan <ms@kilabit.info>2025-10-03 00:15:29 +0700
commit1003a18b85cffac4b9a92ee787fd8a9bdfca072d (patch)
tree2090d7c2b84dbd4cc39956145af3c070ba98f7ee /statement_test.go
parent276096698be34a7c629b3fe7bfd79c48e1c24921 (diff)
downloadawwan-1003a18b85cffac4b9a92ee787fd8a9bdfca072d.tar.xz
all: add option "$noparse" for magic "#put" command
The "$noparse" option allow copying file without reading and parsing the input file.
Diffstat (limited to 'statement_test.go')
-rw-r--r--statement_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/statement_test.go b/statement_test.go
index 88981fa..760788e 100644
--- a/statement_test.go
+++ b/statement_test.go
@@ -145,6 +145,41 @@ func TestParseStatement(t *testing.T) {
args: []string{`a`},
raw: []byte(` echo "a"`),
},
+ }, {
+ raw: []byte(`#put:user:group+0700$noparse src dst`),
+ exp: &Statement{
+ kind: statementKindPut,
+ owner: `user:group`,
+ mode: 0700,
+ args: []string{`src`, `dst`},
+ raw: []byte(`src dst`),
+ optNoparse: true,
+ },
+ }, {
+ raw: []byte(`#put:+0700$noparse src dst`),
+ exp: &Statement{
+ kind: statementKindPut,
+ mode: 0700,
+ args: []string{`src`, `dst`},
+ raw: []byte(`src dst`),
+ optNoparse: true,
+ },
+ }, {
+ raw: []byte(`#put:$noparse src dst`),
+ exp: &Statement{
+ kind: statementKindPut,
+ args: []string{`src`, `dst`},
+ raw: []byte(`src dst`),
+ optNoparse: true,
+ },
+ }, {
+ raw: []byte(`#put:$unknown$noparse src dst`),
+ exp: &Statement{
+ kind: statementKindPut,
+ args: []string{`src`, `dst`},
+ raw: []byte(`src dst`),
+ optNoparse: true,
+ },
}}
var (