aboutsummaryrefslogtreecommitdiff
path: root/statement_test.go
AgeCommit message (Collapse)Author
2025-10-03all: add option "$noparse" for magic "#put" commandShulhan
The "$noparse" option allow copying file without reading and parsing the input file.
2024-03-22all: replace module "share" with "pakakeh.go"Shulhan
The "share" project has been moved to SourceHut with new name "pakakeh.go".
2023-10-22all: add magic command "#local"Shulhan
The magic command "#local" define the command to be executed using shell in local environment. Its have effect and can only be used in script that executed using "play". In script that is executed using "local" it does nothing.
2023-10-20all: add parser for magic command "#get" or "#put" with owner and modeShulhan
The owner and mode is defined after the magic command with the following syntax, [ USER [ ":" GROUP ]] ["+" MODE] The USER and/or GROUP is optional, its accept the value as in "chown". The MODE also optional, its value must be an octal.
2023-10-12all: tag all unit test files with "!integration"Shulhan
This will allow us to build test binary that contains only "integration" build constraints. The test that have "integration" will be run using container.
2023-10-07all: simplify parsing statement for magic command "#put"Shulhan
This changes minimize code duplication when parsing magic command between "#put:" and "#put!" using single function parseStatementGetPut. In the returned Statement, we changes where to store the source argument into args[0] instead of in cmd for better readability and minimize confusion in Copy/SudoCopy.
2023-10-06all: simplify parsing statement for magic command getShulhan
This changes minimize code duplication when parsing magic command between "#get:" and "#get!" using single function parseStatementGetPut. In the returned Statement, we changes where to store the source argument into args[0] instead of in cmd for better readability and minimize confusion in Copy/SudoCopy. While at it, we add unit test for "#get:". Unit test for "#get!" is not possible right now, because it will prompt for password.
2022-07-31all: realign some structs to minimize memory usageShulhan
* Request: from 128 to 96 bytes (-32 bytes) * Session: from 176 to 160 bytes (-16 bytes) * Statement: from 56 to 48 bytes (-8 bytes) * session_test.go:24:13: struct with 48 pointer bytes could be 40 * statement_test.go:13:13: struct with 32 pointer bytes could be 16
2022-06-20all: reformat all go files using the next gofmtShulhan
2022-03-14all: change the awwan software license to GPL 3.0 or laterShulhan
See https://kilabit.info/journal/2022/gpl for more information.
2021-08-22all: rewrite the Session and Script using StatementShulhan
The idea for rewrite is to separate between local and remote script, so we can apply environment variables to local script. We also parse and validate each statements before being executed to simplify the code.