Add code and tests
authorMarius Gavrilescu <marius@ieval.ro>
Mon, 31 Mar 2014 22:12:13 +0000 (01:12 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Mon, 31 Mar 2014 22:12:13 +0000 (01:12 +0300)
lib/Text/Homestuck.pm
t/Text-Homestuck.t

index 6d9b4fdcb18e3ef9db74da30c2343b156d1be23c..88354ed355876fc3960f7590efc9493df37c9d2f 100644 (file)
@@ -3,33 +3,113 @@ package Text::Homestuck;
 use 5.014000;
 use strict;
 use warnings;
-
-require Exporter;
-
-our @ISA = qw(Exporter);
-
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-
-# This allows declaration      use Text::Homestuck ':all';
-# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
-# will save memory.
-our %EXPORT_TAGS = ( 'all' => [ qw(
-       
-) ] );
-
-our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-
-our @EXPORT = qw(
-       
-);
-
+use parent qw/Exporter/;
+our @EXPORT = qw/aradia tavros sollux karkat nepeta kanaya terezi vriska equius gamzee eridan feferi/;
 our $VERSION = '0.000_001';
-$VERSION = eval $VERSION;  # see L<perlmodstyle>
 
 
-# Preloaded methods go here.
+sub aradia (_) {
+       local $_ = $_[0];
+       y/A-Z/a-z/;
+       y/,.?//d;
+       s/o/0/g;
+       $_
+}
+
+sub tavros (_) {
+       local $_ = $_[0];
+       y/a-zA-Z.!?/A-Za-z,,,/;
+       s/:\)/}:)/g;
+       $_
+}
+
+sub sollux (_) {
+       local $_ = $_[0];
+       y/A-Z/a-z/;
+       y/s/2/;
+       s/i/ii/g;
+       s/to/two/g;
+       s/\b(fuck|joke|kk|aa)\b/\U$1/g;
+       $_
+}
+
+sub karkat (_) {
+       local $_ = $_[0];
+       y/a-z/A-Z/;
+       s/\bD:/D:B/;
+       $_
+}
+
+sub nepeta (_){
+       local $_ = $_[0];
+       y/A-Z/a-z/;
+       s/ee/33/;
+       $_ = ":33 < $_";
+       $_
+}
+
+sub kanaya (_) {
+       local $_ = $_[0];
+       y/,.!?'//d;
+       s/\b(\w)/\u$1/g;
+       $_
+}
+
+sub terezi (_) {
+       local $_ = $_[0];
+       y/a-z/A-Z/;
+       y/AIE/413/;
+       s/(!|\?)/$1$1/g;
+       s/:\]|:\)/>:]/g;
+       $_
+}
+
+sub vriska (_) {
+       local $_ = $_[0];
+       y/Bb/88/;
+       s/:\)/::::\)/g;
+       s/D:/D::::/g;
+       $_
+}
+
+sub equius (_){
+       local $_ = $_[0];
+       s/strong/STRONG/g;
+       s/strength/STRONGNESS/g;
+       s/x/%/ig;
+       s/loo/100/ig;
+       s/ool/001/ig;
+       s/[?.!]$//;
+       $_ = "D --> $_";
+       $_
+}
+
+sub gamzee (_){
+       local $_ = $_[0];
+       y/[A-Z]/[a-z]/;
+       s/([a-z])(.)/$1\u$2/g;
+       s/:\)/:o\)/g;
+       $_
+}
+
+sub eridan (_){
+       local $_ = $_[0];
+       y/',.?!//d;
+       s/w/ww/g;
+       s/v/vv/g;
+       s/ing/in/g;
+       s/want to/wanna/g;
+       s/going to/gonna/g;
+       $_
+}
+
+sub feferi (_){
+       local $_ = $_[0];
+       s/H/)(/g;
+       s/E/-E/g;
+       s/:\)/38)/g;
+       $_
+}
 
 1;
 __END__
@@ -60,14 +140,8 @@ None by default.
 
 =head1 SEE ALSO
 
-Mention other useful documentation such as the documentation of
-related modules or operating system documentation (such as man pages
-in UNIX), or any relevant external documentation such as RFCs or
-standards.
-
-If you have a mailing list set up for your module, mention it here.
-
-If you have a web site set up for your module, mention it here.
+Homestuck: L<http://mspaintadventures.com/?s=6&p=001901>
+The mspa wiki page listing the quirks: http://mspaintadventures.wikia.com/wiki/Typing_Quirk
 
 =head1 AUTHOR
 
index f5a220a5d49177adf7d1b1612b6d3458e678f53e..094cd9aefbed49a7db1414fa3f2e3b34f8bcdf50 100644 (file)
@@ -1,18 +1,70 @@
-# Before 'make install' is performed this script should be runnable with
-# 'make test'. After 'make install' it should work as 'perl Text-Homestuck.t'
-
-#########################
-
-# change 'tests => 1' to 'tests => last_test_to_print';
-
+#!/usr/bin/perl -w
+use 5.014000;
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 13;
 BEGIN { use_ok('Text::Homestuck') };
 
-#########################
+is aradia
+  'Did you set up the teams?',
+  'did y0u set up the teams',
+  'aradia';
+
+is tavros
+  'Are you ready to be trollllled?',
+  'aRE YOU READY TO BE TROLLLLLED,',
+  'tavros';
+
+is sollux
+  'kk dont flip your shit about this but Im setting you up to play a game with some people.',
+  'KK dont fliip your 2hiit about thii2 but iim 2ettiing you up two play a game wiith 2ome people.',
+  'sollux';
+
+is karkat
+  'Hi again, idiot.',
+  'HI AGAIN, IDIOT.',
+  'karkat';
+
+is nepeta
+  '*AC saunters from her dark cave a little bit sleepy from the recent kill*',
+  ':33 < *ac saunters from her dark cave a little bit sl33py from the recent kill*',
+  'nepeta';
+
+is kanaya
+  'Yes, that\'s right.',
+  'Yes Thats Right',
+  'kanaya';
+
+is vriska
+  'Marquise Spinneret Mindfang. :)',
+  'Marquise Spinneret Mindfang. ::::)',
+  'vriska';
+
+is vriska
+  'A big fucking bomb in the core of your battlefield.',
+  'A 8ig fucking 8om8 in the core of your 8attlefield.',
+  'vriska';
+
+is equius
+  'What are you expecting to accomplish with this?',
+  'D --> What are you e%pecting to accomplish with this',
+  'equius';
+
+TODO: {
+       local $TODO = 'Gamzee StUdLyCaPs not implemented';
+       is gamzee
+         'It\'s a miracle.',
+         'iT\'s A mIrAcLe.',
+         'gamzee';
+}
 
-# Insert your test code below, the Test::More module is use()ed here so read
-# its man page ( perldoc Test::More ) for help writing this test script.
+is eridan
+  'your no good connivin fucking backstabbing girl crush that\'s who.',
+  'your no good connivvin fuckin backstabbin girl crush thats wwho',
+  'eridan';
 
+is feferi
+  'HELLO!',
+  ')(-ELLO!',
+  'feferi';
This page took 0.015156 seconds and 4 git commands to generate.