Skip to content

Commit

Permalink
add command-line-test
Browse files Browse the repository at this point in the history
  • Loading branch information
getreu committed Jan 8, 2020
1 parent 79d7b92 commit 95f0cb6
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@ target
*.1
*.1.gz
.vscode/
test/output
14 changes: 14 additions & 0 deletions 01-test
@@ -0,0 +1,14 @@
#!/bin/sh

cargo test \
&& echo Cargo test succeeded. \
|| ( echo Cargo test failed. && exit 1 )


cd ./test
# We search for `?`.
../target/debug/stringsext -q 16 -g 63 -tx -a All-Ctrl -u Common -e UTF-8 -e utf-16le -e utf-16be input > output

diff output expected_output \
&& echo Commandline test succeeded. \
|| echo Commandline test failed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions test/expected_output
@@ -0,0 +1,17 @@

60 (a UTF-8) d My Cheese? is
>60+ (a UTF-8) a simple parable
80+ (a UTF-8) that reveals pr
>80+ (a UTF-8) ofound truths
500 (a UTF-8) ed My Cheese?
<fe0 (a UTF-8) "How so?" Nathan
>fe0+ (a UTF-8) asked.
1580 (a UTF-8) heese?"
15e0 (a UTF-8) y? Maybe we can
>15e0+ (a UTF-8) get something fr
1600+ (a UTF-8) om it."
2f40 (a UTF-8) My Cheese? throu
>2f40+ (a UTF-8) gh the adv
2f60+ (a UTF-8) entures of Sniff
>2f60+ (a UTF-8) , Scurry, Hem an
2f80+ (a UTF-8) d Haw, as a way
253 changes: 253 additions & 0 deletions test/input
@@ -0,0 +1,253 @@
Who Moved My Cheese?
An A-Mazing Way To Deal With Change In Your Work
And In Your Life
Who Moved My Cheese? is a simple parable that reveals profound truths
about change. It is an amusing and enlightening story of four characters who
live in a 'Maze' and look for 'Cheese' to nourish them and make them happy.
Two are mice named Sniff and Scurry. And two are little people' - beings the
size of mice who look and act a lot like people. Their names are Hem and
Haw. 'Cheese' is a metaphor for what you want to have in life - whether it's a
good job, a loving relationship, money, a possession, good health, or spiritual
peace of mind. And 'The Maze' is where you look for what you want - the
organization you work in, or the family or community you live in.
In the story, the characters are faced with unexpected change. Eventually,
one of them deals with it successfully, and writes what he has learned from
his experience on the maze walls.
When you come to see 'The Handwriting on the Wall', you can discover for
yourself how to deal with change, so that you can enjoy less stress and more
success (however you define it) in your work and in your life.
Written for all ages, this story takes less than an hour to read, but its unique
insights can last for a lifetime.

Who Moved My Cheese?
Contents
Parts of All of Us
A Gathering: Chicago
Who Moved My Cheese?: The Story
Four Characters
Finding Cheese
No Cheese!
The Mice: Sniff & Scurry
The Little people: Hem & Haw
Meanwhile, Back In the Maze
Getting Beyond Fear
Enjoying The Adventure
Moving With The Cheese
The Handwriting On The Wall
Tasting New Cheese
Enjoying Change!
A Discussion: Later That Same Day
New Cheese !

Parts of All of Us
The Simple and The Complex
The four imaginary characters
depicted in this story —
the mice: "Sniff" and "Scurry;' and
the Little people: "Hem" and "Haw" —
are intended to represent the simple and
the complex parts of ourselves, regardless of
our age, gender, race or nationality.
Sometimes we may act like
Sniff
Who sniffs out change early, or
Scurry
Who scurries into action, or
Hem
Who denies and resists change as he fears
it will lead to something worse, or
Haw
Who learns to adapt in time when he sees
changing can lead to something better!
Whatever parts of us we choose to use,
we all share something in common:
a need to find our way in the Maze
and succeed in changing times.

