-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: file end of line character changes
Maintain the current predominant end of line character for files when making edits. This changes editing to use the standard TextEdit insert and replace creation methods to reduce complexity and overhead. Fix callback handling in tests, adding missing await and reject handling. Use option chaining and early return in getUpdatedSource to improve readability. Remove use of deprecated isNullOrUndefined. Fixes #176
- Loading branch information
Showing
10 changed files
with
273 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
client/src/test/examples/tiny-lf.groovy text eol=lf | ||
client/src/test/examples/tiny-cr.groovy text eol=cr | ||
client/src/test/examples/tiny-crlf.groovy text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import groovy.io.FileType | ||
import groovy.json.* | ||
import groovy.time.TimeCategory | ||
import static groovyx.gpars.GParsPool.withPool | ||
|
||
def script = new GroovyScriptEngine( "." ).with{ | ||
loadScriptByName( 'Utils.groovy' ) ; | ||
} | ||
this.metaClass.mixin script | ||
|
||
def returnCode = 0 | ||
Exception eThrow = null ; | ||
try { | ||
initialize(args) ; | ||
} catch (Exception e){ | ||
eThrow = e ; | ||
returnCode = 1 | ||
} | ||
if (eThrow == null){ | ||
return 0 ; | ||
} | ||
else { | ||
throw eThrow ; | ||
return 1 ; | ||
} | ||
|
||
////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
///////////////////////////////////////////////// SCRIPT ///////////////////////////////////////////////// | ||
////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
def initialize(args3) { // | ||
def executor = new TestExecutor(args3) | ||
return executor | ||
} | ||
|
||
class TestExecutor { | ||
|
||
public TestExecutor( args2) { | ||
this.testExternalGlobalProps() | ||
} | ||
|
||
public testExternalGlobalProps() { | ||
Utils.printlnLog( '########## testExternalGlobalProps') | ||
def globalKeyName = new Random().with { (1..9).collect { (('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()} | ||
Utils.printlnLog( "Generated random key: ${globalKeyName}") | ||
Utils.setExternalValue(globalKeyName , 'lelama' , 'nul') | ||
def storedValue = Utils.getExternalValue(globalKeyName , 'lelama') | ||
assert storedValue == 'nul' , 'Error in global prop key storage/ retrieval (1)' | ||
Utils.setExternalValue(globalKeyName , 'lelama2' , 'nul2') | ||
def storedValue2 = Utils.getExternalValue(globalKeyName , 'lelama2') | ||
assert storedValue2 == 'nul2' , 'Error in global prop key storage/ retrieval (2)' | ||
def storedValueBack = Utils.getExternalValue(globalKeyName , 'lelama') | ||
assert storedValueBack == 'nul' , 'Error in global prop key storage/ retrieval (3)' | ||
Utils.printlnLog( Utils.getExternalValue(globalKeyName)) | ||
} | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.