diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/formatters/installers/dart-format.bash | 24 | ||||
| -rw-r--r-- | test/formatters/samplecode/dart-format/in.dart | 27 | ||||
| -rw-r--r-- | test/formatters/samplecode/dart-format/out.dart | 17 |
3 files changed, 68 insertions, 0 deletions
diff --git a/test/formatters/installers/dart-format.bash b/test/formatters/installers/dart-format.bash new file mode 100644 index 0000000..0c164ec --- /dev/null +++ b/test/formatters/installers/dart-format.bash @@ -0,0 +1,24 @@ +arch="$(uname -m)" +case "${arch}" in + "x86_64") + arch="x64" + ;; + "i386") + arch="ia32" + ;; + "aarch64") + arch="arm64" + ;; + *) + echo >&2 "unsupported architecture: ${arch}" + exit 1 + ;; +esac + +wget "https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-${arch}-release.zip" -O dart.zip +unzip dart.zip +chmod a=u,go-w -R dart-sdk + +sudo mkdir /opt/dart +sudo cp -R dart-sdk/. /opt/dart/. +sudo ln -s /opt/dart/bin/dart /usr/local/bin/ diff --git a/test/formatters/samplecode/dart-format/in.dart b/test/formatters/samplecode/dart-format/in.dart new file mode 100644 index 0000000..1b58920 --- /dev/null +++ b/test/formatters/samplecode/dart-format/in.dart @@ -0,0 +1,27 @@ +void main() { + Function addNumbers = ( + a, + b + ) => print(a + b); + someOtherFunction("addNumbers",addNumbers); + + var myFunc = taskToPerform(); + print(myFunc(10)); +} + +void someOtherFunction(String + message, + Function myFunction) + { + print(message); + myFunction( + 2, + 4 + ); +} + +Function taskToPerform() { + Function multiplyFour = (int number) => number*4; + return + multiplyFour; +} diff --git a/test/formatters/samplecode/dart-format/out.dart b/test/formatters/samplecode/dart-format/out.dart new file mode 100644 index 0000000..fb871a9 --- /dev/null +++ b/test/formatters/samplecode/dart-format/out.dart @@ -0,0 +1,17 @@ +void main() { + Function addNumbers = (a, b) => print(a + b); + someOtherFunction("addNumbers", addNumbers); + + var myFunc = taskToPerform(); + print(myFunc(10)); +} + +void someOtherFunction(String message, Function myFunction) { + print(message); + myFunction(2, 4); +} + +Function taskToPerform() { + Function multiplyFour = (int number) => number * 4; + return multiplyFour; +} |
