From c71c8980cf4a7a917d9fb1712985d3abd48ef54b Mon Sep 17 00:00:00 2001 From: "Zachary J. Rollyson" Date: Sat, 17 Oct 2020 11:19:56 -0400 Subject: [PATCH] feat: add syntax sample for dotEnv files --- tests/syntax-tests/highlighted/DotENV/.env | 57 +++++++++++++++++++++ tests/syntax-tests/source/DotENV/.env | 57 +++++++++++++++++++++ tests/syntax-tests/source/DotENV/LICENSE.md | 23 +++++++++ 3 files changed, 137 insertions(+) create mode 100644 tests/syntax-tests/highlighted/DotENV/.env create mode 100644 tests/syntax-tests/source/DotENV/.env create mode 100644 tests/syntax-tests/source/DotENV/LICENSE.md diff --git a/tests/syntax-tests/highlighted/DotENV/.env b/tests/syntax-tests/highlighted/DotENV/.env new file mode 100644 index 00000000..f46097cc --- /dev/null +++ b/tests/syntax-tests/highlighted/DotENV/.env @@ -0,0 +1,57 @@ +# Keyword +export TEST_KEYWORD="bar" +export TEST_KEYWORD=12345 +export TEST_KEYWORD=TRUE + +# Variable +TEST_VARIABLE="Hello" + +# String interpolation +TEST_INTERPOLATION_VARIABLE="$VAR1 test test$VAR2test test" +TEST_INTERPOLATION_SYNTAX_ONE="test test{$NVAR1}test{$NVAR2}test test" +TEST_INTERPOLATION_SYNTAX_TWO="test test${NVAR1}test${NVAR2}test test" +TEST_INTERPOLATION_SYNTAX_ALL="test$VAR1test test {VAR2}test test${VAR3}test" + +# Unquoted +TEST_UNQUOTED=bar +TEST_UNQUOTED_NO_VALUE= + +# White spaced +TEST_WHITE_SPACE = +TEST_WHITE_SPACE_STRING = "Hello" +TEST_WHITE_SPACE_UNQUOTED = bar +TEST_WHITE_SPACE_UNQUOTED_BOOL = false +TEST_WHITE_SPACE_UNQUOTED_NUM = 20 + +# language constants +TEST_TRUE=true +TEST_FALSE=false +TEST_NULL=null +TEST_TRUE_CAPITAL=TRUE +TEST_FALSE_CAPITAL=FALSE +TEST_NULL_CAPITAL=NULL + +# Numerical values +TEST_NUM_DECIMAL=54 +TEST_NUM_FLOAT=5.3 +TEST_NUM=1e10 +TEST_NUM_NEGATIVE=-42 +TEST_NUM_OCTAL=057 +TEST_NUM_HEX=0x1A + +# Comments +#TEST_ONE=foobar +# TEST_TWO='foobar' +# TEST_THREE="foobar" # a comment on a commented row +TEST_FOUR="test test test" # this is a comment +TEST_FIVE="comment symbol # inside string" # this is a comment +TEST_SIX="comment symbol # and quotes \" \' inside quotes" # " this is a comment + +# Escape sequences +TEST_ESCAPE="escaped characters \n \t \r \" \' \$ or maybe a backslash \\..." + +# Double Quotes +TEST_DOUBLE="Lorem {$VAR1} ${VAR2} $VAR3 ipsum dolor sit amet\n\r\t\\" + +# Single Quotes +TEST_SINGLE='Lorem {$VAR1} ${VAR2} $VAR3 ipsum dolor sit amet\n\r\t\\' diff --git a/tests/syntax-tests/source/DotENV/.env b/tests/syntax-tests/source/DotENV/.env new file mode 100644 index 00000000..474f6f14 --- /dev/null +++ b/tests/syntax-tests/source/DotENV/.env @@ -0,0 +1,57 @@ +# Keyword +export TEST_KEYWORD="bar" +export TEST_KEYWORD=12345 +export TEST_KEYWORD=TRUE + +# Variable +TEST_VARIABLE="Hello" + +# String interpolation +TEST_INTERPOLATION_VARIABLE="$VAR1 test test$VAR2test test" +TEST_INTERPOLATION_SYNTAX_ONE="test test{$NVAR1}test{$NVAR2}test test" +TEST_INTERPOLATION_SYNTAX_TWO="test test${NVAR1}test${NVAR2}test test" +TEST_INTERPOLATION_SYNTAX_ALL="test$VAR1test test {VAR2}test test${VAR3}test" + +# Unquoted +TEST_UNQUOTED=bar +TEST_UNQUOTED_NO_VALUE= + +# White spaced +TEST_WHITE_SPACE = +TEST_WHITE_SPACE_STRING = "Hello" +TEST_WHITE_SPACE_UNQUOTED = bar +TEST_WHITE_SPACE_UNQUOTED_BOOL = false +TEST_WHITE_SPACE_UNQUOTED_NUM = 20 + +# language constants +TEST_TRUE=true +TEST_FALSE=false +TEST_NULL=null +TEST_TRUE_CAPITAL=TRUE +TEST_FALSE_CAPITAL=FALSE +TEST_NULL_CAPITAL=NULL + +# Numerical values +TEST_NUM_DECIMAL=54 +TEST_NUM_FLOAT=5.3 +TEST_NUM=1e10 +TEST_NUM_NEGATIVE=-42 +TEST_NUM_OCTAL=057 +TEST_NUM_HEX=0x1A + +# Comments +#TEST_ONE=foobar +# TEST_TWO='foobar' +# TEST_THREE="foobar" # a comment on a commented row +TEST_FOUR="test test test" # this is a comment +TEST_FIVE="comment symbol # inside string" # this is a comment +TEST_SIX="comment symbol # and quotes \" \' inside quotes" # " this is a comment + +# Escape sequences +TEST_ESCAPE="escaped characters \n \t \r \" \' \$ or maybe a backslash \\..." + +# Double Quotes +TEST_DOUBLE="Lorem {$VAR1} ${VAR2} $VAR3 ipsum dolor sit amet\n\r\t\\" + +# Single Quotes +TEST_SINGLE='Lorem {$VAR1} ${VAR2} $VAR3 ipsum dolor sit amet\n\r\t\\' \ No newline at end of file diff --git a/tests/syntax-tests/source/DotENV/LICENSE.md b/tests/syntax-tests/source/DotENV/LICENSE.md new file mode 100644 index 00000000..59d0e293 --- /dev/null +++ b/tests/syntax-tests/source/DotENV/LICENSE.md @@ -0,0 +1,23 @@ +The `.env.test` file has been added from https://github.com/zaynali53/DotENV under the following license: + +The MIT License (MIT) + +Copyright (c) 2016 Zayn Ali + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.