Created
September 17, 2019 10:53
-
-
Save JustDravee/e5f6885e7b055914655eae3bd5d93920 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:interview_algorithms_dart/longest-substring-without-repeating-characters.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test("Chaîne vide", () { | |
expect(longestSubstringWithoutRepeatingCharacters(""), ""); | |
}); | |
test("Chaîne entière", () { | |
expect( | |
longestSubstringWithoutRepeatingCharacters("ilovecats"), "ilovecats"); | |
}); | |
test("Caractère répété", () { | |
expect(longestSubstringWithoutRepeatingCharacters("aaaaaaaaaa"), "a"); | |
}); | |
test("Double caractère répété", () { | |
expect(longestSubstringWithoutRepeatingCharacters("aaaaabbbbbb"), "ab"); | |
}); | |
test("Double caractère répété puis mot", () { | |
expect(longestSubstringWithoutRepeatingCharacters("aaaaabbbbbbot"), "bot"); | |
}); | |
test("Mot répété", () { | |
expect(longestSubstringWithoutRepeatingCharacters("catcatcat"), "cat"); | |
}); | |
test("Début de chaîne", () { | |
expect( | |
longestSubstringWithoutRepeatingCharacters("lamernoire"), "lamernoi"); | |
}); | |
test("Milieu de chaîne", () { | |
expect(longestSubstringWithoutRepeatingCharacters("aaamazeeee"), "maze"); | |
}); | |
test("Fin de chaîne", () { | |
expect(longestSubstringWithoutRepeatingCharacters("amazing"), "mazing"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment