Skip to content

Commit d1a7a6a

Browse files
apply CR suggestions
1 parent 0b52240 commit d1a7a6a

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

Diff for: internal/integrationtest/daemon/daemon_test.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"time"
2424

2525
"github.com/arduino/arduino-cli/arduino"
26+
f "github.com/arduino/arduino-cli/internal/algorithms"
2627
"github.com/arduino/arduino-cli/internal/integrationtest"
2728
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
2829
"github.com/arduino/go-paths-helper"
@@ -187,13 +188,7 @@ func TestDaemonCompileOptions(t *testing.T) {
187188
// assert that the task progress is increasing and doesn't contain multiple 100% values
188189
results := analyzer.Results[""]
189190
require.True(t, results[len(results)-1].Completed)
190-
require.IsNonDecreasing(t, func() []float32{
191-
res := make([]float32, len(results))
192-
for i := 0; i < len(results); i++ {
193-
res[i] = results[i].Percent
194-
}
195-
return res
196-
}())
191+
require.IsNonDecreasing(t, f.Map(results, (*commands.TaskProgress).GetPercent))
197192
}
198193

199194
func TestDaemonCompileAfterFailedLibInstall(t *testing.T) {

Diff for: internal/integrationtest/daemon/task_progress_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2022 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to [email protected].
15+
116
package daemon_test
217

318
import (

0 commit comments

Comments
 (0)