A Gathering
Chicago
One sunny Sunday in Chicago, several former classmates, who were good
friends in school, gathered for lunch, having attended their high school
reunion the night before. They wanted to hear more about what was
happening in each other's lives. After a good deal of kidding, and a good
meal, they settled into an interesting conversation.
Angela, who had been one of the most popular people in the class, said, "Life
sure turned out differently than I thought it would when we were in school. A
lot has changed."
"It certainly has," Nathan echoed. They knew he had gone into his family's
business, which had operated pretty much the same and had been a part of
the local community for as long as they could remember. So, they were
surprised when he seemed concerned. He asked, "But, have you noticed
how we don't want to change when things change?"
Carlos said, "I guess we resist changing, because we're afraid of change."
"Carlos, you were Captain of the football team" Jessica said. "I never thought
I'd hear you say anything about being afraid!"
They all laughed as they realized that although they had gone off in different
directions—from working at home to managing companies—they were
experiencing similar feelings.
Everyone was trying to cope with the unexpected changes that were
happening to them in recent years. And most admitted that they did not know
a good way to handle them.
Then Michael said, "I used to be afraid of change. When a big change came
along in our business, we didn't know what to do. So we didn't adjust and we
almost lost it.
"That is," he continued, "until I heard a funny little story that changed
everything."
"How so?" Nathan asked.
"Well, the story changed the way I looked at change—from losing something
to gaining some-thing—and it showed me how to do it. After that, things
quickly improved—at work and in my life.
"At first I was annoyed with the obvious simplicity of the story because it
sounded like something we might have been told in school.
"Then I realized I was really annoyed with myself for not seeing the obvious
and doing what works when things change.

"When I realized the four characters in the story represented the various parts
of myself, I decided who I wanted to act like and I changed.
"Later, I passed the story on to some people in our company and they passed
it on to others, and soon our business did much better, because most of us
adapted to change better. And like me, many people said it helped them in
their personal lives.
"However there were a few people who said they got nothing out of it. They
either knew the lessons and were already living them, or, more commonly,
they thought they already knew everything and didn't want to learn. They
couldn't see why so many others were benefiting from it.
"When one of our senior executives, who was having difficulty adapting, said
the story was a waste of time, other people kidded him saying they knew
which character he was in the story—meaning the one who learned nothing
new and did not change.'"
"What's the story?" Angela asked.
"It's called. Who Moved My Cheese?"
The group laughed. "I think I like it already," Carlos said. "Would you tell us
the story? Maybe we can get something from it."
"Sure," Michael replied. "I'd be happy to—it doesn't take long." And so he
began:

Who Moved My Cheese? The Story
UNCE, long ago in a land far away, there lived four little characters who ran
through a Maze looking for cheese to nourish them and make them happy.
Two were mice, named "Sniff" and "Scurry" and two were Little people—
beings who were as small as mice but who looked and acted a lot like people
today. Their names were "Hem" and "Haw."
Due to their small size, it would be easy not to notice what the four of them
were doing. But if you looked closely enough, you could discover the most
amazing things!
Every day the mice and the Little people spent time in the Maze looking for
their own special cheese.
The mice. Sniff and Scurry, possessing simple brains and good instincts,
searched for the hard nibbling cheese they liked, as mice often do.
The two Little people, Hem and Haw, used their complex brains, filled with
many beliefs and emotions, to search for a very different kind of Cheese—
with a capital C—which they believed would make them feel happy and
successful.
As different as the mice and Little people were, they shared something in
common: every morning, they each put on their jogging suits and running
shoes, left their little homes, and raced out into the Maze looking for their
favourite cheese.
The Maze was a labyrinth of corridors and chambers, some containing
delicious cheese. But there were also dark corners and blind alleys leading
nowhere. It was an easy place for anyone to get lost.
However, for those who found their way, the Maze held secrets that let them
enjoy a better life. The mice, Sniff and Scurry, used the simple trial-and-error
method of finding cheese. They ran down one corridor, and if it proved empty,
they turned and ran down another. They remembered the corridors that held
no cheese and quickly went into new areas.
Sniff would smell out the general direction of the cheese, using his great nose,
and Scurry would race ahead. They got lost, as you might expect, went off in
the wrong direction and often bumped into walls.
But after a while, they found their way.
Like the mice, the two Little people, Hem and Haw, also used their ability to
think and learn from their past experiences. However, they relied on their
complex brains to develop more sophisticated methods of finding Cheese.
Sometimes they did well, but at other times their powerful human beliefs and

