diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2022-07-29 13:10:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-29 13:10:11 +0200 |
| commit | ce72f77b455afa6a7de26b74de4ca539aeffecd6 (patch) | |
| tree | ad8c83890bca9aed2ba40d75162f0900a5507ee2 /tools | |
| parent | 6c824e20abcd41ff02f3f6f296e6170cd77b8ee5 (diff) | |
| parent | 25af2b86c5c317c3a42c6d59ef42e29e4bc064d6 (diff) | |
Merge pull request #125 from nico-bb/master
Fix ternary when expression + added the test to snapshot
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/odinfmt/tests/.snapshots/assignments.odin | 5 | ||||
| -rw-r--r-- | tools/odinfmt/tests/assignments.odin | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/tools/odinfmt/tests/.snapshots/assignments.odin b/tools/odinfmt/tests/.snapshots/assignments.odin index 7b09796..983087e 100644 --- a/tools/odinfmt/tests/.snapshots/assignments.odin +++ b/tools/odinfmt/tests/.snapshots/assignments.odin @@ -11,3 +11,8 @@ assignments :: proc() { &big.Int{} } + +ternary_when_assignment :: proc() { + a := WGL_CONTEXT_FLAGS_ARB when ODIN_DEBUG else 0 + b := ODIN_DEBUG ? WGL_CONTEXT_FLAGS_ARB : 0 +} diff --git a/tools/odinfmt/tests/assignments.odin b/tools/odinfmt/tests/assignments.odin index c90b04e..53cc9aa 100644 --- a/tools/odinfmt/tests/assignments.odin +++ b/tools/odinfmt/tests/assignments.odin @@ -4,3 +4,8 @@ assignments :: proc() { a, b, c, d, e, f, res := &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{}, &big.Int{} } + +ternary_when_assignment :: proc() { + a := WGL_CONTEXT_FLAGS_ARB when ODIN_DEBUG else 0 + b := ODIN_DEBUG ? WGL_CONTEXT_FLAGS_ARB : 0 +} |