(t *testing.T)
| 881 | } |
| 882 | |
| 883 | func TestOptionFullWidth(t *testing.T) { |
| 884 | var tests = []struct { |
| 885 | opts []Option |
| 886 | expected string |
| 887 | }{ |
| 888 | { // 1 |
| 889 | []Option{}, |
| 890 | "" + |
| 891 | "\r 10% |██████ | [1s:9s]" + |
| 892 | "\r \r" + |
| 893 | "\r 100% |██████████████████████████████████████████████████████████████| ", |
| 894 | }, |
| 895 | { // 2 |
| 896 | []Option{OptionSetDescription("Progress:")}, |
| 897 | "" + |
| 898 | "\rProgress: 10% |█████ | [1s:9s]" + |
| 899 | "\r \r" + |
| 900 | "\rProgress: 100% |█████████████████████████████████████████████████████| ", |
| 901 | }, |
| 902 | { // 3 |
| 903 | []Option{OptionSetDescription("<1/5>"), OptionShowDescriptionAtLineEnd()}, |
| 904 | "" + |
| 905 | "\r 10% |█████ | [1s:9s] <1/5>" + |
| 906 | "\r \r" + |
| 907 | "\r 100% |████████████████████████████████████████████████████████| <1/5>", |
| 908 | }, |
| 909 | { // 4 |
| 910 | []Option{OptionSetPredictTime(false)}, |
| 911 | "" + |
| 912 | "\r 10% |██████ | " + |
| 913 | "\r \r" + |
| 914 | "\r 100% |█████████████████████████████████████████████████████████████████████| ", |
| 915 | }, |
| 916 | { // 5 |
| 917 | []Option{OptionSetPredictTime(false), OptionShowElapsedTimeOnFinish()}, |
| 918 | "" + |
| 919 | "\r 10% |██████ | " + |
| 920 | "\r \r" + |
| 921 | "\r 100% |████████████████████████████████████████████████████████████████| [2s] ", |
| 922 | }, |
| 923 | { // 6 |
| 924 | []Option{OptionSetPredictTime(false), OptionSetElapsedTime(false)}, |
| 925 | "" + |
| 926 | "\r 10% |██████ | " + |
| 927 | "\r \r" + |
| 928 | "\r 100% |█████████████████████████████████████████████████████████████████████| ", |
| 929 | }, |
| 930 | { // 7 |
| 931 | []Option{OptionShowIts()}, |
| 932 | "" + |
| 933 | "\r 10% |█████ | (10 it/s) [1s:9s]" + |
| 934 | "\r \r" + |
| 935 | "\r 100% |█████████████████████████████████████████████████████| (50 it/s)", |
| 936 | }, |
| 937 | { // 8 |
| 938 | []Option{OptionShowCount()}, |
| 939 | "" + |
| 940 | "\r 10% |█████ | (10/100) [1s:9s]" + |
nothing calls this directly
no test coverage detected
searching dependent graphs…