Skip to content

Instantly share code, notes, and snippets.

@amondnet
Last active September 3, 2020 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amondnet/fcda215f5d41551e96ca49b4d04b174c to your computer and use it in GitHub Desktop.
Save amondnet/fcda215f5d41551e96ca49b4d04b174c to your computer and use it in GitHub Desktop.
String stringify(int x, int y) {
// TODO: Return a formatted string here
// TODO: 여기서 문자열을 반화하세요.
}
String stringify(int x, int y) {
return '$x $y';
}
final errs = <String>[];
void main() {
try {
var result = stringify(1, 2);
if (result != '1 2') {
errs.add("stringify(1, 2) 는 '1 2' 를 반환해야 합니다.");
}
result = stringify(3, 4);
if (result != '3 4') {
errs.add("stringify(3, 4) 는 '3 4' 를 반환해야 합니다.");
}
} catch (e) {
errs.add(
'Tried run stringify and received an exception: ${e.runtimeType}.');
}
if (errs.isEmpty) {
_result(true);
} else {
_result(false, errs);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment