Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: recipes/test/core/strings/changing_string_case.dart

Issue 12335109: Strings recipes for the Dart Cookbook (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Fixed typos. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library changing_string_case;
2
3 import 'package:unittest/unittest.dart';
4
5 void main() {
6 group('changing string case', () {
7 var string = 'I love Lucy!';
8
9 test('with toUpperCase()', () {
10 expect(string.toUpperCase(), equals('I LOVE LUCY!'));
11 });
12
13 test('with toLowerCase()', () {
14 expect(string.toLowerCase(), equals('i love lucy!'));
15 });
16
17 test('with unicameral characters', () {
18 var chickenKebab = '\u091a\u093f\u0915\u0928 \u0915\u092c\u093e\u092c';
19 // चिकन कबाब
20 expect(chickenKebab.toLowerCase(), equals(chickenKebab));
21 expect(chickenKebab.toUpperCase(), equals(chickenKebab));
22 });
23
24 test('with bicameral characters', () {
25 var zeus = '\u0394\u03af\u03b1\u03c2'; // Δίας
26 var resume = '\u0052\u00e9\u0073\u0075\u006d\u00e9'; // Résumé
27 expect(zeus.toLowerCase(), equals('δίας'));
28 expect(zeus.toUpperCase(), equals('ΔΊΑΣ'));
29 expect(resume.toLowerCase(), equals('résumé'));
30 expect(resume.toUpperCase(), equals('RÉSUMÉ'));
31 });
32 });
33 }
34
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698