Giter Site home page Giter Site logo

Comments (2)

asya81 avatar asya81 commented on August 11, 2024

テストパターン

ファイル数に応じたテストを実施するのが良さそう。

ファイルが何もない場合

(何も表示されない)

❯ ls

ファイル数が1の場合

❯ ls
1

ファイル数が2の場合

❯ ls
1	2

ファイル数が3の場合

❯ ls
1	2	3

ファイル数が4の場合

❯ ls
1	3
2	4

ファイル数が5の場合

❯ ls
1	3	5
2	4

ファイル数が6の場合

❯ ls
1	3	5
2	4	6

ファイル数が7の場合

❯ ls
1	4	7
2	5
3	6

ファイル数が8の場合

❯ ls
1	4	7
2	5	8
3	6

ファイル数が9の場合

❯ ls
1	4	7
2	5	8
3	6	9

ファイル数が10の場合

❯ ls
1	4	8
10	5	9
2	6
3	7

※ ファイル名の順に表示されるため、1, 10, 2 ...という並びになっている。

from ruby-practices.

asya81 avatar asya81 commented on August 11, 2024

ファイル名の文字数が異なる場合も考慮して、最終的には、実際にあるファイルでテストを実施した方が良さそう。

~/RubymineProjects/fjord-boot-camp/ruby-practices
❯ ls
01.fizzbuzz		05.ls			09.wc_object
02.calendar		06.wc			README.md
03.rake			07.bowling_object
04.bowling		08.ls_object

from ruby-practices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.