emotions took over and clouded the way they looked at things. It made life in
the Maze more complicated and challenging.
Nonetheless, Sniff, Scurry, Hem and Haw all discovered, in their own way,
what they were looking for. They each found their own kind of cheese one
day at the end of one of the corridors in cheese Station C.
Every morning after that, the mice and the Little people dressed in their
running gear and headed over to Cheese Station C. It wasn't long before they
each established their own routine.
Sniff and Scurry continued to wake early every day and race through the
Maze, always following the same route.
When they arrived at their destination, the mice took off their running shoes,
tied them together and hung them around their necks—so they could get to
them quickly whenever they needed them again.
Then they enjoyed the cheese.
In the beginning Hem and Haw also raced toward Cheese Station C every
morning to enjoy the tasty new morsels that awaited them. But after a while, a
different routine set in for the Little people.
Hem and Haw awoke each day a little later, dressed a little slower, and
walked to Cheese Station C. After all, they knew where the Cheese was now
and how to get there.
They had no idea where the Cheese came from, or who put it there. They just
assumed it would be there.
As soon as Hem and Haw arrived at Cheese Station C each morning, they
settled in and made themselves at home. They hung up their jogging suits,
put away their running shoes and put on their slippers. They were becoming
very comfortable now that they had found the Cheese.
"This is great" Hem said. "There's enough Cheese here to last us forever."
The Little people felt happy and successful, and thought they were now
secure.
It wasn't long before Hem and Haw regarded the Cheese they found at
Cheese Station C as their cheese. It was such a large store of Cheese that
they eventually moved their homes to be closer to it, and built a social life
around it.
To make themselves feel more at home, Hem and Haw decorated the walls
with sayings and even drew pictures of Cheese around them which made
them smile. One read:

Sometimes Hem and Haw would take their friends by to see their pile of
Cheese at Cheese Station C, and point to it with pride, saying, "Pretty
nice Cheese, hub?" Sometimes they shared it with their friends and
sometimes they didn't.
"We deserve this Cheese,"' Hem said. "We certainly had to work long and
hard enough to find it." He picked up a nice fresh piece and ate it. Afterward,
Hem fell asleep, as he often did.
Every night the Little people would waddle home, full of Cheese, and every
morning they would confidently return for more. This went on for quite some
time.
After a while Hem's and Haw's confidence grew into the arrogance of
success. Soon they became so comfortable they didn't even notice what was
happening.
As time went on. Sniff and Scurry continued their routine. They arrived early
each morning and sniffed and scratched and scurried around Cheese Station
C, inspecting the area to see if there had been any changes from the day
before. Then they would sit down to nibble on the cheese.
One morning they arrived at Cheese Station C and discovered there was no
cheese.
They weren't surprised. Since Sniff and Scurry had noticed the supply of
cheese had been getting smaller every day, they were prepared for the
inevitable and knew instinctively what to do.
They looked at each other, removed the running shoes they had tied together
and hung conveniently around their necks, put them on their feet and laced
them up.
The mice did not over analyze things. To the mice, the problem and the


Services
Keynote Presentations, Change Leader Certification and Learning Programs
Products
The 'New Cheese 'Experience
An interactive program used successfully by many organizations around the
world to help individuals and organizations change and win.
Who Moved My Cheese? The Movie:
A 13 minute animated movie on videocassette tells the Story of Who Moved
My Cheese? through the adventures of Sniff, Scurry, Hem and Haw, as a way
to introduce change in your organization in a fun and non-threatening way.
Aft A-Mawng Change Profile:
A self-scoring tool. Find out who you are, what personalities are at work
around you, and how you can work together to change and win!
NEW! Who Moved My Cheese? Personal Planner Inserts / Binder:
This daily planner will help you keep track of your most important 'Cheese'
things to do, notes and contact information using Cheese language in a fun
way.
Fun, Practical Reminders
Posters, Day-to-Day Desk Calendar, Coffee Mugs, Post-It Notes, Cheese
Squeezes, Maze Pens, Logo Shirts, Handwriting on the Wall Cards, and
more!
To learn more, visit:
www.WhoMovedMyCheese.com


0 comments on commit 95f0cb6

Please sign in to comment.