Skip to content

Instantly share code, notes, and snippets.

@RedBrogdon
Forked from kevmoo/index.html
Last active March 28, 2019 23:10
Show Gist options
  • Save RedBrogdon/a082c5c4de47de521fef8a3c14aa0a9e to your computer and use it in GitHub Desktop.
Save RedBrogdon/a082c5c4de47de521fef8a3c14aa0a9e to your computer and use it in GitHub Desktop.
DartPad Test #1 - Happy path
<!-- Copyright 2011 the Dart project authors. All rights reserved.
Use of this source code is governed by a BSD-style license
that can be found in the LICENSE file. -->
<h2>This is some HTML, just in case.</h2
>
String stringify(int x, int y) {
// Return a formatted string here
}
/* Copyright 2011 the Dart project authors. All rights reserved. */
/* Use of this source code is governed by a BSD-style license */
/* that can be found in the LICENSE file. */
/* Make it blue, so we can see the style is in use */
h2 {
color: #00f;
}
void main() {
final str = stringify(2, 3);
if (str == '2 3') {
_result(true);
} else if (str == '23') {
_result(false, ['Test failed. It looks like you forgot the space!']);
} else if (str == null) {
_result(false, ['Test failed. Did you forget to return a value?']);
} else {
_result(false, ['That\'s not quite right. Keep trying!']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment