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

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

Issue 12335109: Strings recipes for the Dart Cookbook (Closed) Base URL: https://github.com/dart-lang/cookbook.git@master
Patch Set: Made most changes requested my Kathy. 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_test;
2
3 import 'package:unittest/unittest.dart';
4
5 void main() {
6 group('changing string case', () {
7 var theOneILove = 'I love Lucy!';
8
9 test('with toUpperCase()', () {
10 expect(theOneILove.toUpperCase(), equals('I LOVE LUCY!'));
11 });
12
13 test('with toLowerCase()', () {
14 expect(theOneILove.toLowerCase(), equals('i love lucy!'));
15 });
16
17 test('with bicameral characters', () {
18 var zeus = '\u0394\u03af\u03b1\u03c2'; // Δίας
19 var resume = '\u0052\u00e9\u0073\u0075\u006d\u00e9'; // Résumé
20 expect(zeus.toLowerCase(), equals('δίας'));
21 expect(zeus.toUpperCase(), equals('ΔΊΑΣ'));
22 expect(resume.toLowerCase(), equals('résumé'));
23 expect(resume.toUpperCase(), equals('RÉSUMÉ'));
24 });
25
26 test('with unicameral characters', () {
27 var chickenKebab = '\u091a\u093f\u0915\u0928 \u0915\u092c\u093e\u092c';
28 // चिकन कबाब
29 expect(chickenKebab.toLowerCase(), equals(chickenKebab));
30 expect(chickenKebab.toUpperCase(), equals(chickenKebab));
31 });
32 });
33 }
34
OLDNEW
« no previous file with comments | « recipes/test/core/strings/calculating_the_length_test.dart ('k') | recipes/test/core/strings/concatenating_strings_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698