Skip to content

Commit

Permalink
Merge pull request #757 from lmorg/develop
Browse files Browse the repository at this point in the history
v5.2
  • Loading branch information
lmorg committed Nov 18, 2023
2 parents 36d43a8 + aa64611 commit 64a85d3
Show file tree
Hide file tree
Showing 233 changed files with 6,035 additions and 2,447 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clean-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.18' ]
go-version: [ '1.21' ]
steps:

- name: Setup Go ${{ matrix.go-version }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/murex-downloads.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ jobs:
echo "Compiling WebAssembly...."
export GOOS=js
export GOARCH=wasm
go build -o ./gen/website/wasm/murex.wasm
export LD_FLAGS="-extldflags=-static"
export tags="$(cat builtins/optional/standard-opts.txt),sqlite_omit_load_extension,osusergo,netgo"
go build -ldflags "$LD_FLAGS" -tags "$tags" -o ./gen/website/wasm/murex.wasm
cp -v "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./gen/website/wasm/
#fi

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/murex-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.18', '1.19', '1.20', '1.21' ]
go-version: [ '1.20', '1.21' ]
env:
MUREX_BUILD_FLAGS: --no-colour
MUREX_TEST_NO_EXEC_DEPS: true
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sudo port install murex

You will need `go` (Golang) compiler, and `git` installed.

> Go 1.18 or higher is required.
> Go 1.20 or higher is required.
These should be easy to install on most operating systems however Windows is a
lot more tricky with regards to `gcc`. Please check with your operating systems
Expand Down
4 changes: 2 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const Name = "murex"
const (
version = "%d.%d.%d"
Major = 5
Minor = 1
Revision = 2300
Minor = 2
Revision = 7610
)

// Copyright is the copyright owner string
Expand Down
3 changes: 1 addition & 2 deletions app/whatsnew/whatsnew.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/lmorg/murex/app"
"github.com/lmorg/murex/config/profile"
"github.com/lmorg/murex/lang/tty"
)

func Display() {
Expand All @@ -35,7 +34,7 @@ func Display() {
}

changelog:
fmt.Fprintf(tty.Stdout, "Welcome to murex %d.%d.%d\nChangelog: https://murex.rocks/CHANGELOG.html\nOr run `help changelog/v%d.%d` from the command line\n",
fmt.Fprintf(os.Stdout, "Welcome to murex %d.%d.%d\nChangelog: https://murex.rocks/CHANGELOG.html\nOr run `help changelog/v%d.%d` from the command line\n",
app.Major, app.Minor, app.Revision, app.Major, app.Minor)

f, err = os.OpenFile(profile.ModulePath()+"/version", os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
Expand Down
22 changes: 22 additions & 0 deletions behavioural/try_control.mx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# control

function: control.scope.block.fn.fail {
a: [1..2] -> foreach i { err: $i | out: bar }
}

test: unit function control.scope.block.fn.fail {
"StderrMatch": "1\n2\n",
"StdoutMatch": "bar\nbar\n"
}

function: control.runmode.fail {
out "foo"
runmode try function
out "bar"
}

test: unit function control.runmode.fail {
"StdoutMatch": "foo\nbar\n",
"StderrRegex": "should only be used as the first statement in a block",
"ExitNum": 0
}
51 changes: 14 additions & 37 deletions behavioural/try_scopes.mx
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
# control

function: control.scope.block.fn.fail {
a: [1..2] -> foreach i { err: $i | out: bar }
}

test: unit function control.scope.block.fn.fail {
"StderrMatch": "1\n2\n",
"StdoutMatch": "bar\nbar\n"
}

function: control.runmode.fail {
out "foo"
runmode try function
out "bar"
}

test: unit function control.runmode.fail {
"StdoutMatch": "foo\nbar\n",
"StderrRegex": "should only be used as the first statement in a block",
"ExitNum": 0
}

# try

function: try.scope.block.pass {
Expand Down Expand Up @@ -68,7 +45,7 @@ function: try.scope.block.foreach.fail {

test: unit function try.scope.block.foreach.fail {
"StderrMatch": "1\n2\n",
"ExitNum": 1
"ExitNum": 0
}

## function
Expand All @@ -91,7 +68,7 @@ function: try.scope.fn.foreach.fail {

test: unit function try.scope.fn.foreach.fail {
"StderrMatch": "1\n2\n",
"ExitNum": 1
"ExitNum": 0
}

function try.scope.fn.read.fail {
Expand All @@ -103,12 +80,12 @@ function try.scope.fn.read.fail {
read: q "? "
out: "!"
}
sleep: 2
sleep: 1
}

test: unit function try.scope.fn.read.fail {
"StderrRegex": "cannot read from",
"ExitNum": 1
"ExitNum": 0
}

## module
Expand All @@ -131,7 +108,7 @@ function: try.scope.mod.foreach.fail {

test: unit function try.scope.mod.foreach.fail {
"StderrMatch": "1\n2\n",
"ExitNum": 1
"ExitNum": 0
}

function try.scope.mod.read.fail {
Expand All @@ -143,12 +120,12 @@ function try.scope.mod.read.fail {
read: q "? "
out: "!"
}
sleep: 2
sleep: 1
}

test: unit function try.scope.mod.read.fail {
"StderrRegex": "cannot read from",
"ExitNum": 1
"ExitNum": 0
}

# trypipe
Expand Down Expand Up @@ -199,7 +176,7 @@ function: trypipe.scope.block.foreach.fail {

test: unit function trypipe.scope.block.foreach.fail {
"StderrMatch": "1\n2\n",
"ExitNum": 1
"ExitNum": 0
}

### function
Expand All @@ -222,7 +199,7 @@ function: trypipe.scope.fn.foreach.fail {

test: unit function trypipe.scope.fn.foreach.fail {
"StderrMatch": "1\n2\n",
"ExitNum": 1
"ExitNum": 0
}

function trypipe.scope.fn.read.fail {
Expand All @@ -234,12 +211,12 @@ function trypipe.scope.fn.read.fail {
read: q "? "
out: "!"
}
sleep: 2
sleep: 1
}

test: unit function trypipe.scope.fn.read.fail {
"StderrRegex": "cannot read from",
"ExitNum": 1
"ExitNum": 0
}

## module
Expand All @@ -262,7 +239,7 @@ function: trypipe.scope.mod.foreach.fail {

test: unit function trypipe.scope.mod.foreach.fail {
"StderrMatch": "1\n2\n",
"ExitNum": 1
"ExitNum": 0
}

function trypipe.scope.mod.read.fail {
Expand All @@ -274,10 +251,10 @@ function trypipe.scope.mod.read.fail {
read: q "? "
out: "!"
}
sleep: 2
sleep: 1
}

test: unit function trypipe.scope.mod.read.fail {
"StderrRegex": "cannot read from",
"ExitNum": 1
"ExitNum": 0
}

0 comments on commit 64a85d3

Please sign in to comment.