diff --git a/birdie_snapshots/test_spinner_bar_left_right_spinner.accepted b/birdie_snapshots/test_spinner_bar_left_right_spinner.accepted index 9c6bd18..7e14efa 100644 --- a/birdie_snapshots/test_spinner_bar_left_right_spinner.accepted +++ b/birdie_snapshots/test_spinner_bar_left_right_spinner.accepted @@ -5,23 +5,30 @@ file: ./test/glitzer_test.gleam test_name: spinner_bar_left_right_spinner_test --- SpinnerStyle( - Frames(#( - "▏", - "▎", - "▍", - "▌", - "▋", - "▊", - "▉", - "█", - "▉", - "▊", - "▋", - "▌", - "▍", - "▎", - )), 100, "", - State("", "", 0, False, None), + State( + Frames(#( + "▏", + "▎", + "▍", + "▌", + "▋", + "▊", + "▉", + "█", + "▉", + "▊", + "▋", + "▌", + "▍", + "▎", + )), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_bar_up_down_spinner.accepted b/birdie_snapshots/test_spinner_bar_up_down_spinner.accepted index 1f1574a..4f8a42d 100644 --- a/birdie_snapshots/test_spinner_bar_up_down_spinner.accepted +++ b/birdie_snapshots/test_spinner_bar_up_down_spinner.accepted @@ -5,23 +5,30 @@ file: ./test/glitzer_test.gleam test_name: spinner_bar_up_down_spinner_test --- SpinnerStyle( - Frames(#( - "▁", - "▂", - "▃", - "▄", - "▅", - "▆", - "▇", - "█", - "▇", - "▆", - "▅", - "▄", - "▃", - "▂", - )), 100, "", - State("", "", 0, False, None), + State( + Frames(#( + "▁", + "▂", + "▃", + "▄", + "▅", + "▆", + "▇", + "█", + "▇", + "▆", + "▅", + "▄", + "▃", + "▂", + )), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_default_spinner.accepted b/birdie_snapshots/test_spinner_default_spinner.accepted index 56426e9..c9692e2 100644 --- a/birdie_snapshots/test_spinner_default_spinner.accepted +++ b/birdie_snapshots/test_spinner_default_spinner.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_default_spinner_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 100, "", - State("", "", 0, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_prideful_spinner.accepted b/birdie_snapshots/test_spinner_prideful_spinner.accepted index a39684e..50a2194 100644 --- a/birdie_snapshots/test_spinner_prideful_spinner.accepted +++ b/birdie_snapshots/test_spinner_prideful_spinner.accepted @@ -5,20 +5,27 @@ file: ./test/glitzer_test.gleam test_name: spinner_prideful_spinner_test --- SpinnerStyle( - Frames(#( - "░", - "▒", - "▓", - "█", - "▓", - "▒", - "░", - "▒", - "▓", - "█", - "▓", - )), 200, "", - State("", "", 0, False, None), + State( + Frames(#( + "░", + "▒", + "▓", + "█", + "▓", + "▒", + "░", + "▒", + "▓", + "█", + "▓", + )), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_pulsating_spinner.accepted b/birdie_snapshots/test_spinner_pulsating_spinner.accepted index ae09491..f362726 100644 --- a/birdie_snapshots/test_spinner_pulsating_spinner.accepted +++ b/birdie_snapshots/test_spinner_pulsating_spinner.accepted @@ -5,8 +5,22 @@ file: ./test/glitzer_test.gleam test_name: spinner_pulsating_spinner_test --- SpinnerStyle( - Frames(#("░", "▒", "▓", "█", "▓", "▒")), 100, "", - State("", "", 0, False, None), + State( + Frames(#( + "░", + "▒", + "▓", + "█", + "▓", + "▒", + )), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_spinning_spinner.accepted b/birdie_snapshots/test_spinner_spinning_spinner.accepted index 404dcec..d9ad8aa 100644 --- a/birdie_snapshots/test_spinner_spinning_spinner.accepted +++ b/birdie_snapshots/test_spinner_spinning_spinner.accepted @@ -5,17 +5,24 @@ file: ./test/glitzer_test.gleam test_name: spinner_spinning_spinner_test --- SpinnerStyle( - Frames(#( - "⣾", - "⣷", - "⣯", - "⣟", - "⡿", - "⢿", - "⣻", - "⣽", - )), 100, "", - State("", "", 0, False, None), + State( + Frames(#( + "⣾", + "⣷", + "⣯", + "⣟", + "⡿", + "⢿", + "⣻", + "⣽", + )), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_tick.accepted b/birdie_snapshots/test_spinner_tick.accepted index 2b5a274..20a452d 100644 --- a/birdie_snapshots/test_spinner_tick.accepted +++ b/birdie_snapshots/test_spinner_tick.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_tick_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 100, "", - State("", "", 1, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "", + 1, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_tick_by.accepted b/birdie_snapshots/test_spinner_tick_by.accepted index 0fa029a..fea5f2f 100644 --- a/birdie_snapshots/test_spinner_tick_by.accepted +++ b/birdie_snapshots/test_spinner_tick_by.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_tick_by_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 100, "", - State("", "", 10, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "", + 10, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_with_finish_text.accepted b/birdie_snapshots/test_spinner_with_finish_text.accepted index d3e4f68..102d475 100644 --- a/birdie_snapshots/test_spinner_with_finish_text.accepted +++ b/birdie_snapshots/test_spinner_with_finish_text.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_with_finish_text_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 100, "asdf", - State("", "", 0, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_with_frame_transform.accepted b/birdie_snapshots/test_spinner_with_frame_transform.accepted new file mode 100644 index 0000000..2e12d8b --- /dev/null +++ b/birdie_snapshots/test_spinner_with_frame_transform.accepted @@ -0,0 +1,19 @@ +--- +version: 1.1.6 +title: Test spinner.with_frame_transform +file: ./test/glitzer_test.gleam +test_name: spinner_with_frame_transform_test +--- +SpinnerStyle( + 100, + "", + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), +) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_with_frames.accepted b/birdie_snapshots/test_spinner_with_frames.accepted new file mode 100644 index 0000000..d47f163 --- /dev/null +++ b/birdie_snapshots/test_spinner_with_frames.accepted @@ -0,0 +1,19 @@ +--- +version: 1.1.6 +title: Test spinner.with_frames +file: ./test/glitzer_test.gleam +test_name: spinner_with_frames_test +--- +SpinnerStyle( + 100, + "", + State( + Frames(#("a", "s", "d", "f")), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), +) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_with_left_text.accepted b/birdie_snapshots/test_spinner_with_left_text.accepted index aa624b3..23f2b53 100644 --- a/birdie_snapshots/test_spinner_with_left_text.accepted +++ b/birdie_snapshots/test_spinner_with_left_text.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_with_left_text_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 100, "", - State("asdf", "", 0, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "asdf", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_with_right_text.accepted b/birdie_snapshots/test_spinner_with_right_text.accepted index 54974b2..836f685 100644 --- a/birdie_snapshots/test_spinner_with_right_text.accepted +++ b/birdie_snapshots/test_spinner_with_right_text.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_with_right_text_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 100, "", - State("", "asdf", 0, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "asdf", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/birdie_snapshots/test_spinner_with_tick_rate.accepted b/birdie_snapshots/test_spinner_with_tick_rate.accepted index a05f727..bb1ae57 100644 --- a/birdie_snapshots/test_spinner_with_tick_rate.accepted +++ b/birdie_snapshots/test_spinner_with_tick_rate.accepted @@ -5,8 +5,15 @@ file: ./test/glitzer_test.gleam test_name: spinner_with_tick_rate_test --- SpinnerStyle( - Frames(#("|", "/", "-", "\")), 10, "", - State("", "", 0, False, None), + State( + Frames(#("|", "/", "-", "\")), + //fn(a) { ... }, + "", + "", + 0, + False, + None, + ), ) \ No newline at end of file diff --git a/test/glitzer_test.gleam b/test/glitzer_test.gleam index 754b4de..b25ad0c 100644 --- a/test/glitzer_test.gleam +++ b/test/glitzer_test.gleam @@ -236,6 +236,20 @@ pub fn spinner_with_finish_text_test() { |> birdie.snap(title: "Test spinner.with_finish_text") } +pub fn spinner_with_frames_test() { + spinner.default_spinner() + |> spinner.with_frames(spinner.frames_from_list(["a", "s", "d", "f"])) + |> pprint.format + |> birdie.snap(title: "Test spinner.with_frames") +} + +pub fn spinner_with_frame_transform_test() { + spinner.default_spinner() + |> spinner.with_frame_transform(fn(_) { "asdf" }) + |> pprint.format + |> birdie.snap(title: "Test spinner.with_frame_transform") +} + pub fn spinner_tick_test() { spinner.default_spinner() |> spinner.tick()